Search in sources :

Example 1 with LuceneEventIndex

use of org.apache.nifi.provenance.index.lucene.LuceneEventIndex in project nifi by apache.

the class WriteAheadProvenanceRepository method init.

synchronized void init(RecordWriterFactory recordWriterFactory, RecordReaderFactory recordReaderFactory, final EventReporter eventReporter, final Authorizer authorizer, final ProvenanceAuthorizableFactory resourceFactory) throws IOException {
    final EventFileManager fileManager = new EventFileManager();
    eventStore = new PartitionedWriteAheadEventStore(config, recordWriterFactory, recordReaderFactory, eventReporter, fileManager);
    final IndexManager indexManager = new SimpleIndexManager(config);
    eventIndex = new LuceneEventIndex(config, indexManager, eventReporter);
    this.eventReporter = eventReporter;
    this.authorizer = authorizer;
    this.resourceFactory = resourceFactory;
    eventStore.initialize();
    eventIndex.initialize(eventStore);
    try {
        eventStore.reindexLatestEvents(eventIndex);
    } catch (final Exception e) {
        logger.error("Failed to re-index some of the Provenance Events. It is possible that some of the latest " + "events will not be available from the Provenance Repository when a query is issued.", e);
    }
}
Also used : SimpleIndexManager(org.apache.nifi.provenance.lucene.SimpleIndexManager) IndexManager(org.apache.nifi.provenance.lucene.IndexManager) PartitionedWriteAheadEventStore(org.apache.nifi.provenance.store.PartitionedWriteAheadEventStore) EventFileManager(org.apache.nifi.provenance.store.EventFileManager) LuceneEventIndex(org.apache.nifi.provenance.index.lucene.LuceneEventIndex) SimpleIndexManager(org.apache.nifi.provenance.lucene.SimpleIndexManager) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 LuceneEventIndex (org.apache.nifi.provenance.index.lucene.LuceneEventIndex)1 IndexManager (org.apache.nifi.provenance.lucene.IndexManager)1 SimpleIndexManager (org.apache.nifi.provenance.lucene.SimpleIndexManager)1 EventFileManager (org.apache.nifi.provenance.store.EventFileManager)1 PartitionedWriteAheadEventStore (org.apache.nifi.provenance.store.PartitionedWriteAheadEventStore)1