List of usage examples for org.apache.lucene.store MMapDirectory setUseUnmap
public void setUseUnmap(final boolean useUnmapHack)
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)); }