Package net.sf.katta.operation.node

Examples of net.sf.katta.operation.node.ShardUndeployOperation


    Map<String, List<String>> node2ShardsMap = CollectionUtil.invertListMap(shard2NodesMap);
    Set<String> nodes = node2ShardsMap.keySet();
    List<OperationId> nodeOperationIds = new ArrayList<OperationId>(nodes.size());
    for (String node : nodes) {
      List<String> nodeShards = node2ShardsMap.get(node);
      OperationId operationId = protocol.addNodeOperation(node, new ShardUndeployOperation(nodeShards));
      nodeOperationIds.add(operationId);
    }
    protocol.unpublishIndex(_indexName);
    return nodeOperationIds;
  }
View Full Code Here


    // we should have 4 folders in our working folder now.
    File shardsFolder = node.getContext().getShardManager().getShardsFolder();
    assertEquals(SHARD_COUNT, shardsFolder.list().length);

    ShardUndeployOperation undeployOperation = new ShardUndeployOperation(Arrays.asList(protocol.getNodeShards(
            node.getName()).iterator().next()));
    protocol.addNodeOperation(node.getName(), undeployOperation);
    TestUtil.waitUntilNodeServesShards(protocol, node.getName(), 3);
    // Thread.sleep(2000);
    assertEquals(3, shardsFolder.list().length);
View Full Code Here

    InteractionProtocol protocol = context.getProtocol();
    Collection<String> nodeShards = protocol.getNodeShards(_nodeName);
    List<String> obsoletShards = collectObsoleteShards(protocol, nodeShards, runningOperations);
    if (!obsoletShards.isEmpty()) {
      Log.info("found following shards obsolete on node " + _nodeName + ": " + obsoletShards);
      protocol.addNodeOperation(_nodeName, new ShardUndeployOperation(obsoletShards));
    }

    return null;
  }
View Full Code Here

        OperationId operationId = protocol.addNodeOperation(node, deployInstruction);
        operationIds.add(operationId);
      }
      List<String> listOfRemoved = CollectionUtil.getListOfRemoved(currentGlobalNode2ShardsMap.get(node), nodeShards);
      if (!listOfRemoved.isEmpty()) {
        ShardUndeployOperation undeployInstruction = new ShardUndeployOperation(listOfRemoved);
        OperationId operationId = protocol.addNodeOperation(node, undeployInstruction);
        operationIds.add(operationId);
      }
    }
    _newShardsByNodeMap = newShardsByNode.asMap();
View Full Code Here

    operation.execute(context, EMPTY_LIST);

    ArgumentCaptor<NodeOperation> captor = ArgumentCaptor.forClass(NodeOperation.class);
    verify(protocol).addNodeOperation(eq(nodeName), captor.capture());
    assertThat(captor.getValue(), instanceOf(ShardUndeployOperation.class));
    ShardUndeployOperation undeployOperation = (ShardUndeployOperation) captor.getValue();
    assertEquals(1, undeployOperation.getShardNames().size());
    assertEquals(someOldShard, undeployOperation.getShardNames().iterator().next());
  }
View Full Code Here

TOP

Related Classes of net.sf.katta.operation.node.ShardUndeployOperation

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.