org.neo4j.kernel.impl.nioneo.store
Class NeoStore

java.lang.Object
  extended by org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore
      extended by org.neo4j.kernel.impl.nioneo.store.AbstractStore
          extended by org.neo4j.kernel.impl.nioneo.store.NeoStore

public class NeoStore
extends AbstractStore

This class contains the references to the "NodeStore,RelationshipStore, PropertyStore and RelationshipTypeStore". NeoStore doesn't actually "store" anything but extends the AbstractStore for the "type and version" validation performed in there.


Field Summary
static String DEFAULT_NAME
           
static String TYPE_DESCRIPTOR
           
 
Fields inherited from class org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore
ALL_STORES_VERSION, logger, storageFileName, UNKNOWN_VERSION
 
Constructor Summary
NeoStore(Map<?,?> config)
           
 
Method Summary
protected  void checkVersion()
           
protected  void closeStorage()
          Closes the node,relationship,property and relationship type stores.
static void createStore(String fileName, Map<?,?> config)
          Creates the neo,node,relationship,property and relationship type stores.
 void flushAll()
           
 List<WindowPoolStats> getAllWindowPoolStats()
           
 long getCreationTime()
           
 IdGeneratorFactory getIdGeneratorFactory()
           
 long getLastCommittedTx()
           
 NodeStore getNodeStore()
          Returns the node store.
 PropertyStore getPropertyStore()
          Returns the property store.
 long getRandomNumber()
           
 int getRecordSize()
          Returns the fixed size of each record in this store.
 int getRelationshipGrabSize()
           
 RelationshipStore getRelationshipStore()
          The relationship store.
 RelationshipTypeStore getRelationshipTypeStore()
          Returns the relationship type store.
 StoreId getStoreId()
           
 long getStoreVersion()
           
static long getStoreVersion(String storeDir)
           
 TxHook getTxHook()
           
 String getTypeDescriptor()
          Returns the type and version that identifies this store.
 long getVersion()
           
 long incrementVersion()
           
protected  void initStorage()
          Called from the constructor after the end header has been checked.
 boolean isStoreOk()
           
 void logIdUsage(StringLogger msgLog)
           
static void logIdUsage(StringLogger logger, Store store)
           
 void logVersions(StringLogger msgLog)
           
static void main(String[] args)
           
 void makeStoreOk()
          If store is not ok a call to this method will rebuild the IdGenerator used by this store and if successful mark it as ok.
 void rebuildIdGenerators()
           
 void setCreationTime(long time)
           
 void setLastCommittedTx(long txId)
           
 void setRandomNumber(long nr)
           
 void setRecoveredStatus(boolean status)
           
 void setStoreVersion(long version)
           
 void setVersion(long version)
           
static long setVersion(String storeDir, long version)
          Sets the version for the given neostore file in storeDir.
 void updateIdGenerators()
           
static String versionLongToString(long storeVersion)
           
static long versionStringToLong(String storeVersion)
           
 
Methods inherited from class org.neo4j.kernel.impl.nioneo.store.AbstractStore
createEmptyStore, figureOutHighestIdInUse, getEffectiveRecordSize, isRecordInUse, readAndVerifyBlockSize, rebuildIdGenerator, setHighId, verifyFileSizeAndTruncate
 
Methods inherited from class org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore
acquireWindow, buildTypeDescriptorAndVersion, calculateMappedMemory, checkStorage, close, closeIdGenerator, createIdGenerator, freeId, getConfig, getFileChannel, getFileSystem, getHighestPossibleIdInUse, getHighId, getIdType, getIfMemoryMapped, getNumberOfIdsInUse, getStorageFileName, getStoreDir, getStoreOk, getTypeAndVersionDescriptor, getWindowPoolStats, isInRecoveryMode, loadStorage, longFromIntAndMod, nextId, openIdGenerator, openIdGenerator, openReadOnlyIdGenerator, registerIdFromUpdateRecord, releaseFileLockAndCloseFileChannel, releaseWindow, setHighId, setRecovered, setStoreNotOk, setWindowPool, toString, unsetRecovered, updateHighId, verifyCorrectTypeDescriptorAndVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_DESCRIPTOR

public static final String TYPE_DESCRIPTOR
See Also:
Constant Field Values

DEFAULT_NAME

public static final String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

NeoStore

public NeoStore(Map<?,?> config)
Method Detail

checkVersion

protected void checkVersion()
Overrides:
checkVersion in class CommonAbstractStore

initStorage

protected void initStorage()
Description copied from class: CommonAbstractStore
Called from the constructor after the end header has been checked. The store implementation can setup it's persistence windows and other resources that are needed by overriding this implementation.

This default implementation does nothing.

Overrides:
initStorage in class CommonAbstractStore

closeStorage

protected void closeStorage()
Closes the node,relationship,property and relationship type stores.

Overrides:
closeStorage in class CommonAbstractStore

flushAll

public void flushAll()
Overrides:
flushAll in class CommonAbstractStore

getTypeDescriptor

public String getTypeDescriptor()
Description copied from class: CommonAbstractStore
Returns the type and version that identifies this store.

Specified by:
getTypeDescriptor in class CommonAbstractStore
Returns:
This store's implementation type and version identifier

getIdGeneratorFactory

public IdGeneratorFactory getIdGeneratorFactory()

getRecordSize

public int getRecordSize()
Description copied from class: AbstractStore
Returns the fixed size of each record in this store.

Specified by:
getRecordSize in class AbstractStore
Returns:
The record size

getTxHook

public TxHook getTxHook()

createStore

public static void createStore(String fileName,
                               Map<?,?> config)
Creates the neo,node,relationship,property and relationship type stores.

Parameters:
fileName - The name of store
config - Map of configuration parameters

setVersion

public static long setVersion(String storeDir,
                              long version)
Sets the version for the given neostore file in storeDir.

Parameters:
storeDir - the store dir to locate the neostore file in.
version - the version to set.
Returns:
the previous version before writing.

getStoreVersion

public static long getStoreVersion(String storeDir)

getStoreId

public StoreId getStoreId()

getCreationTime

public long getCreationTime()

setCreationTime

public void setCreationTime(long time)

getRandomNumber

public long getRandomNumber()

setRandomNumber

public void setRandomNumber(long nr)

setRecoveredStatus

public void setRecoveredStatus(boolean status)

getVersion

public long getVersion()

setVersion

public void setVersion(long version)

setLastCommittedTx

public void setLastCommittedTx(long txId)

getLastCommittedTx

public long getLastCommittedTx()

incrementVersion

public long incrementVersion()

getStoreVersion

public long getStoreVersion()

setStoreVersion

public void setStoreVersion(long version)

getNodeStore

public NodeStore getNodeStore()
Returns the node store.

Returns:
The node store

getRelationshipStore

public RelationshipStore getRelationshipStore()
The relationship store.

Returns:
The relationship store

getRelationshipTypeStore

public RelationshipTypeStore getRelationshipTypeStore()
Returns the relationship type store.

Returns:
The relationship type store

getPropertyStore

public PropertyStore getPropertyStore()
Returns the property store.

Returns:
The property store

makeStoreOk

public void makeStoreOk()
Description copied from class: CommonAbstractStore
If store is not ok a call to this method will rebuild the IdGenerator used by this store and if successful mark it as ok.

Overrides:
makeStoreOk in class CommonAbstractStore

rebuildIdGenerators

public void rebuildIdGenerators()
Overrides:
rebuildIdGenerators in class CommonAbstractStore

updateIdGenerators

public void updateIdGenerators()

getRelationshipGrabSize

public int getRelationshipGrabSize()

getAllWindowPoolStats

public List<WindowPoolStats> getAllWindowPoolStats()
Specified by:
getAllWindowPoolStats in class AbstractStore

isStoreOk

public boolean isStoreOk()

logVersions

public void logVersions(StringLogger msgLog)
Overrides:
logVersions in class CommonAbstractStore

logIdUsage

public void logIdUsage(StringLogger msgLog)

logIdUsage

public static void logIdUsage(StringLogger logger,
                              Store store)

versionStringToLong

public static long versionStringToLong(String storeVersion)

versionLongToString

public static String versionLongToString(long storeVersion)

main

public static void main(String[] args)


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.