Package net.sf.katta.operation.node

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


      }
    } else {
      IndexDeployError deployError = new IndexDeployError(indexMD.getName(), ErrorType.SHARDS_NOT_DEPLOYABLE);
      for (OperationResult operationResult : results) {
        if (operationResult != null) {// node-crashed produces null
          DeployResult deployResult = (DeployResult) operationResult;
          for (Entry<String, Exception> entry : deployResult.getShardExceptions().entrySet()) {
            deployError.addShardError(entry.getKey(), entry.getValue());
          }
        }
      }
      indexMD.setDeployError(deployError);
View Full Code Here


  }

  private void updateShardMetaData(List<OperationResult> results, IndexMetaData indexMD) {
    for (OperationResult operationResult : results) {
      if (operationResult != null) {// node-crashed produces null
        DeployResult deployResult = (DeployResult) operationResult;
        for (Entry<String, Map<String, String>> entry : deployResult.getShardMetaDataMaps().entrySet()) {
          Map<String, String> existingMap = indexMD.getShard(entry.getKey()).getMetaDataMap();
          Map<String, String> newMap = entry.getValue();
          if (existingMap.size() > 0 && !existingMap.equals(newMap)) {
            // maps from different nodes but for the same shard should have
            // the same content
View Full Code Here

    // now complete the deployment
    List<OperationResult> results = new ArrayList<OperationResult>();
    for (NodeQueue nodeQueue : nodeQueues) {
      NodeOperation nodeOperation = nodeQueue.peek();
      DeployResult deployResult = new DeployResult(_indexName);
      Set<String> nodeShards = ((ShardDeployOperation) nodeOperation).getShardNames();
      for (String shardName : nodeShards) {
        deployResult.addShardException(shardName, new Exception());
      }
      results.add(deployResult);
    }

    operation.nodeOperationsComplete(_context, results);
View Full Code Here

    IndexDeployOperation operation = new IndexDeployOperation(_indexName, _indexPath, 3);
    operation.execute(_context, EMPTY_LIST);
    publisShards(nodes, queues);

    ArrayList<OperationResult> results = new ArrayList<OperationResult>();
    DeployResult deployResult1 = new DeployResult(nodes.get(0).getName());
    DeployResult deployResult2 = new DeployResult(nodes.get(1).getName());
    DeployResult deployResult3 = new DeployResult(nodes.get(2).getName());
    Map<String, String> metaMap = new HashMap<String, String>();
    metaMap.put("a", "1");
    String shard1Name = AbstractIndexOperation.createShardName(_indexName, _indexFile.listFiles()[0].getAbsolutePath());
    deployResult1.addShardMetaDataMap(shard1Name, metaMap);
    deployResult2.addShardMetaDataMap(shard1Name, metaMap);
    deployResult3.addShardMetaDataMap(shard1Name, metaMap);
    results.add(deployResult1);
    results.add(deployResult2);
    results.add(deployResult3);

    operation.nodeOperationsComplete(_context, results);
View Full Code Here

    IndexDeployOperation operation = new IndexDeployOperation(_indexName, _indexPath, 3);
    operation.execute(_context, EMPTY_LIST);
    publisShards(nodes, queues);

    ArrayList<OperationResult> results = new ArrayList<OperationResult>();
    DeployResult deployResult1 = new DeployResult(nodes.get(0).getName());
    DeployResult deployResult2 = null;
    DeployResult deployResult3 = new DeployResult(nodes.get(2).getName());
    Map<String, String> metaMap = new HashMap<String, String>();
    metaMap.put("a", "1");
    String shard1Name = AbstractIndexOperation.createShardName(_indexName, _indexFile.listFiles()[0].getAbsolutePath());
    deployResult1.addShardMetaDataMap(shard1Name, metaMap);
    deployResult3.addShardMetaDataMap(shard1Name, metaMap);
    results.add(deployResult1);
    results.add(deployResult2);
    results.add(deployResult3);

    operation.nodeOperationsComplete(_context, results);
View Full Code Here

TOP

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

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.