Examples of sendHeartbeat()


Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

      // Expected
    }

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

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

        Mockito.any(DatanodeRegistration.class));
   
    when(namenode.versionRequest()).thenReturn(new NamespaceInfo
        (1, CLUSTER_ID, POOL_ID, 1L, 1));
   
    when(namenode.sendHeartbeat(any(DatanodeRegistration.class), anyLong(),
        anyLong(), anyLong(), anyLong(), anyInt(), anyInt(), anyInt()))
        .thenReturn(new DatanodeCommand[0]);

    dn = new DataNode(conf, dirs, null) {
      @Override
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

      // Expected
    }

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

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

    dataDir.mkdirs();
    dirs.add(dataDir);
    DatanodeProtocol namenode = mock(DatanodeProtocol.class);
    when(namenode.versionRequest()).thenReturn(new NamespaceInfo
        (1, CLUSTER_ID, POOL_ID, 1L, 1));
    when(namenode.sendHeartbeat(any(DatanodeRegistration.class), anyLong(),
        anyLong(), anyLong(), anyLong(), anyInt(), anyInt(), anyInt()))
        .thenReturn(new DatanodeCommand[0]);
    dn = new DataNode(conf, dirs, null);
   
    DataNodeTestUtils.setBPNamenodeByIndex(dn, nsifno, POOL_ID, namenode);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

    FileUtil.fullyDelete(dataDir);
    dataDir.mkdirs();
    dirs.add(dataDir);
    DatanodeProtocol namenode = mock(DatanodeProtocol.class);
    when(namenode.versionRequest()).thenReturn(new NamespaceInfo(1, 1L, 1));
    when(namenode.sendHeartbeat(any(DatanodeRegistration.class), anyLong(),
        anyLong(), anyLong(), anyInt(), anyInt(), anyInt())).thenReturn(
            new DatanodeCommand[0]);
    dn = new DataNode(conf, dirs, namenode, null);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

      // Expected
    }

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

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

    // 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();
    assertEquals(1, cmd.length);
    assertEquals(cmd[0].getAction(), RegisterCommand.REGISTER
        .getAction());
  }
}
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

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

Examples of org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHeartbeat()

      // Expected
    }

    // Ensure heartbeat from dead datanode is rejected with a command
    // that asks datanode to register again
    DatanodeCommand[] cmd = dnp.sendHeartbeat(reg, 0, 0, 0, 0, 0, 0);
    Assert.assertEquals(1, cmd.length);
    Assert.assertEquals(cmd[0].getAction(), DatanodeCommand.REGISTER
        .getAction());
  }
}
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.