Skip to content

Commit

Permalink
Fix a typo in FileSystemContext.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjia committed Mar 16, 2016
1 parent 68e7ac0 commit efc2e13
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions core/client/src/main/java/alluxio/client/file/FileInStream.java
Expand Up @@ -231,9 +231,9 @@ private void checkAndAdvanceBlockInStream() throws IOException {
try { try {
long blockSize = getCurrentBlockSize(); long blockSize = getCurrentBlockSize();
WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock(
mContext.getAluxioBlockStore().getWorkerInfoList(), blockSize); mContext.getAlluxioBlockStore().getWorkerInfoList(), blockSize);
mCurrentCacheStream = mCurrentCacheStream =
mContext.getAluxioBlockStore().getOutStream(currentBlockId, blockSize, address); mContext.getAlluxioBlockStore().getOutStream(currentBlockId, blockSize, address);
} catch (IOException e) { } catch (IOException e) {
LOG.warn(BLOCK_ID_NOT_CACHED, currentBlockId, e); LOG.warn(BLOCK_ID_NOT_CACHED, currentBlockId, e);
mShouldCacheCurrentBlock = false; mShouldCacheCurrentBlock = false;
Expand Down Expand Up @@ -311,9 +311,9 @@ private void seekBlockInStream(long newPos) throws IOException {
try { try {
long blockSize = getCurrentBlockSize(); long blockSize = getCurrentBlockSize();
WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock(
mContext.getAluxioBlockStore().getWorkerInfoList(), blockSize); mContext.getAlluxioBlockStore().getWorkerInfoList(), blockSize);
mCurrentCacheStream = mCurrentCacheStream =
mContext.getAluxioBlockStore().getOutStream(currentBlockId, blockSize, address); mContext.getAlluxioBlockStore().getOutStream(currentBlockId, blockSize, address);
} catch (IOException e) { } catch (IOException e) {
LOG.warn(BLOCK_ID_NOT_CACHED, getCurrentBlockId(), e); LOG.warn(BLOCK_ID_NOT_CACHED, getCurrentBlockId(), e);
mShouldCacheCurrentBlock = false; mShouldCacheCurrentBlock = false;
Expand Down Expand Up @@ -342,13 +342,13 @@ private void updateBlockInStream(long blockId) throws IOException {
try { try {
if (mAlluxioStorageType.isPromote()) { if (mAlluxioStorageType.isPromote()) {
try { try {
mContext.getAluxioBlockStore().promote(blockId); mContext.getAlluxioBlockStore().promote(blockId);
} catch (IOException e) { } catch (IOException e) {
// Failed to promote // Failed to promote
LOG.warn("Promotion of block with ID {} failed.", blockId, e); LOG.warn("Promotion of block with ID {} failed.", blockId, e);
} }
} }
mCurrentBlockInStream = mContext.getAluxioBlockStore().getInStream(blockId); mCurrentBlockInStream = mContext.getAlluxioBlockStore().getInStream(blockId);
mShouldCacheCurrentBlock = mShouldCacheCurrentBlock =
!(mCurrentBlockInStream instanceof LocalBlockInStream) && mAlluxioStorageType.isStore(); !(mCurrentBlockInStream instanceof LocalBlockInStream) && mAlluxioStorageType.isStore();
} catch (IOException e) { } catch (IOException e) {
Expand Down
Expand Up @@ -262,9 +262,9 @@ private void getNextBlock() throws IOException {
if (mAlluxioStorageType.isStore()) { if (mAlluxioStorageType.isStore()) {
try { try {
WorkerNetAddress address = mLocationPolicy WorkerNetAddress address = mLocationPolicy
.getWorkerForNextBlock(mContext.getAluxioBlockStore().getWorkerInfoList(), mBlockSize); .getWorkerForNextBlock(mContext.getAlluxioBlockStore().getWorkerInfoList(), mBlockSize);
mCurrentBlockOutStream = mCurrentBlockOutStream =
mContext.getAluxioBlockStore().getOutStream(getNextBlockId(), mBlockSize, address); mContext.getAlluxioBlockStore().getOutStream(getNextBlockId(), mBlockSize, address);
mShouldCacheCurrentBlock = true; mShouldCacheCurrentBlock = true;
} catch (AlluxioException e) { } catch (AlluxioException e) {
throw new IOException(e); throw new IOException(e);
Expand Down
Expand Up @@ -63,7 +63,7 @@ public void releaseMasterClient(FileSystemMasterClient masterClient) {
/** /**
* @return the Alluxio block store * @return the Alluxio block store
*/ */
public AlluxioBlockStore getAluxioBlockStore() { public AlluxioBlockStore getAlluxioBlockStore() {
return mAlluxioBlockStore; return mAlluxioBlockStore;
} }


Expand Down
Expand Up @@ -81,7 +81,7 @@ public void before() throws IOException {


mContext = PowerMockito.mock(FileSystemContext.class); mContext = PowerMockito.mock(FileSystemContext.class);
mBlockStore = PowerMockito.mock(AlluxioBlockStore.class); mBlockStore = PowerMockito.mock(AlluxioBlockStore.class);
Mockito.when(mContext.getAluxioBlockStore()).thenReturn(mBlockStore); Mockito.when(mContext.getAlluxioBlockStore()).thenReturn(mBlockStore);


// Set up BufferedBlockInStreams and caching streams // Set up BufferedBlockInStreams and caching streams
mCacheStreams = Lists.newArrayList(); mCacheStreams = Lists.newArrayList();
Expand Down
Expand Up @@ -95,7 +95,7 @@ public void before() throws Exception {
mFileSystemMasterClient = PowerMockito.mock(FileSystemMasterClient.class); mFileSystemMasterClient = PowerMockito.mock(FileSystemMasterClient.class);
mBlockWorkerClient = PowerMockito.mock(BlockWorkerClient.class); mBlockWorkerClient = PowerMockito.mock(BlockWorkerClient.class);


Mockito.when(mFileSystemContext.getAluxioBlockStore()).thenReturn(mBlockStore); Mockito.when(mFileSystemContext.getAlluxioBlockStore()).thenReturn(mBlockStore);
Mockito.when(mBlockStoreContext.acquireWorkerClient()).thenReturn(mBlockWorkerClient); Mockito.when(mBlockStoreContext.acquireWorkerClient()).thenReturn(mBlockWorkerClient);
Mockito.when(mFileSystemContext.acquireMasterClient()).thenReturn(mFileSystemMasterClient); Mockito.when(mFileSystemContext.acquireMasterClient()).thenReturn(mFileSystemMasterClient);
Mockito.when(mFileSystemMasterClient.getStatus(Mockito.any(AlluxioURI.class))).thenReturn( Mockito.when(mFileSystemMasterClient.getStatus(Mockito.any(AlluxioURI.class))).thenReturn(
Expand Down

0 comments on commit efc2e13

Please sign in to comment.