org.electrocodeogram.cpc.core.api.provider.store
Interface IDebuggableStoreProvider

All Superinterfaces:
IProvider, IStoreProvider

public interface IDebuggableStoreProvider
extends IStoreProvider

An extension of the IStoreProvider interface which adds a couple of integrity checking and status methods which are meant to ease debugging efforts.

Implementation of this interface is optional.

Author:
vw
See Also:
IStoreProvider

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.electrocodeogram.cpc.core.api.provider.store.IStoreProvider
IStoreProvider.LockMode, IStoreProvider.UpdateMode
 
Method Summary
 boolean checkCacheIntegrity()
          Executes an integrity check of the internal cache structures of the store provider implementation.
 boolean checkDataIntegrity()
          Executes an integrity check of all internal data structures of the store provider implementation.
 java.lang.String getCacheStats()
          Returns a string which contains a number of statistics for the internal caching structures.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.store.IStoreProvider
acquireWriteLock, acquireWriteLockNonBlocking, addClone, addCloneGroup, addClones, getClonesByFile, getClonesByFile, getClonesByGroup, getFullCloneObjectExtension, getFullCloneObjectExtension, getPersistedCloneFileContent, getPersistedClonesForFile, hintPurgeCache, hintPurgeCache, holdingWriteLock, lookupClone, lookupCloneFile, lookupCloneFileByPath, lookupCloneGroup, moveCloneFile, persistData, purgeCache, purgeData, purgeData, releaseWriteLock, removeClone, removeCloneGroup, removeClones, revertData, setWriteLockHook, updateClone, updateCloneGroup, updateClones
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider
getProviderName, toString
 

Method Detail

getCacheStats

java.lang.String getCacheStats()
Returns a string which contains a number of statistics for the internal caching structures.
The data contained and the formatting is up to the store provider implementation.

DEBUG METHOD

Returns:
caching statistics, never null.

checkCacheIntegrity

boolean checkCacheIntegrity()
Executes an integrity check of the internal cache structures of the store provider implementation.
This method does not throw an exception under any circumstance. Detailed information about any violated constraints is logged as level ERROR or FATAL.

NOTE: this operation may be slow.

DEBUG METHOD

Returns:
false if integrity constrains have been violated, true otherwise.

checkDataIntegrity

boolean checkDataIntegrity()
                           throws StoreLockingException
Executes an integrity check of all internal data structures of the store provider implementation.
This method does not throw an exception under any circumstance. Detailed information about any violated constraints is logged as level ERROR or FATAL.

This method also executes all checkCacheIntegrity() checks.

NOTE: this is a potentially VERY SLOW operation.

An exclusive write lock is required before this method may be called.

DEBUG METHOD

Returns:
false if integrity constrains have been violated, true otherwise.
Throws:
StoreLockingException - thrown if the current thread does not hold an exclusive write lock.