/** * Creates a block. This method is only called from a data server. * * <p>Call {@link #getTempBlockWriterRemote(long, long)} to get a writer for writing to the block. * * @param sessionId The id of the client * @param blockId The id of the block to be created * @param tierAlias The alias of the tier to place the new block in * @param initialBytes The initial amount of bytes to be allocated * @throws IllegalArgumentException if location does not belong to tiered storage * @throws BlockAlreadyExistsException if blockId already exists, either temporary or committed, * or block in eviction plan already exists * @throws WorkerOutOfSpaceException if this Store has no more space than the initialBlockSize * @throws IOException if blocks in eviction plan fail to be moved or deleted */ public void createBlockRemote(long sessionId, long blockId, String tierAlias, long initialBytes) throws BlockAlreadyExistsException, WorkerOutOfSpaceException, IOException { BlockStoreLocation loc = BlockStoreLocation.anyDirInTier(tierAlias); TempBlockMeta createdBlock = mBlockStore.createBlockMeta(sessionId, blockId, loc, initialBytes); FileUtils.createBlockPath(createdBlock.getPath()); }