Package tachyon.thrift

Examples of tachyon.thrift.BlockInfoException


      LOG.info("FileAlreadyExistException: " + path);
      throw new FileAlreadyExistException(path.toString());
    }

    if (!directory && blockSizeByte < 1) {
      throw new BlockInfoException("Invalid block size " + blockSizeByte);
    }

    LOG.debug("createFile {}", CommonUtils.parametersToString(path));

    String[] pathNames = CommonUtils.getPathComponents(path.toString());
View Full Code Here


   * @param blockInfo The block to be added
   * @throws BlockInfoException
   */
  public synchronized void addBlock(BlockInfo blockInfo) throws BlockInfoException {
    if (mIsComplete) {
      throw new BlockInfoException("The file is complete: " + this);
    }
    if (mBlocks.size() > 0 && mBlocks.get(mBlocks.size() - 1).mLength != mBlockSizeByte) {
      throw new BlockInfoException("mBlockSizeByte is " + mBlockSizeByte + ", but the "
          + "previous block size is " + mBlocks.get(mBlocks.size() - 1).mLength);
    }
    if (blockInfo.getInodeFile() != this) {
      throw new BlockInfoException("InodeFile unmatch: " + this + " != " + blockInfo);
    }
    if (blockInfo.mBlockIndex != mBlocks.size()) {
      throw new BlockInfoException("BLOCK_INDEX unmatch: " + mBlocks.size() + " != " + blockInfo);
    }
    if (blockInfo.mOffset != mBlocks.size() * mBlockSizeByte) {
      throw new BlockInfoException("OFFSET unmatch: " + mBlocks.size() * mBlockSizeByte + " != "
          + blockInfo);
    }
    if (blockInfo.mLength > mBlockSizeByte) {
      throw new BlockInfoException("LENGTH too big: " + mBlockSizeByte + " " + blockInfo);
    }
    mLength += blockInfo.mLength;
    mBlocks.add(blockInfo);
  }
View Full Code Here

   * @throws BlockInfoException
   */
  public synchronized void addLocation(int blockIndex, long workerId, NetAddress workerAddress)
      throws BlockInfoException {
    if (blockIndex < 0 || blockIndex >= mBlocks.size()) {
      throw new BlockInfoException("BlockIndex " + blockIndex + " out of bounds." + toString());
    }
    mBlocks.get(blockIndex).addLocation(workerId, workerAddress);
  }
View Full Code Here

   * @return a list of the worker's net address who caches the block
   * @throws BlockInfoException
   */
  public synchronized List<NetAddress> getBlockLocations(int blockIndex) throws BlockInfoException {
    if (blockIndex < 0 || blockIndex > mBlocks.size()) {
      throw new BlockInfoException("BlockIndex is out of the boundry: " + blockIndex);
    }

    return mBlocks.get(blockIndex).getLocations();
  }
View Full Code Here

   * @return the generated ClientBlockInfo
   * @throws BlockInfoException
   */
  public synchronized ClientBlockInfo getClientBlockInfo(int blockIndex) throws BlockInfoException {
    if (blockIndex < 0 || blockIndex >= mBlocks.size()) {
      throw new BlockInfoException("BlockIndex is out of the boundry: " + blockIndex);
    }

    return mBlocks.get(blockIndex).generateClientBlockInfo();
  }
View Full Code Here

   * @param workerId The id of the removed location worker
   * @throws BlockInfoException
   */
  public synchronized void removeLocation(int blockIndex, long workerId) throws BlockInfoException {
    if (blockIndex < 0 || blockIndex >= mBlocks.size()) {
      throw new BlockInfoException("BlockIndex " + blockIndex + " out of bounds." + toString());
    }
    mBlocks.get(blockIndex).removeLocation(workerId);
  }
View Full Code Here

TOP

Related Classes of tachyon.thrift.BlockInfoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.