private boolean needsSubscriptionIdUnassigned(IndexerDefinition indexer) { return indexer.getIncrementalIndexingState() == IncrementalIndexingState.DO_NOT_SUBSCRIBE && indexer.getSubscriptionId() != null; }
private boolean needsSubscriptionIdUnassigned(IndexerDefinition indexer) { return indexer.getIncrementalIndexingState() == IncrementalIndexingState.DO_NOT_SUBSCRIBE && indexer.getSubscriptionId() != null; }
private boolean shouldRunIndexer(IndexerDefinition indexerDef) { return indexerDef.getIncrementalIndexingState() == IncrementalIndexingState.SUBSCRIBE_AND_CONSUME && indexerDef.getSubscriptionId() != null && !indexerDef.getLifecycleState().isDeleteState(); }
private boolean needsSubscriptionIdAssigned(IndexerDefinition indexer) { return !indexer.getLifecycleState().isDeleteState() && indexer.getIncrementalIndexingState() != IncrementalIndexingState.DO_NOT_SUBSCRIBE && indexer.getSubscriptionId() == null; }
private boolean needsSubscriptionIdAssigned(IndexerDefinition indexer) { return !indexer.getLifecycleState().isDeleteState() && indexer.getIncrementalIndexingState() != IncrementalIndexingState.DO_NOT_SUBSCRIBE && indexer.getSubscriptionId() == null; }
private boolean shouldRunIndexer(IndexerDefinition indexerDef) { return indexerDef.getIncrementalIndexingState() == IncrementalIndexingState.SUBSCRIBE_AND_CONSUME && indexerDef.getSubscriptionId() != null && !indexerDef.getLifecycleState().isDeleteState(); }
Set<String> nonApplicableIndexes = Sets.newHashSet(); for (IndexInfo indexInfo : indexesInfo.getIndexInfos()) { String queueSubscriptionId = indexInfo.getIndexDefinition().getSubscriptionId(); if (indexMatchesRepository(repositoryName, indexInfo) && indexIsApplicable(indexInfo.getLilyIndexerConf().getRecordFilter(), table, oldRecord, newRecord)) {
ps.println(" + Incremental indexing state: " + indexer.getIncrementalIndexingState()); ps.println(" + Batch indexing state: " + indexer.getBatchIndexingState()); ps.println(" + SEP subscription ID: " + indexer.getSubscriptionId()); ps.println(" + SEP subscription timestamp: " + new DateTime(indexer.getSubscriptionTimestamp())); ps.println(" + Connection type: " + indexer.getConnectionType());
ps.println(" + Incremental indexing state: " + indexer.getIncrementalIndexingState()); ps.println(" + Batch indexing state: " + indexer.getBatchIndexingState()); ps.println(" + SEP subscription ID: " + indexer.getSubscriptionId()); ps.println(" + SEP subscription timestamp: " + new DateTime(indexer.getSubscriptionTimestamp())); ps.println(" + Connection type: " + indexer.getConnectionType());
private void unassignSubscription(String indexerName) { try { String lock = indexerModel.lockIndexer(indexerName); try { // Read current situation of record and assure it is still actual IndexerDefinition indexer = indexerModel.getFreshIndexer(indexerName); if (needsSubscriptionIdUnassigned(indexer)) { sepModel.removeSubscription(indexer.getSubscriptionId()); log.info("Deleted queue subscription for indexer " + indexerName); indexer = new IndexerDefinitionBuilder().startFrom(indexer).subscriptionId(null).build(); indexerModel.updateIndexerInternal(indexer); } } finally { indexerModel.unlockIndexer(lock); } } catch (Throwable t) { log.error("Error trying to delete the subscription for indexer " + indexerName, t); } }
private void unassignSubscription(String indexerName) { try { String lock = indexerModel.lockIndexer(indexerName); try { // Read current situation of record and assure it is still actual IndexerDefinition indexer = indexerModel.getFreshIndexer(indexerName); if (needsSubscriptionIdUnassigned(indexer)) { sepModel.removeSubscription(indexer.getSubscriptionId()); log.info("Deleted queue subscription for indexer " + indexerName); indexer = new IndexerDefinitionBuilder().startFrom(indexer).subscriptionId(null).build(); indexerModel.updateIndexerInternal(indexer); } } finally { indexerModel.unlockIndexer(lock); } } catch (Throwable t) { log.error("Error trying to delete the subscription for indexer " + indexerName, t); } }
canBeDeleted = true; String queueSubscriptionId = indexer.getSubscriptionId(); log.debug("EventWorker before removeSubscription for " + queueSubscriptionId); if (queueSubscriptionId != null) { sepModel.removeSubscription(indexer.getSubscriptionId());
canBeDeleted = true; String queueSubscriptionId = indexer.getSubscriptionId(); if (queueSubscriptionId != null) { sepModel.removeSubscription(indexer.getSubscriptionId());
SepConsumer sepConsumer = new SepConsumer(indexerDef.getSubscriptionId(), indexerDef.getSubscriptionTimestamp(), eventListener, threads, hostName, zk, hbaseConf, null);
SepConsumer sepConsumer = new SepConsumer(indexerDef.getSubscriptionId(), indexerDef.getSubscriptionTimestamp(), eventListener, threads, hostName, zk, hbaseConf, null,
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.getSubscriptionId() != null) node.put("subscriptionId", indexer.getSubscriptionId());
if (indexer.getSubscriptionId() != null) node.put("subscriptionId", indexer.getSubscriptionId());