Search in sources :

Example 1 with File

use of org.apache.geode.cache.lucene.internal.filesystem.File in project geode by apache.

the class RegionDirectory method openInput.

@Override
public IndexInput openInput(String name, IOContext context) throws IOException {
    ensureOpen();
    final File file = fs.getFile(name);
    return new FileIndexInput(name, file);
}
Also used : File(org.apache.geode.cache.lucene.internal.filesystem.File)

Example 2 with File

use of org.apache.geode.cache.lucene.internal.filesystem.File in project geode by apache.

the class RegionDirectory method createTempOutput.

public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException {
    String name = prefix + "_temp_" + UUID.randomUUID() + suffix;
    final File file = fs.createTemporaryFile(name);
    final OutputStream out = file.getOutputStream();
    return new OutputStreamIndexOutput(name, name, out, 1000);
}
Also used : OutputStreamIndexOutput(org.apache.lucene.store.OutputStreamIndexOutput) OutputStream(java.io.OutputStream) File(org.apache.geode.cache.lucene.internal.filesystem.File)

Example 3 with File

use of org.apache.geode.cache.lucene.internal.filesystem.File in project geode by apache.

the class RegionDirectory method createOutput.

@Override
public IndexOutput createOutput(final String name, final IOContext context) throws IOException {
    ensureOpen();
    final File file = fs.createFile(name);
    final OutputStream out = file.getOutputStream();
    return new OutputStreamIndexOutput(name, name, out, 1000);
}
Also used : OutputStreamIndexOutput(org.apache.lucene.store.OutputStreamIndexOutput) OutputStream(java.io.OutputStream) File(org.apache.geode.cache.lucene.internal.filesystem.File)

Aggregations

File (org.apache.geode.cache.lucene.internal.filesystem.File)3 OutputStream (java.io.OutputStream)2 OutputStreamIndexOutput (org.apache.lucene.store.OutputStreamIndexOutput)2