Skip to content

Commit

Permalink
remove the deprecated constructor in TachyonWorker.
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyuan committed Apr 1, 2015
1 parent bcadff6 commit 773bbc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 43 deletions.
37 changes: 0 additions & 37 deletions core/src/main/java/tachyon/worker/TachyonWorker.java
Expand Up @@ -53,43 +53,6 @@
public class TachyonWorker implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);

/**
* Create a new TachyonWorker
*
* @param masterAddress The TachyonMaster's address. e.g., localhost
* @param masterPort The TachyonMaster's port. e.g., 19998
* @param workerPort This TachyonWorker's port. e.g., 29998
* @param dataPort This TachyonWorker's data server's port
* @param minWorkerThreads The min number of worker threads used in TThreadPoolServer
* @param maxWorkerThreads The max number of worker threads used in TThreadPoolServer
* @param tachyonConf The instance of {@link tachyon.conf.TachyonConf} to used by Worker.
* @return The new TachyonWorker
*/
public static synchronized TachyonWorker createWorker(String masterAddress, int masterPort,
int workerPort, int dataPort, int minWorkerThreads, int maxWorkerThreads,
TachyonConf tachyonConf) {
if (masterAddress != null) {
tachyonConf.set(Constants.MASTER_ADDRESS, masterAddress);
}
if (masterPort >= 0) {
tachyonConf.set(Constants.MASTER_PORT, masterPort + "");
}
if (workerPort >= 0) {
tachyonConf.set(Constants.WORKER_PORT, workerPort + "");
}
if (dataPort >= 0) {
tachyonConf.set(Constants.WORKER_DATA_PORT, dataPort + "");
}
if (minWorkerThreads > 0) {
tachyonConf.set(Constants.WORKER_MIN_WORKER_THREADS, minWorkerThreads + "");
}
if (maxWorkerThreads > 0) {
tachyonConf.set(Constants.WORKER_MAX_WORKER_THREADS, maxWorkerThreads + "");
}

return createWorker(tachyonConf);
}

/**
* Create a new TachyonWorker
*
Expand Down
Expand Up @@ -31,7 +31,6 @@
import tachyon.client.TachyonFS;
import tachyon.conf.TachyonConf;
import tachyon.util.CommonUtils;
import tachyon.util.NetworkUtils;
import tachyon.worker.TachyonWorker;

/**
Expand Down Expand Up @@ -184,8 +183,8 @@ public void start() throws IOException {
mWorkerConf.set("tachyon.worker.hierarchystore.level0.dirs.path", mTachyonHome + "/ramdisk");
mWorkerConf.set("tachyon.worker.hierarchystore.level0.dirs.quota", mWorkerCapacityBytes + "");

// Since tests are always running on a single host keep the resolution timeout low as otherwise people
// running with strange network configurations will see very slow tests
// Since tests are always running on a single host keep the resolution timeout low as otherwise
// people running with strange network configurations will see very slow tests
mWorkerConf.set(Constants.HOST_RESOLUTION_TIMEOUT_MS, "250");

for (int level = 1; level < maxLevel; level ++) {
Expand All @@ -199,9 +198,14 @@ public void start() throws IOException {
newPath.substring(0, newPath.length() - 1));
}

mWorker =
TachyonWorker.createWorker(mCuratorServer.getConnectString().split(":")[0],
mCuratorServer.getPort(), 0, 0, 1, 100, mWorkerConf);
mWorkerConf.set(Constants.MASTER_ADDRESS, mCuratorServer.getConnectString().split(":")[0]);
mWorkerConf.set(Constants.MASTER_PORT, mCuratorServer.getPort() + "");
mWorkerConf.set(Constants.WORKER_PORT, "0");
mWorkerConf.set(Constants.WORKER_DATA_PORT, "0");
mWorkerConf.set(Constants.WORKER_MIN_WORKER_THREADS, "1");
mWorkerConf.set(Constants.WORKER_MAX_WORKER_THREADS, "100");

mWorker = TachyonWorker.createWorker(mWorkerConf);
Runnable runWorker = new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 773bbc1

Please sign in to comment.