ambry icon indicating copy to clipboard operation
ambry copied to clipboard

Cleanup ReplicationEngine:createThreadPool to avoid hardcoding Vcr

Open lightningrob opened this issue 4 years ago • 0 comments

The method that creates replication threads hardcodes the prefix "Vcr" in the thread name when the startThread argument has value of true. While it currently happens to be the case that the parameter is only set for Vcr, it is dangerous to make that assumption and makes the code non-intuitive to read.

 private List<ReplicaThread> createThreadPool(String datacenter, int numberOfThreads, boolean startThread) {
      String threadIdentity =
          (startThread ? "Vcr" : "") + "ReplicaThread-" + (dataNodeId.getDatacenterName().equals(datacenter) ? "Intra-"
              : "Inter-") + i + "-" + datacenter;

lightningrob avatar Jan 07 '21 17:01 lightningrob