Package org.apache.hadoop.hdfs.protocol

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


        checkLocatedBlocks(locs);
        return locs;
      } else if (dfsClient.namenodeProtocolProxy != null &&
          dfsClient.namenodeProtocolProxy.isMethodSupported("open", String.class,
              long.class, long.class)) {
        VersionedLocatedBlocks locs = dfsClient.namenode.open(src, start, length);
        if (locs != null) {
          dfsClient.updateDataTransferProtocolVersionIfNeeded(locs.getDataProtocolVersion());
        }
        checkLocatedBlocks(locs);
        return locs;
      } else {
        LocatedBlocks locs = dfsClient.namenode.getBlockLocations(src, start, length);
View Full Code Here


        throws IOException {
     
      List<LocatedBlockWithMetaInfo> blocks =
        new ArrayList<LocatedBlockWithMetaInfo>();
     
      VersionedLocatedBlocks locatedBlocks;
      int namespaceId = 0;
      int methodsFingerprint = 0;
      if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
        LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
                  openAndFetchMetaInfo(uriPath, 0, stat.getLen());
        namespaceId = lbksm.getNamespaceID();
        locatedBlocks = lbksm;
        methodsFingerprint = lbksm.getMethodFingerPrint();
      } else {
        locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
      }
      final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();

      List<LocatedBlock> lb = locatedBlocks.getLocatedBlocks();
     
      for (LocatedBlock b : lb) {
        if (decomBlockHashes.get(b.getBlock().hashCode()) != null) {
          blocks.add(new LocatedBlockWithMetaInfo(b.getBlock(),
              b.getLocations(), b.getStartOffset(),
View Full Code Here

                                        FileStatus stat)
        throws IOException {
     
      List<LocatedBlockWithMetaInfo> corrupt =
        new LinkedList<LocatedBlockWithMetaInfo>();
      VersionedLocatedBlocks locatedBlocks;
      int namespaceId = 0;
      int methodFingerprint = 0;
      if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
        LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
                  openAndFetchMetaInfo(uriPath, 0, stat.getLen());
        namespaceId = lbksm.getNamespaceID();
        locatedBlocks = lbksm;
        methodFingerprint = lbksm.getMethodFingerPrint();
        fs.getClient().getNewNameNodeIfNeeded(methodFingerprint);
      } else {
        locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
      }
      final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();
      for (LocatedBlock b: locatedBlocks.getLocatedBlocks()) {
        if (b.isCorrupt() ||
            (b.getLocations().length == 0 && b.getBlockSize() > 0)) {
          corrupt.add(new LocatedBlockWithMetaInfo(b.getBlock(),
              b.getLocations(), b.getStartOffset(),
              dataTransferVersion, namespaceId, methodFingerprint));
View Full Code Here

                                           FileStatus stat)
        throws IOException {

      List<LocatedBlockWithMetaInfo> decommissioning =
        new LinkedList<LocatedBlockWithMetaInfo>();
      VersionedLocatedBlocks locatedBlocks;
      int namespaceId = 0;
      int methodFingerprint = 0;
      if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
        LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
                  openAndFetchMetaInfo(uriPath, 0, stat.getLen());
        namespaceId = lbksm.getNamespaceID();
        locatedBlocks = lbksm;
        methodFingerprint = lbksm.getMethodFingerPrint();
        fs.getClient().getNewNameNodeIfNeeded(methodFingerprint);
      } else {
        locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
      }
      final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();


      for (LocatedBlock b : locatedBlocks.getLocatedBlocks()) {
        if (b.isCorrupt() ||
            (b.getLocations().length == 0 && b.getBlockSize() > 0)) {
          // If corrupt, this block is the responsibility of the CorruptBlockReconstructor
          continue;
        }
View Full Code Here

   
    public void initialize(Path path, FileSystem fs) throws IOException {
      if (pathAndOffsetToLocatedBlock.containsKey(path)) {
        return;
      }
      VersionedLocatedBlocks pathLbs = getLocatedBlocks(path, fs);
      pathAndOffsetToLocatedBlock.put(
          path, createOffsetToLocatedBlockMap(pathLbs));

      for (LocatedBlocks lbs : Arrays.asList(pathLbs)) {
        for (LocatedBlock lb : lbs.getLocatedBlocks()) {
View Full Code Here

      return new LocatedBlocksWithMetaInfo(
          computeContentSummary().getLength(), blocks,
          isUnderConstruction(), DataTransferProtocol.DATA_TRANSFER_VERSION,
          namespaceid, methodsFingerprint);
    case VERSION:
      return new VersionedLocatedBlocks(computeContentSummary().getLength(), blocks,
        isUnderConstruction(), DataTransferProtocol.DATA_TRANSFER_VERSION);
    default:
      return new LocatedBlocks(computeContentSummary().getLength(), blocks,
        isUnderConstruction());
    }
View Full Code Here

      return new LocatedBlocksWithMetaInfo(
          computeContentSummary().getLength(), blocks,
          isUnderConstruction(), DataTransferProtocol.DATA_TRANSFER_VERSION,
          namespaceid, methodsFingerprint);
    case VERSION:
      return new VersionedLocatedBlocks(computeContentSummary().getLength(), blocks,
        isUnderConstruction(), DataTransferProtocol.DATA_TRANSFER_VERSION);
    default:
      return new LocatedBlocks(computeContentSummary().getLength(), blocks,
        isUnderConstruction());
    }
View Full Code Here

          checkLocatedBlocks(locs);
          return locs;
        } else if (namenodeProtocolProxy != null &&
            namenodeProtocolProxy.isMethodSupported("open", String.class,
                long.class, long.class)) {
          VersionedLocatedBlocks locs = namenode.open(src, start, length);
          if (locs != null) {
            updateDataTransferProtocolVersionIfNeeded(locs.getDataProtocolVersion());
          }
          checkLocatedBlocks(locs);
          return locs;
        } else {
          LocatedBlocks locs = namenode.getBlockLocations(src, start, length);
View Full Code Here

        throws IOException {
     
      List<LocatedBlockWithMetaInfo> blocks =
        new ArrayList<LocatedBlockWithMetaInfo>();
     
      VersionedLocatedBlocks locatedBlocks;
      int namespaceId = 0;
      int methodsFingerprint = 0;
      if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
        LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
                  openAndFetchMetaInfo(uriPath, 0, stat.getLen());
        namespaceId = lbksm.getNamespaceID();
        locatedBlocks = lbksm;
        methodsFingerprint = lbksm.getMethodFingerPrint();
      } else {
        locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
      }
      final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();

      List<LocatedBlock> lb = locatedBlocks.getLocatedBlocks();
     
      for (LocatedBlock b : lb) {
        if (decomBlockHashes.get(b.getBlock().hashCode()) != null) {
          blocks.add(new LocatedBlockWithMetaInfo(b.getBlock(),
              b.getLocations(), b.getStartOffset(),
View Full Code Here

                                        FileStatus stat)
        throws IOException {
     
      List<LocatedBlockWithMetaInfo> corrupt =
        new LinkedList<LocatedBlockWithMetaInfo>();
      VersionedLocatedBlocks locatedBlocks;
      int namespaceId = 0;
      int methodFingerprint = 0;
      if (DFSClient.isMetaInfoSuppoted(fs.getClient().namenodeProtocolProxy)) {
        LocatedBlocksWithMetaInfo lbksm = fs.getClient().namenode.
                  openAndFetchMetaInfo(uriPath, 0, stat.getLen());
        namespaceId = lbksm.getNamespaceID();
        locatedBlocks = lbksm;
        methodFingerprint = lbksm.getMethodFingerPrint();
        fs.getClient().getNewNameNodeIfNeeded(methodFingerprint);
      } else {
        locatedBlocks = fs.getClient().namenode.open(uriPath, 0, stat.getLen());
      }
      final int dataTransferVersion = locatedBlocks.getDataProtocolVersion();
      for (LocatedBlock b: locatedBlocks.getLocatedBlocks()) {
        if (b.isCorrupt() ||
            (b.getLocations().length == 0 && b.getBlockSize() > 0)) {
          corrupt.add(new LocatedBlockWithMetaInfo(b.getBlock(),
              b.getLocations(), b.getStartOffset(),
              dataTransferVersion, namespaceId, methodFingerprint));
View Full Code Here

TOP

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

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.