/** * Reset the TachyonConf instance in master context, for test only. * TODO(binfan): consider a better way to mock test TachyonConf */ public static void resetConf() { sTachyonConf = new TachyonConf(); } }
@Override public long getDefaultBlockSize() { return mTachyonConf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); }
@Override public void connectFromMaster(TachyonConf conf, String host) throws IOException { if (!conf.containsKey(Constants.MASTER_KEYTAB_KEY) || !conf.containsKey(Constants.MASTER_PRINCIPAL_KEY)) { return; } String masterKeytab = conf.get(Constants.MASTER_KEYTAB_KEY); String masterPrincipal = conf.get(Constants.MASTER_PRINCIPAL_KEY); login(Constants.MASTER_KEYTAB_KEY, masterKeytab, Constants.MASTER_PRINCIPAL_KEY, masterPrincipal, host); }
/** * @return the ufs address for this master */ public String getUfsAddress() { return MasterContext.getConf().get(Constants.UNDERFS_ADDRESS); }
/** * Creates a new block master client pool. * * @param masterAddress the master address */ public BlockMasterClientPool(InetSocketAddress masterAddress) { super(ClientContext.getConf().getInt(Constants.USER_BLOCK_MASTER_CLIENT_THREADS)); mMasterAddress = masterAddress; }
public DataServerHandler(final BlockDataManager dataManager, TachyonConf tachyonConf) { mDataManager = Preconditions.checkNotNull(dataManager); mTachyonConf = Preconditions.checkNotNull(tachyonConf); mTransferType = mTachyonConf.getEnum(Constants.WORKER_NETWORK_NETTY_FILE_TRANSFER_TYPE, FileTransferType.class); }
@Override public void connectFromWorker(TachyonConf conf, String host) throws IOException { if (!conf.containsKey(Constants.WORKER_KEYTAB_KEY) || !conf.containsKey(Constants.WORKER_PRINCIPAL_KEY)) { return; } String workerKeytab = conf.get(Constants.WORKER_KEYTAB_KEY); String workerPrincipal = conf.get(Constants.WORKER_PRINCIPAL_KEY); login(Constants.WORKER_KEYTAB_KEY, workerKeytab, Constants.WORKER_PRINCIPAL_KEY, workerPrincipal, host); }
public WebInterfaceBrowseLogsServlet(boolean isMasterServlet) { mTachyonConf = new TachyonConf(); String prefix = isMasterServlet ? "/" : "/worker/"; mBrowseJsp = prefix + "browse.jsp"; mViewJsp = prefix + "viewFile.jsp"; }
/** * 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)); mWorkerNetAddress = workerAddress; }
/** * Creates a new builder for {@link CreateOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { mBlockSizeBytes = conf.getBytes(Constants.USER_BLOCK_SIZE_BYTES_DEFAULT); mOperationTimeMs = System.currentTimeMillis(); mPersisted = false; mRecursive = false; mTTL = Constants.NO_TTL; }
/** * Creates a new builder for {@link MkdirOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { mRecursive = false; WriteType defaultWriteType = conf.getEnum(Constants.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class); mUnderStorageType = defaultWriteType.getUnderStorageType(); }
/** * Reset the TachyonConf instance in worker context, for test only. * TODO(binfan): consider a better way to mock test TachyonConf */ public static void resetConf() { sTachyonConf = new TachyonConf(); } }
/** * Constructor for SessionCleaner * * @param blockDataManager the blockDataManager this checker is updating to */ public SessionCleaner(BlockDataManager blockDataManager) { mBlockDataManager = blockDataManager; mCheckIntervalMs = WorkerContext.getConf().getInt(Constants.WORKER_BLOCK_HEARTBEAT_INTERVAL_MS); mRunning = true; }
/** * Creates a new builder for {@link InStreamOptions}. * * @param conf a Tachyon configuration */ public Builder(TachyonConf conf) { ReadType defaultReadType = conf.getEnum(Constants.USER_FILE_READ_TYPE_DEFAULT, ReadType.class); mTachyonStorageType = defaultReadType.getTachyonStorageType(); }
public WebInterfaceConfigurationServlet(FileSystemMaster fsMaster) { mFsMaster = fsMaster; mTachyonConf = new TachyonConf(); }
/** * Creates a new file stream master client pool. * * @param masterAddress the master address */ public FileSystemMasterClientPool(InetSocketAddress masterAddress) { super(ClientContext.getConf().getInt(Constants.USER_FILE_MASTER_CLIENT_THREADS)); mMasterAddress = masterAddress; }
public WebInterfaceBrowseServlet(TachyonMaster master) { mMaster = master; mTachyonConf = new TachyonConf(); }
public WebInterfaceWorkersServlet(BlockMaster blockMaster) { mBlockMaster = blockMaster; mTachyonConf = new TachyonConf(); }
public WebInterfaceDownloadLocalServlet() { mTachyonConf = new TachyonConf(); }
/** * Initializes the client context singleton. */ public static synchronized void reset() { if (sInitialized) { return; } reset(new TachyonConf()); }