Examples of BlockWithLocations


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

    Block b2 = PBHelper.convert(bProto);
    assertEquals(b, b2);
  }

  private static BlockWithLocations getBlockWithLocations(int bid) {
    return new BlockWithLocations(new Block(bid, 0, 1), new String[] { "dn1",
        "dn2", "dn3" });
  }
View Full Code Here

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

      }
    }
    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

        .setBlock(convert(blk.getBlock()))
        .addAllStorageIDs(Arrays.asList(blk.getStorageIDs())).build();
  }

  public static BlockWithLocations convert(BlockWithLocationsProto b) {
    return new BlockWithLocations(convert(b.getBlock()), b.getStorageIDsList()
        .toArray(new String[0]));
  }
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
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.