コード例 #1
0
ファイル: WorkerStorage.java プロジェクト: kinleyma/tachyon
 /** Register this TachyonWorker to the TachyonMaster */
 public void register() {
   long id = 0;
   while (id == 0) {
     try {
       mMasterClient.connect();
       id =
           mMasterClient.worker_register(
               mWorkerAddress,
               mWorkerSpaceCounter.getCapacityBytes(),
               mWorkerSpaceCounter.getUsedBytes(),
               new ArrayList<Long>(mMemoryData));
     } catch (BlockInfoException e) {
       LOG.error(e.getMessage(), e);
       id = 0;
       CommonUtils.sleepMs(LOG, Constants.SECOND_MS);
     } catch (TException e) {
       LOG.error(e.getMessage(), e);
       id = 0;
       CommonUtils.sleepMs(LOG, Constants.SECOND_MS);
     }
   }
   mWorkerId = id;
 }
コード例 #2
0
ファイル: WorkerStorage.java プロジェクト: kinleyma/tachyon
 /**
  * Set a new MasterClient and connect to it.
  *
  * @throws TException
  */
 public void resetMasterClient() throws TException {
   MasterClient tMasterClient = new MasterClient(mMasterAddress);
   tMasterClient.connect();
   mMasterClient = tMasterClient;
 }