/** * Creates a replacement for this same LuceneBackendResources: * reuses the existing locks and executors (which can't be reconfigured on the fly), * reuses the same Workspace and ErrorHandler, but will use a new LuceneWorkVisitor. * The LuceneWorkVisitor contains the strategies we use to apply update operations on the index, * and we might need to change them after the backend is started. * * @return the new LuceneBackendResources to replace this one. */ public LuceneBackendResources onTheFlyRebuild() { return new LuceneBackendResources( this ); }
/** * Creates a replacement for this same LuceneBackendResources: * reuses the existing locks and executors (which can't be reconfigured on the fly), * reuses the same Workspace and ErrorHandler, but will use a new LuceneWorkVisitor. * The LuceneWorkVisitor contains the strategies we use to apply update operations on the index, * and we might need to change them after the backend is started. * * @return the new LuceneBackendResources to replace this one. */ public LuceneBackendResources onTheFlyRebuild() { return new LuceneBackendResources( this ); }
public void initialize(Properties props, WorkerBuildContext context, IndexManager indexManager) { sync = BackendFactory.isConfiguredAsSync( props ); if ( workspaceOverride == null ) { workspaceOverride = WorkspaceFactory.createWorkspace( (DirectoryBasedIndexManager) indexManager, context, props ); } resources = new LuceneBackendResources( context, (DirectoryBasedIndexManager) indexManager, props, workspaceOverride ); streamWorker = new LuceneBackendTaskStreamer( resources ); String indexName = indexManager.getIndexName(); if ( sync ) { final SyncWorkProcessor batchSyncProcessor = new SyncWorkProcessor( resources, indexName ); batchSyncProcessor.start(); log.luceneBackendInitializedSynchronously( indexName ); workProcessor = batchSyncProcessor; } else { workProcessor = new AsyncWorkProcessor( resources ); log.luceneBackendInitializedAsynchronously( indexName ); } }
public void initialize(Properties props, WorkerBuildContext context, IndexManager indexManager) { sync = BackendFactory.isConfiguredAsSync( props ); if ( workspaceOverride == null ) { workspaceOverride = WorkspaceFactory.createWorkspace( (DirectoryBasedIndexManager) indexManager, context, props ); } resources = new LuceneBackendResources( context, (DirectoryBasedIndexManager) indexManager, props, workspaceOverride ); streamWorker = new LuceneBackendTaskStreamer( resources ); String indexName = indexManager.getIndexName(); if ( sync ) { final SyncWorkProcessor batchSyncProcessor = new SyncWorkProcessor( resources, indexName ); batchSyncProcessor.start(); log.luceneBackendInitializedSynchronously( indexName ); workProcessor = batchSyncProcessor; } else { workProcessor = new AsyncWorkProcessor( resources ); log.luceneBackendInitializedAsynchronously( indexName ); } }