Example usage for org.apache.lucene.util InfoStream NO_OUTPUT

List of usage examples for org.apache.lucene.util InfoStream NO_OUTPUT

Introduction

In this page you can find the example usage for org.apache.lucene.util InfoStream NO_OUTPUT.

Prototype

InfoStream NO_OUTPUT

To view the source code for org.apache.lucene.util InfoStream NO_OUTPUT.

Click Source Link

Document

Instance of InfoStream that does no logging at all.

Usage

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*/
}