Skip to content

Commit

Permalink
[TACHYON-865] address reviewers' comments
Browse files Browse the repository at this point in the history
  • Loading branch information
miasantreble committed Sep 19, 2015
1 parent 8630c10 commit ca17dda
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Expand Up @@ -34,6 +34,7 @@
public final class BlockMasterClientPool extends ResourcePool<BlockMasterClient> {
private final ExecutorService mExecutorService;
private final InetSocketAddress mMasterAddress;
private final int mMaxCapacity;

/**
* Creates a new block master client pool.
Expand All @@ -42,9 +43,9 @@ public final class BlockMasterClientPool extends ResourcePool<BlockMasterClient>
*/
public BlockMasterClientPool(InetSocketAddress masterAddress) {
super(ClientContext.getConf().getInt(Constants.USER_BLOCK_MASTER_CLIENT_THREADS));
int capacity = ClientContext.getConf().getInt(Constants.USER_BLOCK_MASTER_CLIENT_THREADS);
mMaxCapacity = ClientContext.getConf().getInt(Constants.USER_BLOCK_MASTER_CLIENT_THREADS);
mExecutorService =
Executors.newFixedThreadPool(capacity,
Executors.newFixedThreadPool(mMaxCapacity,
ThreadFactoryUtils.build("block-master-heartbeat-%d", true));
mMasterAddress = masterAddress;
}
Expand Down
Expand Up @@ -49,7 +49,7 @@ public enum BlockStoreContext {
*/
BlockStoreContext() {
mBlockMasterClientPool = new BlockMasterClientPool(ClientContext.getMasterAddress());
final int CAPACITY = ClientContext.getConf().getInt(Constants.USER_REMOTE_WORKER_THREADS);
final int CAPACITY = ClientContext.getConf().getInt(Constants.USER_REMOTE_BLOCK_WORKER_THREADS);
mRemoteBlockWorkerExecutor =
Executors.newFixedThreadPool(CAPACITY,
ThreadFactoryUtils.build("remote-block-worker-heartbeat-%d", true));
Expand Down
Expand Up @@ -40,16 +40,17 @@ public final class BlockWorkerClientPool extends ResourcePool<WorkerClient> {
*/
private final ExecutorService mExecutorService;
private final NetAddress mWorkerNetAddress;
private final int mMaxCapacity;

/**
* Creates a new block worker client pool.
*
* @param workerAddress the worker address
*/
public BlockWorkerClientPool(NetAddress workerAddress) {
super(ClientContext.getConf().getInt(Constants.USER_BLOCK_WORKER_CLIENT_THREADS));
int capacity = ClientContext.getConf().getInt(Constants.USER_BLOCK_WORKER_CLIENT_THREADS);
mExecutorService = Executors.newFixedThreadPool(capacity, ThreadFactoryUtils.build(
super(ClientContext.getConf().getInt(Constants.USER_LOCAL_BLOCK_WORKER_CLIENT_THREADS));
mMaxCapacity = ClientContext.getConf().getInt(Constants.USER_LOCAL_BLOCK_WORKER_CLIENT_THREADS);
mExecutorService = Executors.newFixedThreadPool(mMaxCapacity, ThreadFactoryUtils.build(
"block-worker-heartbeat-%d", true));
mWorkerNetAddress = workerAddress;
}
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/tachyon/Constants.java
Expand Up @@ -250,10 +250,10 @@ public final class Constants {
public static final String USER_REMOTE_BLOCK_WRITER = "tachyon.user.remote.block.writer.class";
public static final String USER_ENABLE_LOCAL_READ = "tachyon.user.localread.enable";
public static final String USER_ENABLE_LOCAL_WRITE = "tachyon.user.localwrite.enable";
public static final String USER_REMOTE_WORKER_THREADS =
public static final String USER_REMOTE_BLOCK_WORKER_THREADS =
"tachyon.user.remote.block.worker.threads";
public static final String USER_BLOCK_WORKER_CLIENT_THREADS =
"tachyon.user.block.worker.client.threads";
public static final String USER_LOCAL_BLOCK_WORKER_CLIENT_THREADS =
"tachyon.user.local.block.worker.client.threads";
public static final String USER_BLOCK_MASTER_CLIENT_THREADS =
"tachyon.user.block.master.client.threads";

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/tachyon-default.properties
Expand Up @@ -112,5 +112,5 @@ tachyon.user.localwrite.enable=true
tachyon.user.network.netty.worker.threads=0
tachyon.user.network.netty.timeout.ms=3000
tachyon.user.remote.block.worker.threads=10
tachyon.user.block.worker.client.threads=10000
tachyon.user.local.block.worker.client.threads=10000
tachyon.user.block.master.client.threads=10

0 comments on commit ca17dda

Please sign in to comment.