protected List<ReplicaThread> getOrCreateThreadPoolIfNecessary(String datacenter, boolean startThread) {
    int numOfThreadsInPool =
        datacenter.equals(dataNodeId.getDatacenterName()) ? replicationConfig.replicationNumOfIntraDCReplicaThreads
            : replicationConfig.replicationNumOfInterDCReplicaThreads;
    if (numOfThreadsInPool <= 0) {
      return null;
    }
    return replicaThreadPoolByDc.computeIfAbsent(datacenter,
        key -> createThreadPool(datacenter, numOfThreadsInPool, startThread));
  }
Get thread pool for given datacenter. Create thread pool for a datacenter if its thread pool doesn't exist.
@param datacenter The datacenter String.
@param startThread If thread needs to be started when create.
@return List of {@link ReplicaThread}s. Return null if number of replication thread in config is 0 for this DC.
ambry-replication/src/main/java/com/github/ambry/replication/ReplicationEngine.java