@Test public void getInStreamUfs() throws Exception { WorkerNetAddress worker1 = new WorkerNetAddress().setHost("worker1"); WorkerNetAddress worker2 = new WorkerNetAddress().setHost("worker2"); BlockInfo info = new BlockInfo().setBlockId(0); URIStatus dummyStatus = new URIStatus(new FileInfo().setPersisted(true).setBlockIds(Collections.singletonList(0L)) .setFileBlockInfos(Collections.singletonList(new FileBlockInfo().setBlockInfo(info)))); sConf.set(PropertyKey.USER_UFS_BLOCK_READ_LOCATION_POLICY, MockBlockLocationPolicy.class.getTypeName()); OpenFilePOptions readOptions = OpenFilePOptions.newBuilder().build(); InStreamOptions options = new InStreamOptions(dummyStatus, readOptions, sConf); ((MockBlockLocationPolicy) options.getUfsReadLocationPolicy()) .setHosts(Arrays.asList(worker1, worker2)); when(mMasterClient.getBlockInfo(BLOCK_ID)).thenReturn(new BlockInfo()); when(mContext.getCachedWorkers()).thenReturn( Lists.newArrayList(new BlockWorkerInfo(worker1, -1, -1), new BlockWorkerInfo(worker2, -1, -1))); assertEquals(worker1, mBlockStore.getInStream(BLOCK_ID, options).getAddress()); assertEquals(worker2, mBlockStore.getInStream(BLOCK_ID, options).getAddress()); }
public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); }
AlluxioBlockStore { public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); } }
AlluxioBlockStore { public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); } @VisibleForTesting  AlluxioBlockStore(FileSystemContext context, TieredIdentity tieredIdentity); }
AlluxioBlockStore { public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); } @VisibleForTesting  AlluxioBlockStore(FileSystemContext context, TieredIdentity tieredIdentity); static AlluxioBlockStore create(FileSystemContext context); BlockInfo getInfo(long blockId); BlockInStream getInStream(long blockId, InStreamOptions options); BlockInStream getInStream(long blockId, InStreamOptions options,
      Map<WorkerNetAddress, Long> failedWorkers); BlockInStream getInStream(BlockInfo info, InStreamOptions options,
      Map<WorkerNetAddress, Long> failedWorkers); BlockOutStream getOutStream(long blockId, long blockSize, WorkerNetAddress address,
      OutStreamOptions options); BlockOutStream getOutStream(long blockId, long blockSize, OutStreamOptions options); long getCapacityBytes(); long getUsedBytes(); }
AlluxioBlockStore { public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException { return getInStream(blockId, options, ImmutableMap.of()); } @VisibleForTesting  AlluxioBlockStore(FileSystemContext context, TieredIdentity tieredIdentity); static AlluxioBlockStore create(FileSystemContext context); BlockInfo getInfo(long blockId); BlockInStream getInStream(long blockId, InStreamOptions options); BlockInStream getInStream(long blockId, InStreamOptions options,
      Map<WorkerNetAddress, Long> failedWorkers); BlockInStream getInStream(BlockInfo info, InStreamOptions options,
      Map<WorkerNetAddress, Long> failedWorkers); BlockOutStream getOutStream(long blockId, long blockSize, WorkerNetAddress address,
      OutStreamOptions options); BlockOutStream getOutStream(long blockId, long blockSize, OutStreamOptions options); long getCapacityBytes(); long getUsedBytes();  }