public static Key make(String serverUri, ClientFileInfo tf, Futures fs) { String fname = tf.getPath(); // Always return absolute path /dir/filename long size = tf.getLength(); Key k = Key.make(PersistTachyon.PREFIX + serverUri + fname); Key k2 = Vec.newKey(k); new Frame(k).delete_and_lock(null); // Insert the top-level FileVec key into the store Vec v = new TachyonFileVec(k2,size); DKV.put(k2, v, fs); Frame fr = new Frame(k,new String[] {fname}, new Vec[] {v}); fr.update(null); fr.unlock(null); return k; } private TachyonFileVec(Key key, long len) {super(key,len,Value.TACHYON);}
succ.add(TachyonFileVec.make(serverUri, f, fs).toString()); } catch (Throwable t) { fail.add(f.getName()); Log.err("Failed to loadfile from Tachyon: path = " + f.path + ", error = " + t.getClass().getName() + ", msg = " + t.getMessage());
@Override public RawTableInfo call() throws TException { return mClient.getClientRawTableInfoById(id); } });
private void addLocations(FileBlockInfo fileBlockInfo) { Set<String> locations = Sets.newHashSet(); // add tachyon locations for (BlockLocation location : fileBlockInfo.getBlockInfo().getLocations()) { locations.add(location.getWorkerAddress().getHost()); } // add underFS locations for (NetAddress address : fileBlockInfo.getUfsLocations()) { locations.add(address.getHost()); } mLocations.addAll(locations); }
public UiBlockInfo(FileBlockInfo fileBlockInfo) { Preconditions.checkNotNull(fileBlockInfo); mId = fileBlockInfo.getBlockInfo().getBlockId(); mBlockLength = fileBlockInfo.getBlockInfo().getLength(); mInMemory = isInMemory(fileBlockInfo.getBlockInfo()); mLastAccessTimeMs = -1; addLocations(fileBlockInfo); }
/** * @return true if the given block is in some worker's memory, false otherwise */ private boolean isInMemory(BlockInfo blockInfo) { for (BlockLocation location : blockInfo.getLocations()) { if (location.getTier() == StorageLevelAlias.MEM.getValue()) { return true; } } return false; }
@Override protected void afterConnect() { mClient = new LineageMasterService.Client(mProtocol); }
@Override protected void afterConnect() { mClient = new BlockMasterService.Client(mProtocol); }
@Override protected void afterConnect() { mClient = new FileSystemMasterService.Client(mProtocol); }
/** * @return the number of columns of the raw table */ public int getColumns() { return mRawTableInfo.getColumns(); }
/** * @return the id of the raw table */ public long getId() { return mRawTableInfo.getId(); }
/** * @return the path of the raw table */ public String getPath() { return mRawTableInfo.getPath(); }
@Override protected void afterConnect() { mClient = new RawTableMasterService.Client(mProtocol); }
@Override public Void call() throws TException { mClient.updateRawTableMetadata(tableId, metadata); return null; } });
/** * @return the name of the raw table */ public String getName() { return mRawTableInfo.getName(); }
@Override public TProcessor getProcessor() { return new RawTableMasterService.Processor<RawTableMasterServiceHandler>( new RawTableMasterServiceHandler(this)); }
/** * @return true if the block is in some worker's memory, false otherwise */ private boolean isInMemory(BlockInfo blockInfo) { for (BlockLocation location : blockInfo.getLocations()) { if (location.getTier() == StorageLevelAlias.MEM.getValue()) { return true; } } return false; }
@Override protected void afterConnect() { mClient = new LineageMasterService.Client(mProtocol); }
@Override protected void afterConnect() { mClient = new BlockMasterService.Client(mProtocol); }
@Override protected void afterConnect() { mClient = new FileSystemMasterService.Client(mProtocol); }