Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup ReplicationEngine:createThreadPool to avoid hardcoding Vcr #1742

Open
lightningrob opened this issue Jan 7, 2021 · 0 comments
Open

Comments

@lightningrob
Copy link
Contributor

lightningrob commented Jan 7, 2021

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant