Package org.apache.hadoop.hdfs.server.protocol

Examples of org.apache.hadoop.hdfs.server.protocol.BlockAlreadyCommittedException


      long generationstamp = -1;
      try {
        generationstamp = nsNamenode.nextGenerationStamp(block, closeFile);
      } catch (RemoteException e) {
        if (e.unwrapRemoteException() instanceof BlockAlreadyCommittedException) {
          throw new BlockAlreadyCommittedException(e);
        } else {
          throw e;
        }
      }
      Block newblock = new Block(block.getBlockId(), block.getNumBytes(), generationstamp);
View Full Code Here


      Block blockWithWildcardGenstamp = new Block(block.getBlockId());
      BlockInfo storedBlock = blocksMap.getStoredBlock(blockWithWildcardGenstamp);
      if (storedBlock == null) {
        String msg = block + " is already commited, storedBlock == null.";
        LOG.info(msg);
        throw new BlockAlreadyCommittedException(msg);
      }
      INodeFile fileINode = storedBlock.getINode();
      if (!fileINode.isUnderConstruction()) {
        String msg = block + " is already commited, !fileINode.isUnderConstruction().";
        LOG.info(msg);
        throw new BlockAlreadyCommittedException(msg);
      }
      // Disallow client-initiated recovery once
      // NameNode initiated lease recovery starts
      if (!fromNN && HdfsConstants.NN_RECOVERY_LEASEHOLDER.equals(
          leaseManager.getLeaseByPath(fileINode.getFullPathName()).getHolder())) {
View Full Code Here

          } else {
            newBlock = primary.getProxy().recoverBlock(block, isAppend, newnodes);
          }
        } catch (RemoteException re) {
          if (re.unwrapRemoteException() instanceof BlockAlreadyCommittedException) {
            throw new BlockAlreadyCommittedException(re);
          } else {
            throw re;
          }
        }
        if (newBlock == null) {
View Full Code Here

    long generationstamp = -1;
    try {
      generationstamp = namenode.nextGenerationStamp(block, closeFile);
    } catch (RemoteException e) {
      if (e.unwrapRemoteException() instanceof BlockAlreadyCommittedException) {
        throw new BlockAlreadyCommittedException(e);
      } else {
        throw e;
      }
    }
View Full Code Here

    Block blockWithWildcardGenstamp = new Block(block.getBlockId());
    BlockInfo storedBlock = blocksMap.getStoredBlock(blockWithWildcardGenstamp);
    if (storedBlock == null) {
      String msg = block + " is already commited, storedBlock == null.";
      LOG.info(msg);
      throw new BlockAlreadyCommittedException(msg);
    }
   
    // check file node
    INodeFile fileINode = storedBlock.getINode();
    if (!fileINode.isUnderConstruction()) {
      String msg = block + " is already commited, !fileINode.isUnderConstruction().";
      LOG.info(msg);
      throw new BlockAlreadyCommittedException(msg);
    }
   
    // check lease
    INodeFileUnderConstruction pendingFile =
                    (INodeFileUnderConstruction) fileINode;
View Full Code Here

      Block blockWithWildcardGenstamp = new Block(block.getBlockId());
      BlockInfo storedBlock = blocksMap.getStoredBlock(blockWithWildcardGenstamp);
      if (storedBlock == null) {
        String msg = block + " is already commited, storedBlock == null.";
        LOG.info(msg);
        throw new BlockAlreadyCommittedException(msg);
      }
      INodeFile fileINode = storedBlock.getINode();
      if (!fileINode.isUnderConstruction()) {
        String msg = block + " is already commited, !fileINode.isUnderConstruction().";
        LOG.info(msg);
        throw new BlockAlreadyCommittedException(msg);
      }
      // Disallow client-initiated recovery once
      // NameNode initiated lease recovery starts
      String path = null;
      try {
        path = fileINode.getFullPathName();
      } catch (IOException ioe) {
        throw (BlockAlreadyCommittedException)
          new BlockAlreadyCommittedException(
              block + " is already deleted").initCause(ioe);
      }
      if (!fromNN && HdfsConstants.NN_RECOVERY_LEASEHOLDER.equals(
          leaseManager.getLeaseByPath(path).getHolder())) {
        String msg = block +
View Full Code Here

      } else {
        return primary.getProxy().recoverBlock(block, isAppend, newnodes);
      }
    } catch (RemoteException re) {
      if (re.unwrapRemoteException() instanceof BlockAlreadyCommittedException) {
        throw new BlockAlreadyCommittedException(re);
      } else {
        throw re;
      }
    }
    } finally {
View Full Code Here

    long generationstamp = -1;
    try {
      generationstamp = bsp.nextGenerationStamp(block, closeFile);
    } catch (RemoteException e) {
      if (e.unwrapRemoteException() instanceof BlockAlreadyCommittedException) {
        throw new BlockAlreadyCommittedException(e);
      } else {
        throw e;
      }
    }
    Block newblock = new Block(block.getBlockId(), block.getNumBytes(), generationstamp);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.protocol.BlockAlreadyCommittedException

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.