List of usage examples for org.apache.lucene.util InfoStream NO_OUTPUT
InfoStream NO_OUTPUT
To view the source code for org.apache.lucene.util InfoStream NO_OUTPUT.
Click Source Link
From source file:org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService.java
License:Apache License
@Deactivate private void deactivate() throws InterruptedException, IOException { for (ServiceRegistration reg : regs) { reg.unregister();/* w ww.j a v a2 s.c o m*/ } for (Registration reg : oakRegs) { reg.unregister(); } if (backgroundObserver != null) { backgroundObserver.close(); } if (indexProvider != null) { indexProvider.close(); indexProvider = null; } //Close the copier first i.e. before executorService if (indexCopier != null) { indexCopier.close(); } if (executorService != null) { executorService.shutdown(); executorService.awaitTermination(1, TimeUnit.MINUTES); } InfoStream.setDefault(InfoStream.NO_OUTPUT); }
From source file:org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderServiceTest.java
License:Apache License
@Test public void defaultSetup() throws Exception { MockOsgi.activate(service, context.bundleContext(), getDefaultConfig()); assertNotNull(context.getService(QueryIndexProvider.class)); assertNotNull(context.getService(Observer.class)); assertNotNull(context.getService(IndexEditorProvider.class)); LuceneIndexEditorProvider editorProvider = (LuceneIndexEditorProvider) context .getService(IndexEditorProvider.class); assertNotNull(editorProvider.getIndexCopier()); IndexCopier indexCopier = service.getIndexCopier(); assertNotNull("IndexCopier should be initialized as CopyOnRead is enabled by default", indexCopier); assertTrue(indexCopier.isPrefetchEnabled()); assertNotNull("CopyOnRead should be enabled by default", context.getService(CopyOnReadStatsMBean.class)); assertNotNull(context.getService(CacheStatsMBean.class)); assertTrue(context.getService(Observer.class) instanceof BackgroundObserver); assertEquals(InfoStream.NO_OUTPUT, InfoStream.getDefault()); assertEquals(1024, BooleanQuery.getMaxClauseCount()); MockOsgi.deactivate(service);/*from www . ja v a2s .c om*/ }