/** 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; }
/** * Set a new MasterClient and connect to it. * * @throws TException */ public void resetMasterClient() throws TException { MasterClient tMasterClient = new MasterClient(mMasterAddress); tMasterClient.connect(); mMasterClient = tMasterClient; }