public final class Nd
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Database |
db |
static boolean |
DEBUG_DUPLICATE_DELETIONS |
static boolean |
sDEBUG_LOCKS |
| Constructor and Description |
|---|
Nd(java.io.File dbPath,
ChunkCache chunkCache,
NdNodeTypeRegistry<NdNode> nodeTypes,
int minVersion,
int maxVersion,
int currentVersion) |
Nd(java.io.File dbPath,
NdNodeTypeRegistry<NdNode> nodeTypes,
int minVersion,
int maxVersion,
int currentVersion) |
| Modifier and Type | Method and Description |
|---|---|
IReader |
acquireReadLock() |
void |
acquireWriteLock(int giveupReadLocks,
IProgressMonitor monitor)
Acquire a write lock on this
Nd, giving up the specified number of read locks first. |
void |
acquireWriteLock(IProgressMonitor monitor)
Acquire a write lock on this
Nd. |
void |
adjustThreadForReadLock(java.util.Map<java.lang.Thread,org.aspectj.org.eclipse.jdt.internal.core.nd.Nd.DebugLockInfo> lockDebugging) |
void |
clear(IProgressMonitor monitor) |
void |
clearResultCache() |
void |
close() |
void |
delete(long address) |
IndexExceptionBuilder |
describeProblem()
Creates a
IndexExceptionBuilder object that collects information about database corruption after it is
detected. |
java.lang.Object |
getCachedResult(java.lang.Object key) |
<T> T |
getData(java.lang.Class<T> key,
java.util.function.Supplier<T> defaultValue)
Returns a cookie that was previously attached using
setData(Class, Object). |
Database |
getDB() |
int |
getDefaultVersion()
Returns the version that shall be used when creating new databases.
|
long |
getLastWriteAccess() |
int |
getMaxSupportedVersion() |
int |
getMinSupportedVersion() |
NdNode |
getNode(long address,
short nodeType) |
short |
getNodeType(java.lang.Class<?> toQuery)
Returns the type ID for the given class
|
java.io.File |
getPath() |
<T extends NdNode> |
getTypeFactory(short nodeType) |
NdNodeTypeRegistry<NdNode> |
getTypeRegistry() |
long |
getWriteNumber() |
boolean |
hasWaitingReaders() |
protected boolean |
isPermanentlyReadOnly()
Returns whether this
Nd can never be written to. |
boolean |
isSupportedVersion() |
boolean |
isSupportedVersion(int vers) |
boolean |
isValidAddress(long address) |
protected void |
logDoubleDeletion(long addressOfNodeToDelete) |
void |
processDeletions()
Synchronously processes all pending deletions
|
void |
putCachedResult(java.lang.Object key,
java.lang.Object result) |
java.lang.Object |
putCachedResult(java.lang.Object key,
java.lang.Object result,
boolean replace) |
void |
releaseReadLock() |
void |
releaseWriteLock() |
void |
releaseWriteLock(int establishReadLocks,
boolean flush) |
void |
removeCachedResult(java.lang.Object key) |
void |
scheduleDeletion(long addressOfNodeToDelete) |
<T> void |
setData(java.lang.Class<T> key,
T value)
Inserts a cookie that can be later retrieved via getData(String).
|
static int |
version(int major,
int minor) |
static java.lang.String |
versionString(int version) |
public static boolean sDEBUG_LOCKS
public static boolean DEBUG_DUPLICATE_DELETIONS
protected Database db
public Nd(java.io.File dbPath,
NdNodeTypeRegistry<NdNode> nodeTypes,
int minVersion,
int maxVersion,
int currentVersion)
throws IndexException
IndexExceptionpublic Nd(java.io.File dbPath,
ChunkCache chunkCache,
NdNodeTypeRegistry<NdNode> nodeTypes,
int minVersion,
int maxVersion,
int currentVersion)
throws IndexException
IndexExceptionpublic static int version(int major,
int minor)
public int getDefaultVersion()
public boolean isSupportedVersion(int vers)
public int getMinSupportedVersion()
public int getMaxSupportedVersion()
public static java.lang.String versionString(int version)
public java.io.File getPath()
public long getWriteNumber()
public void scheduleDeletion(long addressOfNodeToDelete)
protected void logDoubleDeletion(long addressOfNodeToDelete)
public void processDeletions()
public <T> void setData(java.lang.Class<T> key,
T value)
public <T> T getData(java.lang.Class<T> key,
java.util.function.Supplier<T> defaultValue)
setData(Class, Object). If no such cookie
exists, it is computed using the given function and remembered for later. The function may return null.
If it does, this method will also return null and no cookie will be stored.protected boolean isPermanentlyReadOnly()
Nd can never be written to. Writable subclasses should return false.public Database getDB()
public IReader acquireReadLock()
public void releaseReadLock()
public void acquireWriteLock(IProgressMonitor monitor)
Nd. Blocks until any existing read/write locks are released.OperationCanceledExceptionjava.lang.IllegalStateException - if this Nd is not writablepublic void acquireWriteLock(int giveupReadLocks,
IProgressMonitor monitor)
throws java.lang.InterruptedException
Nd, giving up the specified number of read locks first. Blocks
until any existing read/write locks are released.java.lang.InterruptedExceptionjava.lang.IllegalStateException - if this Nd is not writablepublic final void releaseWriteLock()
public void releaseWriteLock(int establishReadLocks,
boolean flush)
public boolean hasWaitingReaders()
public long getLastWriteAccess()
public boolean isSupportedVersion()
throws IndexException
IndexExceptionpublic void close()
throws IndexException
IndexExceptionpublic void clearResultCache()
public java.lang.Object getCachedResult(java.lang.Object key)
public void putCachedResult(java.lang.Object key,
java.lang.Object result)
public java.lang.Object putCachedResult(java.lang.Object key,
java.lang.Object result,
boolean replace)
public void removeCachedResult(java.lang.Object key)
public void adjustThreadForReadLock(java.util.Map<java.lang.Thread,org.aspectj.org.eclipse.jdt.internal.core.nd.Nd.DebugLockInfo> lockDebugging)
public NdNode getNode(long address, short nodeType) throws IndexException
IndexExceptionpublic <T extends NdNode> ITypeFactory<T> getTypeFactory(short nodeType)
public short getNodeType(java.lang.Class<?> toQuery)
public void delete(long address)
public NdNodeTypeRegistry<NdNode> getTypeRegistry()
public void clear(IProgressMonitor monitor)
public boolean isValidAddress(long address)
public IndexExceptionBuilder describeProblem()
IndexExceptionBuilder object that collects information about database corruption after it is
detected.