Package net.sf.katta.protocol.metadata

Examples of net.sf.katta.protocol.metadata.NodeMetaData


    LOG.info("started node '" + _nodeName + "'");
  }

  private void init() {
    redeployInstalledShards();
    NodeMetaData nodeMetaData = new NodeMetaData(_nodeName);
    NodeQueue nodeOperationQueue = _protocol.publishNode(this, nodeMetaData);
    startOperatorThread(nodeOperationQueue);
  }
View Full Code Here


    Node node = mock(Node.class);
    String nodeName = "node1";
    when(node.getName()).thenReturn(nodeName);

    InteractionProtocol protocol = _zk.getInteractionProtocol();
    NodeQueue nodeQueue = protocol.publishNode(node, new NodeMetaData());

    NodeOperation nodeOperation1 = mock(NodeOperation.class, withSettings().serializable().name("a"));
    NodeOperation nodeOperation2 = mock(NodeOperation.class, withSettings().serializable().name("b"));
    OperationId operation1Id = protocol.addNodeOperation(nodeName, nodeOperation1);
    OperationId operation2Id = protocol.addNodeOperation(nodeName, nodeOperation2);
View Full Code Here

  @Test(timeout = 7000)
  public void testPublishNode() throws Exception {
    Node node = Mocks.mockNode();
    assertNull(_protocol.getNodeMD(node.getName()));
    NodeQueue queue = _protocol.publishNode(node, new NodeMetaData(node.getName()));
    assertNotNull(queue);
    assertNotNull(_protocol.getNodeMD(node.getName()));

    // test operation
    NodeOperation operation = mock(NodeOperation.class);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test(timeout = 10000)
  public void testMasterOperationPickup() throws Exception {
    Master master = new Master(_zk.getInteractionProtocol(), false);
    Node node = Mocks.mockNode();// leave safe mode
    _protocol.publishNode(node, new NodeMetaData("node1"));
    master.start();

    MasterOperation operation1 = mock(MasterOperation.class, withSettings().serializable());
    MasterOperation operation2 = mock(MasterOperation.class, withSettings().serializable());
View Full Code Here

  @Test(timeout = 500000)
  public void testMasterChange_OnSessionReconnect() throws Exception {
    Master master = new Master(_zk.getInteractionProtocol(), false);
    Node node = Mocks.mockNode();// leave safe mode
    _protocol.publishNode(node, new NodeMetaData("node1"));
    master.start();
    TestUtil.waitUntilLeaveSafeMode(master);

    Master secMaster = new Master(_zk.getInteractionProtocol(), false);
    secMaster.start();
View Full Code Here

  @Test(timeout = 50000)
  public void testMasterChangeWhileDeploingIndex() throws Exception {
    Master master = new Master(_zk.getInteractionProtocol(), false);
    Node node = Mocks.mockNode();// leave safe mode
    NodeQueue nodeQueue = _protocol.publishNode(node, new NodeMetaData("node1"));
    master.start();
    TestUtil.waitUntilLeaveSafeMode(master);

    // phase I - until watchdog is running and its node turn
    IndexDeployOperation deployOperation = new IndexDeployOperation("index1", TestResources.INDEX1.getAbsolutePath(), 1);
View Full Code Here

    }
    return nodes;
  }

  public static NodeQueue publisNode(InteractionProtocol protocol, Node node) {
    return protocol.publishNode(node, new NodeMetaData(node.getName()));
  }
View Full Code Here

TOP

Related Classes of net.sf.katta.protocol.metadata.NodeMetaData

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.