Package org.apache.hadoop.hdfs.protocol

Examples of org.apache.hadoop.hdfs.protocol.LocatedBlockWithOldGS


    try {
      stat = getFileInfo(src);
      if (namenodeProtocolProxy != null
            && namenodeProtocolProxy.isMethodSupported(
                "appendAndFetchOldGS", String.class, String.class)) {
        LocatedBlockWithOldGS loc = namenode.appendAndFetchOldGS(src,
            clientName);
        lastBlock = loc;
        if (loc != null) {
          updateNamespaceIdIfNeeded(loc.getNamespaceID());
          updateDataTransferProtocolVersionIfNeeded(loc.getDataProtocolVersion());
          getNewNameNodeIfNeeded(loc.getMethodFingerPrint());
        }
      } else if (namenodeProtocolProxy != null
               && dataTransferVersion >= DataTransferProtocol.APPEND_BLOCK_VERSION) {
        // fail the request if the data transfer version support the new append
        // protocol, but the namenode method is not supported.
        // This should not happen unless there is a bug.
        throw new IOException ("DataTransferVersion " + dataTransferVersion +
              "requires the method appendAndFetchOldGS is supported in Namenode");
      } else if (namenodeProtocolProxy != null
          && namenodeProtocolProxy.isMethodSupported(
              "appendAndFetchMetaInfo", String.class, String.class)) {
        LocatedBlockWithMetaInfo loc = namenode.appendAndFetchMetaInfo(src,
            clientName);
        lastBlock = loc;
        if (loc != null) {
          updateNamespaceIdIfNeeded(loc.getNamespaceID());
          updateDataTransferProtocolVersionIfNeeded(loc.getDataProtocolVersion());
          getNewNameNodeIfNeeded(loc.getMethodFingerPrint());
        }
      } else {
        lastBlock = namenode.append(src, clientName);
      }
View Full Code Here


      DatanodeDescriptor[] targets,
      long fileLen, int transferProtocolVersion, long oldGenerationStamp,
      BlockMetaInfoType type) {
    switch (type) {
    case VERSION_AND_NAMESPACEID_AND_OLD_GS:
      return new LocatedBlockWithOldGS(block, targets, fileLen,
          transferProtocolVersion, this.getFSImage().storage.namespaceID,
          this.nameNode.getClientProtocolMethodsFingerprint(), oldGenerationStamp);
    case VERSION_AND_NAMESPACEID:
      return new LocatedBlockWithMetaInfo(block, targets, fileLen,
          transferProtocolVersion, this.getFSImage().storage.namespaceID, this.nameNode
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.protocol.LocatedBlockWithOldGS

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.