private boolean needsBatchBuildStart(IndexerDefinition indexer) { return !indexer.getLifecycleState().isDeleteState() && indexer.getBatchIndexingState() == BatchIndexingState.BUILD_REQUESTED && indexer.getActiveBatchBuildInfo() == null; }
private boolean needsBatchBuildStart(IndexerDefinition indexer) { return !indexer.getLifecycleState().isDeleteState() && indexer.getBatchIndexingState() == BatchIndexingState.BUILD_REQUESTED && indexer.getActiveBatchBuildInfo() == null; }
printArguments(indexer.getDefaultBatchIndexCliArguments(), 6, ps, options.has("dump")); BatchBuildInfo activeBatchBuild = indexer.getActiveBatchBuildInfo(); if (activeBatchBuild != null) { ps.println(" + Active batch build:");
printArguments(indexer.getDefaultBatchIndexCliArguments(), 6, ps, options.has("dump")); BatchBuildInfo activeBatchBuild = indexer.getActiveBatchBuildInfo(); if (activeBatchBuild != null) { ps.println(" + Active batch build:");
if (indexer.getActiveBatchBuildInfo() != null) { JobClient jobClient = getJobClient(); Set<String> jobs = indexer.getActiveBatchBuildInfo().getMapReduceJobTrackingUrls().keySet(); for (String jobId : jobs) { RunningJob job = jobClient.getJob(jobId); if (indexer.getActiveBatchBuildInfo() == null) { canBeDeleted = true;
BatchBuildInfo batchBuildInfo = indexerDefinition.getActiveBatchBuildInfo(); if (batchBuildInfo != null) { Set<String> jobs = batchBuildInfo.getMapReduceJobTrackingUrls().keySet();
@Override public void jobStarted(String jobId, String trackingUrl) { try { // Lock internal bypasses the index-in-delete-state check, which does not matter (and might cause // failure) in our case. String lock = indexerModel.lockIndexerInternal(indexerName, false); try { IndexerDefinition definition = indexerModel.getFreshIndexer(indexerName); BatchBuildInfo batchBuildInfo = new BatchBuildInfo(definition.getActiveBatchBuildInfo()).withJob(jobId, trackingUrl); IndexerDefinition updatedDefinition = new IndexerDefinitionBuilder().startFrom(definition) .activeBatchBuildInfo(batchBuildInfo) .build(); indexerModel.updateIndexerInternal(updatedDefinition); log.info("Updated indexer batch build state for indexer " + indexerName); } finally { indexerModel.unlockIndexer(lock, true); } } catch (Exception e) { log.error("failed to update indexer batch build state for indexer " + indexerName); } } }
if (indexer.getActiveBatchBuildInfo() != null) { JobClient jobClient = getJobClient(); Set<String> jobs = indexer.getActiveBatchBuildInfo().getMapReduceJobTrackingUrls().keySet(); for (String jobId : jobs) { RunningJob job = jobClient.getJob(JobID.forName(jobId)); if (indexer.getActiveBatchBuildInfo() == null) { canBeDeleted = true;
@Override public void jobStarted(String jobId, String trackingUrl) { try { // Lock internal bypasses the index-in-delete-state check, which does not matter (and might cause // failure) in our case. String lock = indexerModel.lockIndexerInternal(indexerName, false); try { IndexerDefinition definition = indexerModel.getFreshIndexer(indexerName); BatchBuildInfo batchBuildInfo = new BatchBuildInfo(definition.getActiveBatchBuildInfo()).withJob(jobId, trackingUrl); IndexerDefinition updatedDefinition = new IndexerDefinitionBuilder().startFrom(definition) .activeBatchBuildInfo(batchBuildInfo) .build(); indexerModel.updateIndexerInternal(updatedDefinition); log.info("Updated indexer batch build state for indexer " + indexerName); } finally { indexerModel.unlockIndexer(lock, true); } } catch (Exception e) { log.error("failed to update indexer batch build state for indexer " + indexerName); } } }
BatchBuildInfo activeJobInfo = indexer.getActiveBatchBuildInfo();
BatchBuildInfo activeJobInfo = indexer.getActiveBatchBuildInfo();
if (!Objects.equal(currentIndexer.getActiveBatchBuildInfo(), indexer.getActiveBatchBuildInfo())) { throw new IndexerUpdateException("The active batch build info cannot be modified by users.");
if (!Objects.equal(currentIndexer.getActiveBatchBuildInfo(), indexer.getActiveBatchBuildInfo())) { throw new IndexerUpdateException("The active batch build info cannot be modified by users.");
public IndexerDefinitionBuilder startFrom(IndexerDefinition existingDefinition) { this.name = existingDefinition.getName(); this.lifecycleState = existingDefinition.getLifecycleState(); this.batchIndexingState = existingDefinition.getBatchIndexingState(); this.incrementalIndexingState = existingDefinition.getIncrementalIndexingState(); this.subscriptionId = existingDefinition.getSubscriptionId(); this.configuration = existingDefinition.getConfiguration(); this.indexerComponentFactory = existingDefinition.getIndexerComponentFactory(); this.connectionType = existingDefinition.getConnectionType(); this.connectionParams = existingDefinition.getConnectionParams(); this.defaultBatchIndexCliArguments = existingDefinition.getDefaultBatchIndexCliArguments(); this.batchIndexCliArguments = existingDefinition.getBatchIndexCliArguments(); this.lastBatchBuildInfo = existingDefinition.getLastBatchBuildInfo(); this.activeBatchBuildInfo = existingDefinition.getActiveBatchBuildInfo(); this.subscriptionTimestamp = existingDefinition.getSubscriptionTimestamp(); this.occVersion = existingDefinition.getOccVersion(); return this; }
public IndexerDefinitionBuilder startFrom(IndexerDefinition existingDefinition) { this.name = existingDefinition.getName(); this.lifecycleState = existingDefinition.getLifecycleState(); this.batchIndexingState = existingDefinition.getBatchIndexingState(); this.incrementalIndexingState = existingDefinition.getIncrementalIndexingState(); this.subscriptionId = existingDefinition.getSubscriptionId(); this.configuration = existingDefinition.getConfiguration(); this.indexerComponentFactory = existingDefinition.getIndexerComponentFactory(); this.connectionType = existingDefinition.getConnectionType(); this.connectionParams = existingDefinition.getConnectionParams(); this.defaultBatchIndexCliArguments = existingDefinition.getDefaultBatchIndexCliArguments(); this.batchIndexCliArguments = existingDefinition.getBatchIndexCliArguments(); this.lastBatchBuildInfo = existingDefinition.getLastBatchBuildInfo(); this.activeBatchBuildInfo = existingDefinition.getActiveBatchBuildInfo(); this.subscriptionTimestamp = existingDefinition.getSubscriptionTimestamp(); this.occVersion = existingDefinition.getOccVersion(); return this; }
if (indexer.getActiveBatchBuildInfo() != null) { BatchBuildInfo buildInfo = indexer.getActiveBatchBuildInfo(); ObjectNode batchNode = node.putObject("activeBatchBuild");
if (indexer.getActiveBatchBuildInfo() != null) { BatchBuildInfo buildInfo = indexer.getActiveBatchBuildInfo(); ObjectNode batchNode = node.putObject("activeBatchBuild");