public class OakDirectory
extends org.apache.lucene.store.Directory
Directory
(a flat list of files)
based on an Oak NodeBuilder
.Modifier and Type | Class and Description |
---|---|
static interface |
OakDirectory.BlobFactory |
static class |
OakDirectory.BlobStoreBlobFactory |
static class |
OakDirectory.NodeBuilderBlobFactory |
Modifier and Type | Field and Description |
---|---|
protected org.apache.jackrabbit.oak.spi.state.NodeBuilder |
builder |
protected org.apache.jackrabbit.oak.spi.state.NodeBuilder |
directoryBuilder |
Constructor and Description |
---|
OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder,
IndexDefinition definition,
boolean readOnly) |
OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder,
String dataNodeName,
IndexDefinition definition,
boolean readOnly) |
OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder,
String dataNodeName,
IndexDefinition definition,
boolean readOnly,
org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore blobStore) |
OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder,
String dataNodeName,
IndexDefinition definition,
boolean readOnly,
OakDirectory.BlobFactory blobFactory) |
Modifier and Type | Method and Description |
---|---|
void |
clearLock(String name) |
void |
close() |
void |
copy(OakDirectory dest,
String name)
Copies the file with the given
name to the dest
directory. |
org.apache.lucene.store.IndexOutput |
createOutput(String name,
org.apache.lucene.store.IOContext context) |
void |
deleteFile(String name) |
boolean |
fileExists(String name) |
long |
fileLength(String name) |
org.apache.lucene.store.LockFactory |
getLockFactory() |
boolean |
isDirty() |
String[] |
listAll() |
org.apache.lucene.store.Lock |
makeLock(String name) |
org.apache.lucene.store.IndexInput |
openInput(String name,
org.apache.lucene.store.IOContext context) |
void |
setLockFactory(org.apache.lucene.store.LockFactory lockFactory) |
void |
sync(Collection<String> names) |
String |
toString() |
protected final org.apache.jackrabbit.oak.spi.state.NodeBuilder builder
protected final org.apache.jackrabbit.oak.spi.state.NodeBuilder directoryBuilder
public OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder, IndexDefinition definition, boolean readOnly)
public OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder, String dataNodeName, IndexDefinition definition, boolean readOnly)
public OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder, String dataNodeName, IndexDefinition definition, boolean readOnly, @Nullable org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore blobStore)
public OakDirectory(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder, String dataNodeName, IndexDefinition definition, boolean readOnly, OakDirectory.BlobFactory blobFactory)
public String[] listAll() throws IOException
listAll
in class org.apache.lucene.store.Directory
IOException
public boolean fileExists(String name) throws IOException
fileExists
in class org.apache.lucene.store.Directory
IOException
public void deleteFile(String name) throws IOException
deleteFile
in class org.apache.lucene.store.Directory
IOException
public long fileLength(String name) throws IOException
fileLength
in class org.apache.lucene.store.Directory
IOException
public org.apache.lucene.store.IndexOutput createOutput(String name, org.apache.lucene.store.IOContext context) throws IOException
createOutput
in class org.apache.lucene.store.Directory
IOException
public org.apache.lucene.store.IndexInput openInput(String name, org.apache.lucene.store.IOContext context) throws IOException
openInput
in class org.apache.lucene.store.Directory
IOException
public org.apache.lucene.store.Lock makeLock(String name)
makeLock
in class org.apache.lucene.store.Directory
public void clearLock(String name) throws IOException
clearLock
in class org.apache.lucene.store.Directory
IOException
public void sync(Collection<String> names) throws IOException
sync
in class org.apache.lucene.store.Directory
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class org.apache.lucene.store.Directory
IOException
public void setLockFactory(org.apache.lucene.store.LockFactory lockFactory) throws IOException
setLockFactory
in class org.apache.lucene.store.Directory
IOException
public org.apache.lucene.store.LockFactory getLockFactory()
getLockFactory
in class org.apache.lucene.store.Directory
public String toString()
toString
in class org.apache.lucene.store.Directory
public void copy(OakDirectory dest, String name) throws IOException
name
to the dest
directory. The file is copied 'by reference'. That is, the file in the
destination directory will reference the same blob values as the source
file.
This method is a no-op if the file does not exist in this directory.
dest
- the destination directory.name
- the name of the file to copy.IOException
- if an error occurs while copying the file.IllegalArgumentException
- if the destination directory does not
use the same OakDirectory.BlobFactory
as this
directory.public boolean isDirty()
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.