.activeBatchBuildInfo(jobInfo) .batchIndexingState(BatchIndexingState.BUILDING) .batchIndexCliArguments(null)
.activeBatchBuildInfo(jobInfo) .batchIndexingState(BatchIndexingState.BUILDING) .batchIndexCliArguments(null)
@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); } } }
@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); } } }
.startFrom(indexer) .lastBatchBuildInfo(batchBuildInfo) .activeBatchBuildInfo(null) .batchIndexingState(IndexerDefinition.BatchIndexingState.INACTIVE) .build();
.startFrom(indexer) .lastBatchBuildInfo(batchBuildInfo) .activeBatchBuildInfo(null) .batchIndexingState(BatchIndexingState.INACTIVE) .build();
indexerDefinitionBuilder.connectionType(connectionType); indexerDefinitionBuilder.connectionParams(connectionParams); indexerDefinitionBuilder.activeBatchBuildInfo(activeBatchBuild); indexerDefinitionBuilder.lastBatchBuildInfo(lastBatchBuild); indexerDefinitionBuilder.batchIndexCliArguments(batchIndexCliArguments);
indexerDefinitionBuilder.connectionType(connectionType); indexerDefinitionBuilder.connectionParams(connectionParams); indexerDefinitionBuilder.activeBatchBuildInfo(activeBatchBuild); indexerDefinitionBuilder.lastBatchBuildInfo(lastBatchBuild); indexerDefinitionBuilder.batchIndexCliArguments(batchIndexCliArguments);