Package net.sf.katta.protocol

Examples of net.sf.katta.protocol.InteractionProtocol


  public ZkClient getZkClient() {
    return _zkServer.getZkClient();
  }

  public InteractionProtocol getInteractionProtocol() {
    return new InteractionProtocol(_zkServer.getZkClient(), _conf);
  }
View Full Code Here


  public InteractionProtocol getInteractionProtocol() {
    return new InteractionProtocol(_zkServer.getZkClient(), _conf);
  }

  public InteractionProtocol createInteractionProtocol() {
    return new InteractionProtocol(createZkClient(), _conf);
  }
View Full Code Here

  @Test
  public void testMockRemove() throws Exception {
    String nodeName = "nodeA";
    String someOldShard = AbstractIndexOperation.createShardName("someOldIndex", "someOldShard");
    InteractionProtocol protocol = mock(InteractionProtocol.class);
    MasterQueue queue = mock(MasterQueue.class);
    MasterContext context = new MasterContext(protocol, Mocks.mockMaster(), new DefaultDistributionPolicy(), queue);
    when(protocol.getNodeShards(nodeName)).thenReturn(Arrays.asList(someOldShard));

    RemoveObsoleteShardsOperation operation = new RemoveObsoleteShardsOperation(nodeName);
    operation.execute(context, EMPTY_LIST);

    ArgumentCaptor<NodeOperation> captor = ArgumentCaptor.forClass(NodeOperation.class);
View Full Code Here

  @Test
  public void testNotRemoveDeployingIndex() throws Exception {
    String nodeName = "nodeA";
    String indexName = "someOldIndex";
    String someOldShard = AbstractIndexOperation.createShardName(indexName, "someOldShard");
    InteractionProtocol protocol = mock(InteractionProtocol.class);
    MasterQueue queue = mock(MasterQueue.class);
    MasterContext context = new MasterContext(protocol, Mocks.mockMaster(), new DefaultDistributionPolicy(), queue);
    when(protocol.getNodeShards(nodeName)).thenReturn(Arrays.asList(someOldShard));

    RemoveObsoleteShardsOperation operation = new RemoveObsoleteShardsOperation(nodeName);
    operation.execute(context, new ArrayList<MasterOperation>(Arrays.asList(new IndexDeployOperation(indexName, "path",
            1))));
View Full Code Here

TOP

Related Classes of net.sf.katta.protocol.InteractionProtocol

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.