Package net.sf.katta.master

Examples of net.sf.katta.master.DefaultDistributionPolicy


    LoadTestMasterOperation operation = new LoadTestMasterOperation(nodeCount, 10, 20, 2, 20000, _queryExecutor,
            _temporaryFolder.newFolder("result"));
    operation.execute(_context, Collections.EMPTY_LIST);

    _master = Mocks.mockMaster();
    _context = new MasterContext(_protocol, _master, new DefaultDistributionPolicy(), _queue);
    operation.execute(_context, Collections.EMPTY_LIST);
  }


  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);

    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))));

TOP

Related Classes of net.sf.katta.master.DefaultDistributionPolicy

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.