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

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


     * Send a heartbeat to the name-node and replicate blocks if requested.
     */
    @SuppressWarnings("unused") // keep it for future blockReceived benchmark
    int replicateBlocks() throws IOException {
      // register datanode
      StorageReport[] rep = { new StorageReport(dnRegistration.getStorageID(),
          false, DF_CAPACITY, DF_USED, DF_CAPACITY - DF_USED, DF_USED) };
      DatanodeCommand[] cmds = nameNodeProto.sendHeartbeat(dnRegistration,
          rep, 0, 0, 0).getCommands();
      if (cmds != null) {
        for (DatanodeCommand cmd : cmds) {
View Full Code Here


  HeartbeatResponse sendHeartBeat() throws IOException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Sending heartbeat from service actor: " + this);
    }
    // reports number of failed volumes
    StorageReport[] report = { new StorageReport(bpRegistration.getStorageID(),
        false,
        dn.getFSDataset().getCapacity(),
        dn.getFSDataset().getDfsUsed(),
        dn.getFSDataset().getRemaining(),
        dn.getFSDataset().getBlockPoolUsed(bpos.getBlockPoolId())) };
View Full Code Here

     * Ignore reply commands.
     */
    void sendHeartbeat() throws IOException {
      // register datanode
      // TODO:FEDERATION currently a single block pool is supported
      StorageReport[] rep = { new StorageReport(dnRegistration.getStorageID(),
          false, DF_CAPACITY, DF_USED, DF_CAPACITY - DF_USED, DF_USED) };
      DatanodeCommand[] cmds = nameNodeProto.sendHeartbeat(dnRegistration,
          rep, 0, 0, 0).getCommands();
      if(cmds != null) {
        for (DatanodeCommand cmd : cmds ) {
View Full Code Here

     * Send a heartbeat to the name-node and replicate blocks if requested.
     */
    @SuppressWarnings("unused") // keep it for future blockReceived benchmark
    int replicateBlocks() throws IOException {
      // register datanode
      StorageReport[] rep = { new StorageReport(dnRegistration.getStorageID(),
          false, DF_CAPACITY, DF_USED, DF_CAPACITY - DF_USED, DF_USED) };
      DatanodeCommand[] cmds = nameNodeProto.sendHeartbeat(dnRegistration,
          rep, 0, 0, 0).getCommands();
      if (cmds != null) {
        for (DatanodeCommand cmd : cmds) {
View Full Code Here

  HeartbeatResponse sendHeartBeat() throws IOException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Sending heartbeat from service actor: " + this);
    }
    // reports number of failed volumes
    StorageReport[] report = { new StorageReport(bpRegistration.getStorageID(),
        false,
        dn.getFSDataset().getCapacity(),
        dn.getFSDataset().getDfsUsed(),
        dn.getFSDataset().getRemaining(),
        dn.getFSDataset().getBlockPoolUsed(bpos.getBlockPoolId())) };
View Full Code Here

    try {
      List<StorageReportProto> list = request.getReportsList();
      StorageReport[] report = new StorageReport[list.size()];
      int i = 0;
      for (StorageReportProto p : list) {
        report[i++] = new StorageReport(p.getStorageID(), p.getFailed(),
            p.getCapacity(), p.getDfsUsed(), p.getRemaining(),
            p.getBlockPoolUsed());
      }
      response = impl.sendHeartbeat(PBHelper.convert(request.getRegistration()),
          report, request.getXmitsInProgress(), request.getXceiverCount(),
View Full Code Here

      // Expected
    }

    // Ensure heartbeat from dead datanode is rejected with a command
    // that asks datanode to register again
    StorageReport[] rep = { new StorageReport(reg.getStorageID(), false, 0, 0,
        0, 0) };
    DatanodeCommand[] cmd = dnp.sendHeartbeat(reg, rep, 0, 0, 0).getCommands();
    Assert.assertEquals(1, cmd.length);
    Assert.assertEquals(cmd[0].getAction(), RegisterCommand.REGISTER
        .getAction());
View Full Code Here

    StorageReport[] reports;
    synchronized (statsLock) {
      reports = new StorageReport[volumes.volumes.size()];
      int i = 0;
      for (FsVolumeImpl volume : volumes.volumes) {
        reports[i++] = new StorageReport(volume.toDatanodeStorage(),
                                         false,
                                         volume.getCapacity(),
                                         volume.getDfsUsed(),
                                         volume.getAvailable(),
                                         volume.getBlockPoolUsed(bpid));
View Full Code Here

    String getStorageUuid() {
      return storageUuid;
    }

    synchronized StorageReport getStorageReport(String bpid) {
      return new StorageReport(new DatanodeStorage(getStorageUuid()),
          false, getCapacity(), getUsed(), getFree(),
          map.get(bpid).getUsed());
    }
View Full Code Here

    DatanodeStorage dns1 = new DatanodeStorage("dnStorage1");
    DatanodeStorage dns2 = new DatanodeStorage("dnStorage2");

    StorageReport[] report1 = new StorageReport[] {
        new StorageReport(dns1, false, 1024, 100, 924, 100)
    };
    StorageReport[] report2 = new StorageReport[] {
        new StorageReport(dns2, false, 2500, 200, 1848, 200)
    };
    dnDesc1.updateHeartbeat(report1, 5L, 3L, 10, 2);
    dnDesc2.updateHeartbeat(report2, 10L, 2L, 20, 1);

    ArrayList<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
View Full Code Here

TOP

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

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.