Package com.cloudera.flume.conf.thrift

Examples of com.cloudera.flume.conf.thrift.FlumeNodeStatusThrift


   * FlumeNodeStatusThrift }.
   */
  public static FlumeNodeStatusThrift statusToThrift(
      StatusManager.NodeStatus status) {
    long time = System.currentTimeMillis();
    FlumeNodeStatusThrift out = new FlumeNodeStatusThrift();
    out.state = MasterClientServerThrift.stateToThrift(status.state);
    out.version = status.version;
    out.lastseen = status.lastseen;
    out.lastSeenDeltaMillis = time - status.lastseen;
    out.host = status.host;
View Full Code Here


  }

  protected static FlumeNodeStatusThrift toThrift(
      StatusManager.NodeStatus status) {
    long time = System.currentTimeMillis();
    return new FlumeNodeStatusThrift(MasterClientServerThrift
        .stateToThrift(status.state), status.version, status.lastseen, time
        - status.lastseen, status.host, status.physicalNode);
  }
View Full Code Here

*
*/
public class TestShellRPCThrift {
  @Test
  public void testThriftStatusConversion() {
    FlumeNodeStatusThrift start = new FlumeNodeStatusThrift();
    start.host = "HOST";
    long time = System.currentTimeMillis();
    start.lastseen = time;
    start.lastSeenDeltaMillis = time;
    start.physicalNode = "PHYSICAL_NODE";
    start.state = FlumeNodeState.ACTIVE;
   
    NodeStatus middle = MasterAdminServerThrift.statusFromThrift(start);
   
    assertEquals("HOST", middle.host);
    assertEquals(start.lastseen, middle.lastseen);
    assertEquals("PHYSICAL_NODE", middle.physicalNode);
    assertEquals(NodeState.ACTIVE, middle.state);
   
    FlumeNodeStatusThrift end = MasterAdminServerThrift.statusToThrift(middle);
    assertEquals(end.host, start.host);
    assertEquals(end.lastseen, start.lastseen);
    assertEquals(end.physicalNode, start.physicalNode);
    assertEquals(end.state, start.state);
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.thrift.FlumeNodeStatusThrift

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.