Class Nd
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.Nd
Network Database for storing semantic information.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNd(File dbPath, ChunkCache chunkCache, NdNodeTypeRegistry<NdNode> nodeTypes, int minVersion, int maxVersion, int currentVersion)Nd(File dbPath, NdNodeTypeRegistry<NdNode> nodeTypes, int minVersion, int maxVersion, int currentVersion) -
Method Summary
Modifier and TypeMethodDescriptionvoidacquireWriteLock(int giveupReadLocks, org.eclipse.core.runtime.IProgressMonitor monitor)Acquire a write lock on thisNd, giving up the specified number of read locks first.voidacquireWriteLock(org.eclipse.core.runtime.IProgressMonitor monitor)Acquire a write lock on thisNd.voidadjustThreadForReadLock(Map<Thread,org.aspectj.org.eclipse.jdt.internal.core.nd.Nd.DebugLockInfo> lockDebugging)voidclear(org.eclipse.core.runtime.IProgressMonitor monitor)voidvoidclose()voiddelete(long address)Creates aIndexExceptionBuilderobject that collects information about database corruption after it is detected.getCachedResult(Object key)<T> TReturns a cookie that was previously attached usingsetData(Class, Object).getDB()intReturns the version that shall be used when creating new databases.longintintgetNode(long address, short nodeType)shortgetNodeType(Class<?> toQuery)Returns the type ID for the given classgetPath()<T extends NdNode>
ITypeFactory<T>getTypeFactory(short nodeType)longbooleanprotected booleanReturns whether thisNdcan never be written to.booleanbooleanisSupportedVersion(int vers)booleanisValidAddress(long address)protected voidlogDoubleDeletion(long addressOfNodeToDelete)voidSynchronously processes all pending deletionsvoidputCachedResult(Object key, Object result)putCachedResult(Object key, Object result, boolean replace)voidvoidvoidreleaseWriteLock(int establishReadLocks, boolean flush)voidremoveCachedResult(Object key)voidscheduleDeletion(long addressOfNodeToDelete)<T> voidInserts a cookie that can be later retrieved via getData(String).static intversion(int major, int minor)static StringversionString(int version)
-
Field Details
-
sDEBUG_LOCKS
public static boolean sDEBUG_LOCKS -
DEBUG_DUPLICATE_DELETIONS
public static boolean DEBUG_DUPLICATE_DELETIONS -
db
-
-
Constructor Details
-
Nd
public Nd(File dbPath, NdNodeTypeRegistry<NdNode> nodeTypes, int minVersion, int maxVersion, int currentVersion) throws IndexException- Throws:
IndexException
-
Nd
public Nd(File dbPath, ChunkCache chunkCache, NdNodeTypeRegistry<NdNode> nodeTypes, int minVersion, int maxVersion, int currentVersion) throws IndexException- Throws:
IndexException
-
-
Method Details
-
version
public static int version(int major, int minor) -
getDefaultVersion
public int getDefaultVersion()Returns the version that shall be used when creating new databases. -
isSupportedVersion
public boolean isSupportedVersion(int vers) -
getMinSupportedVersion
public int getMinSupportedVersion() -
getMaxSupportedVersion
public int getMaxSupportedVersion() -
versionString
-
getPath
-
getWriteNumber
public long getWriteNumber() -
scheduleDeletion
public void scheduleDeletion(long addressOfNodeToDelete) -
logDoubleDeletion
protected void logDoubleDeletion(long addressOfNodeToDelete) -
processDeletions
public void processDeletions()Synchronously processes all pending deletions -
setData
Inserts a cookie that can be later retrieved via getData(String). -
getData
Returns a cookie that was previously attached usingsetData(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. -
isPermanentlyReadOnly
protected boolean isPermanentlyReadOnly()Returns whether thisNdcan never be written to. Writable subclasses should return false. -
getDB
-
acquireReadLock
-
releaseReadLock
public void releaseReadLock() -
acquireWriteLock
public void acquireWriteLock(org.eclipse.core.runtime.IProgressMonitor monitor)Acquire a write lock on thisNd. Blocks until any existing read/write locks are released.- Throws:
org.eclipse.core.runtime.OperationCanceledExceptionIllegalStateException- if thisNdis not writable
-
acquireWriteLock
public void acquireWriteLock(int giveupReadLocks, org.eclipse.core.runtime.IProgressMonitor monitor) throws InterruptedExceptionAcquire a write lock on thisNd, giving up the specified number of read locks first. Blocks until any existing read/write locks are released.- Throws:
InterruptedExceptionIllegalStateException- if thisNdis not writable
-
releaseWriteLock
public final void releaseWriteLock() -
releaseWriteLock
public void releaseWriteLock(int establishReadLocks, boolean flush) -
hasWaitingReaders
public boolean hasWaitingReaders() -
getLastWriteAccess
public long getLastWriteAccess() -
isSupportedVersion
- Throws:
IndexException
-
close
- Throws:
IndexException
-
clearResultCache
public void clearResultCache() -
getCachedResult
-
putCachedResult
-
putCachedResult
-
removeCachedResult
-
adjustThreadForReadLock
-
getNode
- Throws:
IndexException
-
getTypeFactory
-
getNodeType
Returns the type ID for the given class -
delete
public void delete(long address) -
getTypeRegistry
-
clear
public void clear(org.eclipse.core.runtime.IProgressMonitor monitor) -
isValidAddress
public boolean isValidAddress(long address) -
describeProblem
Creates aIndexExceptionBuilderobject that collects information about database corruption after it is detected.
-