Example usage for org.apache.lucene.store MMapDirectory setUseUnmap

List of usage examples for org.apache.lucene.store MMapDirectory setUseUnmap

Introduction

In this page you can find the example usage for org.apache.lucene.store MMapDirectory setUseUnmap.

Prototype

public void setUseUnmap(final boolean useUnmapHack) 

Source Link

Document

This method enables the workaround for unmapping the buffers from address space after closing IndexInput , that is mentioned in the bug report.

Usage

From source file:org.apache.solr.core.MMapDirectoryFactory.java

License:Apache License

@Override
protected Directory create(String path, DirContext dirContext) throws IOException {
    MMapDirectory mapDirectory = new MMapDirectory(new File(path), null, maxChunk);
    try {/*from ww w.  j ava 2s .c  o m*/
        mapDirectory.setUseUnmap(unmapHack);
    } catch (Exception e) {
        log.warn("Unmap not supported on this JVM, continuing on without setting unmap", e);
    }
    return mapDirectory;
}

From source file:org.meresco.lucene.numerate.TermNumerator.java

License:Open Source License

public TermNumerator(File path) throws IOException {
    MMapDirectory taxoDirectory = new MMapDirectory(path);
    taxoDirectory.setUseUnmap(false);
    taxoWriter = new DirectoryTaxonomyWriter(taxoDirectory, IndexWriterConfig.OpenMode.CREATE_OR_APPEND,
            new LruTaxonomyWriterCache(100));
}