Package net.sf.katta.protocol.metadata

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


      zkClient.getEventLock().unlock();
      IndexState indexState = deployFuture.joinDeployment();
      assertEquals("" + deployClient.getIndexMetaData(indexName).getDeployError(), IndexState.DEPLOYED, indexState);

      if (indexState == IndexState.ERROR) {
        IndexDeployError deployError = protocol.getIndexMD(indexName).getDeployError();
        Set<Shard> shards = protocol.getIndexMD(indexName).getShards();
        for (Shard shard : shards) {
          List<Exception> shardErrors = deployError.getShardErrors(shard.getName());
          for (Exception exception : shardErrors) {
            exception.printStackTrace();
          }
        }
        deployError.getException().printStackTrace();
      }
    }
  }
View Full Code Here


    if (e instanceof IndexDeployException) {
      errorType = ((IndexDeployException) e).getErrorType();
    } else {
      errorType = ErrorType.UNKNOWN;
    }
    IndexDeployError deployError = new IndexDeployError(indexMD.getName(), errorType);
    deployError.setException(e);
    indexMD.setDeployError(deployError);
    protocol.updateIndexMD(indexMD);
  }
View Full Code Here

      // we ignore possible shard errors
      if (canAndShouldRegulateReplication(context.getProtocol(), replicationReport)) {
        context.getProtocol().addMasterOperation(new BalanceIndexOperation(indexMD.getName()));
      }
    } 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

    String indexName = "indexA";
    IndexDeployFuture deployFuture = new IndexDeployFuture(_protocol, indexName);
    assertEquals(IndexState.DEPLOYING, deployFuture.joinDeployment(200));

    IndexMetaData indexMD = new IndexMetaData(indexName, "path", 1);
    indexMD.setDeployError(new IndexDeployError(indexName, ErrorType.NO_NODES_AVAILIBLE));
    _protocol.publishIndex(indexMD);
    assertEquals(IndexState.ERROR, deployFuture.joinDeployment(200));
  }
View Full Code Here

    // check results
    assertEquals(1, _protocol.getIndices().size());
    IndexMetaData indexMD = _protocol.getIndexMD(_indexName);
    assertNotNull(indexMD);
    assertTrue(indexMD.hasDeployError());
    IndexDeployError error = indexMD.getDeployError();
    assertNotNull(error);
    assertEquals(errorType, error.getErrorType());
    Set<Shard> shards = indexMD.getShards();
    assertEquals(shardCount, shards.size());
    for (Shard shard : shards) {
      assertTrue(_protocol.getShardNodes(shard.getName()).isEmpty());
    }
View Full Code Here

    operation.nodeOperationsComplete(_context, results);
    checkDeployError(ErrorType.SHARDS_NOT_DEPLOYABLE, _shardCount);

    IndexMetaData indexMD = _protocol.getIndexMD(_indexName);
    IndexDeployError error = indexMD.getDeployError();
    Set<Shard> shards = indexMD.getShards();
    for (Shard shard : shards) {
      assertEquals(3, error.getShardErrors(shard.getName()).size());
    }
  }
View Full Code Here

TOP

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

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.