org.hypergraphdb
Class HGConfiguration

java.lang.Object
  extended by org.hypergraphdb.HGConfiguration

public class HGConfiguration
extends java.lang.Object

A bean that holds configuration parameters for a HyperGraphDB initialization. An instance can be passed to the HGEnvironment.configure(String, HGConfiguration) or HGEnvironment.get(String, HGConfiguration) methods.

Author:
Borislav Iordanov

Field Summary
static long DEFAULT_STORE_CACHE
          The default size in bytes of the storage (i.e.
 
Constructor Summary
HGConfiguration()
           
 
Method Summary
 boolean getCancelMaintenance()
          Return true if HyperGraph will cancel maintenance operation when it is being open.
 boolean getSkipMaintenance()
          Return true if HyperGraph should skip scheduled maintenance operations when it is open.
 long getStoreCacheSize()
           Return the size (in bytes) of the cache used by the storage layer.
 boolean isTransactional()
           true if the database is configured to support transactions and false otherwise.
 void resetDefaults()
          Set all parameters of this configuration to their default values.
 void setCancelMaintenance(boolean cancelMaintenance)
          Specify whether HyperGraph should cancel maintenance operation when it is being open.
 void setSkipMaintenance(boolean skipMaintenance)
          Specify whether HyperGraph should skip maintenance operation when it is being open.
 void setStoreCacheSize(long storeCacheSize)
           Set the size (in bytes) of the cache used by the storage layer.
 void setTransactional(boolean transactional)
           Specifies if the database should be opened in transactional mode which is the default mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STORE_CACHE

public static final long DEFAULT_STORE_CACHE
The default size in bytes of the storage (i.e. BerkeleyDB) cache = 20MB.

See Also:
Constant Field Values
Constructor Detail

HGConfiguration

public HGConfiguration()
Method Detail

resetDefaults

public void resetDefaults()

Set all parameters of this configuration to their default values.


isTransactional

public boolean isTransactional()

true if the database is configured to support transactions and false otherwise.

Returns:

setTransactional

public void setTransactional(boolean transactional)

Specifies if the database should be opened in transactional mode which is the default mode. Setting this flag to false should be done with care. It results in much faster operations (4-5 times faster), but it can result in an unrecoverable crash. In general this should be used when a lot of data is being loaded into a brand new, or a properly backed up beforehand, database.

Parameters:
transactional -

getStoreCacheSize

public long getStoreCacheSize()

Return the size (in bytes) of the cache used by the storage layer. The default value is DEFAULT_STORE_CACHE.

Returns:

setStoreCacheSize

public void setStoreCacheSize(long storeCacheSize)

Set the size (in bytes) of the cache used by the storage layer. The default value is DEFAULT_STORE_CACHE.

Parameters:
storeCacheSize -

getSkipMaintenance

public boolean getSkipMaintenance()

Return true if HyperGraph should skip scheduled maintenance operations when it is open. Return false otherwise.


setSkipMaintenance

public void setSkipMaintenance(boolean skipMaintenance)

Specify whether HyperGraph should skip maintenance operation when it is being open.


getCancelMaintenance

public boolean getCancelMaintenance()

Return true if HyperGraph will cancel maintenance operation when it is being open. Canceling maintenance operations will delete them so they'll never be run.


setCancelMaintenance

public void setCancelMaintenance(boolean cancelMaintenance)

Specify whether HyperGraph should cancel maintenance operation when it is being open. Canceling maintenance operations will delete them so they'll never be run.