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

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

Introduction

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

Prototype

public MMapDirectory(Path path, LockFactory lockFactory, int maxChunkSize) throws IOException 

Source Link

Document

Create a new MMapDirectory for the named location, specifying the maximum chunk size used for memory mapping.

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 a  v  a  2s .co m
        mapDirectory.setUseUnmap(unmapHack);
    } catch (Exception e) {
        log.warn("Unmap not supported on this JVM, continuing on without setting unmap", e);
    }
    return mapDirectory;
}