@Test public void testDeployError_NoNodes() throws Exception { IndexDeployOperation deployCommand = new IndexDeployOperation(_indexName, _indexPath, 3); deployCommand.execute(_context, EMPTY_LIST); checkDeployError(ErrorType.NO_NODES_AVAILIBLE, _shardCount); }
@Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception, InterruptedException { InteractionProtocol protocol = context.getProtocol(); try { _indexMD.getShards().addAll(readShardsFromFs(_indexName, _indexPath)); LOG.info("Found shards '" + _indexMD.getShards() + "' for index '" + _indexName + "'"); List<OperationId> operationIds = distributeIndexShards(context, _indexMD, protocol.getLiveNodes(), runningOperations); return operationIds; } catch (Exception e) { ExceptionUtil.rethrowInterruptedException(e); LOG.error("failed to deploy index " + _indexName, e); protocol.publishIndex(_indexMD); handleMasterDeployException(protocol, _indexMD, e); return null; } }
IndexDeployOperation extends AbstractIndexOperation { @Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception, InterruptedException { InteractionProtocol protocol = context.getProtocol(); try { _indexMD.getShards().addAll(readShardsFromFs(_indexName, _indexPath)); LOG.info("Found shards '" + _indexMD.getShards() + "' for index '" + _indexName + "'"); List<OperationId> operationIds = distributeIndexShards(context, _indexMD, protocol.getLiveNodes(), runningOperations); return operationIds; } catch (Exception e) { ExceptionUtil.rethrowInterruptedException(e); LOG.error("failed to deploy index " + _indexName, e); protocol.publishIndex(_indexMD); handleMasterDeployException(protocol, _indexMD, e); return null; } } }
IndexDeployOperation extends AbstractIndexOperation { @Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception, InterruptedException { InteractionProtocol protocol = context.getProtocol(); try { _indexMD.getShards().addAll(readShardsFromFs(_indexName, _indexPath)); LOG.info("Found shards '" + _indexMD.getShards() + "' for index '" + _indexName + "'"); List<OperationId> operationIds = distributeIndexShards(context, _indexMD, protocol.getLiveNodes(), runningOperations); return operationIds; } catch (Exception e) { ExceptionUtil.rethrowInterruptedException(e); LOG.error("failed to deploy index " + _indexName, e); protocol.publishIndex(_indexMD); handleMasterDeployException(protocol, _indexMD, e); return null; } } IndexDeployOperation(String indexName, String indexPath, int replicationLevel); }
IndexDeployOperation extends AbstractIndexOperation { @Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception, InterruptedException { InteractionProtocol protocol = context.getProtocol(); try { _indexMD.getShards().addAll(readShardsFromFs(_indexName, _indexPath)); LOG.info("Found shards '" + _indexMD.getShards() + "' for index '" + _indexName + "'"); List<OperationId> operationIds = distributeIndexShards(context, _indexMD, protocol.getLiveNodes(), runningOperations); return operationIds; } catch (Exception e) { ExceptionUtil.rethrowInterruptedException(e); LOG.error("failed to deploy index " + _indexName, e); protocol.publishIndex(_indexMD); handleMasterDeployException(protocol, _indexMD, e); return null; } } IndexDeployOperation(String indexName, String indexPath, int replicationLevel); String getIndexName(); String getIndexPath(); int getReplicationLevel(); @Override List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations); @Override void nodeOperationsComplete(MasterContext context, List<OperationResult> results); @Override ExecutionInstruction getExecutionInstruction(List<MasterOperation> runningOperations); @Override String toString(); }
IndexDeployOperation extends AbstractIndexOperation { @Override public List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations) throws Exception, InterruptedException { InteractionProtocol protocol = context.getProtocol(); try { _indexMD.getShards().addAll(readShardsFromFs(_indexName, _indexPath)); LOG.info("Found shards '" + _indexMD.getShards() + "' for index '" + _indexName + "'"); List<OperationId> operationIds = distributeIndexShards(context, _indexMD, protocol.getLiveNodes(), runningOperations); return operationIds; } catch (Exception e) { ExceptionUtil.rethrowInterruptedException(e); LOG.error("failed to deploy index " + _indexName, e); protocol.publishIndex(_indexMD); handleMasterDeployException(protocol, _indexMD, e); return null; } } IndexDeployOperation(String indexName, String indexPath, int replicationLevel); String getIndexName(); String getIndexPath(); int getReplicationLevel(); @Override List<OperationId> execute(MasterContext context, List<MasterOperation> runningOperations); @Override void nodeOperationsComplete(MasterContext context, List<OperationResult> results); @Override ExecutionInstruction getExecutionInstruction(List<MasterOperation> runningOperations); @Override String toString();  }