private void getNextBlock() throws IOException { if (mCurrentBlockOutStream != null) { Preconditions.checkState(mCurrentBlockOutStream.remaining() <= 0, PreconditionMessage.ERR_BLOCK_REMAINING); mPreviousBlockOutStreams.add(mCurrentBlockOutStream); } if (mAlluxioStorageType.isStore()) { try { WorkerNetAddress address = mLocationPolicy .getWorkerForNextBlock(mContext.getAluxioBlockStore().getWorkerInfoList(), mBlockSize); mCurrentBlockOutStream = mContext.getAluxioBlockStore().getOutStream(getNextBlockId(), mBlockSize, address); mShouldCacheCurrentBlock = true; } catch (AlluxioException e) { throw new IOException(e); } } }
if (mAlluxioStorageType.isPromote()) { try { mContext.getAluxioBlockStore().promote(blockId); } catch (IOException e) { mCurrentBlockInStream = mContext.getAluxioBlockStore().getInStream(blockId); mShouldCacheCurrentBlock = !(mCurrentBlockInStream instanceof LocalBlockInStream) && mAlluxioStorageType.isStore();
long blockSize = getCurrentBlockSize(); WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( mContext.getAluxioBlockStore().getWorkerInfoList(), blockSize); mCurrentCacheStream = mContext.getAluxioBlockStore().getOutStream(currentBlockId, blockSize, address); } catch (IOException e) { logCacheStreamIOException(e);
long blockSize = getCurrentBlockSize(); WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( mContext.getAluxioBlockStore().getWorkerInfoList(), blockSize); mShouldCacheCurrentBlock = false; } else { BlockInfo blockInfo = mContext.getAluxioBlockStore().getInfo(currentBlockId); for (BlockLocation location : blockInfo.getLocations()) { if (address.equals(location.getWorkerAddress())) { mContext.getAluxioBlockStore().getOutStream(currentBlockId, blockSize, address);