Search in sources :

Example 1 with StoreBlockWriter

use of alluxio.worker.block.io.StoreBlockWriter in project alluxio by Alluxio.

the class TieredBlockStore method getBlockWriter.

@Override
public BlockWriter getBlockWriter(long sessionId, long blockId) throws BlockDoesNotExistException, BlockAlreadyExistsException, InvalidWorkerStateException, IOException {
    LOG.debug("getBlockWriter: sessionId={}, blockId={}", sessionId, blockId);
    // TODO(bin): Handle the case where multiple writers compete for the same block.
    try (LockResource r = new LockResource(mMetadataReadLock)) {
        checkTempBlockOwnedBySession(sessionId, blockId);
        TempBlockMeta tempBlockMeta = mMetaManager.getTempBlockMeta(blockId);
        return new StoreBlockWriter(tempBlockMeta);
    }
}
Also used : LockResource(alluxio.resource.LockResource) StoreBlockWriter(alluxio.worker.block.io.StoreBlockWriter) TempBlockMeta(alluxio.worker.block.meta.TempBlockMeta)

Aggregations

LockResource (alluxio.resource.LockResource)1 StoreBlockWriter (alluxio.worker.block.io.StoreBlockWriter)1 TempBlockMeta (alluxio.worker.block.meta.TempBlockMeta)1