Examples of BlockWithLocations


Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

    assertTrue(Arrays.equals(locs1.getStorageIDs(), locs2.getStorageIDs()));
  }

  @Test
  public void testConvertBlockWithLocations() {
    BlockWithLocations locs = getBlockWithLocations(1);
    BlockWithLocationsProto locsProto = PBHelper.convert(locs);
    BlockWithLocations locs2 = PBHelper.convert(locsProto);
    compare(locs, locs2);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    final List<String> datanodeUuids = b.getDatanodeUuidsList();
    final List<String> storageUuids = b.getStorageUuidsList();
    return new BlockWithLocations(convert(b.getBlock()),
        datanodeUuids.toArray(new String[datanodeUuids.size()]),
        storageUuids.toArray(new String[storageUuids.size()]));
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      for(int i = 0; i < locations.size(); i++) {
        final DatanodeStorageInfo s = locations.get(i);
        datanodeUuids[i] = s.getDatanodeDescriptor().getDatanodeUuid();
        storageIDs[i] = s.getStorageID();
      }
      results.add(new BlockWithLocations(block, datanodeUuids, storageIDs));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  private long addBlock(Block block, List<BlockWithLocations> results) {
    final List<String> machineSet = getValidLocations(block);
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      }
    }
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  private long addBlock(Block block, List<BlockWithLocations> results) {
    final List<String> machineSet = getValidLocations(block);
    if(machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
          machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

      for(int i = 0; i < locations.size(); i++) {
        final DatanodeStorageInfo s = locations.get(i);
        datanodeUuids[i] = s.getDatanodeDescriptor().getDatanodeUuid();
        storageIDs[i] = s.getStorageID();
      }
      results.add(new BlockWithLocations(block, datanodeUuids, storageIDs));
      return block.getNumBytes();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations.BlockWithLocations

  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    final List<String> datanodeUuids = b.getDatanodeUuidsList();
    final List<String> storageUuids = b.getStorageUuidsList();
    return new BlockWithLocations(convert(b.getBlock()),
        datanodeUuids.toArray(new String[datanodeUuids.size()]),
        storageUuids.toArray(new String[storageUuids.size()]));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.