public final class HGConfiguration extends 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.
Constructor and Description |
---|
HGConfiguration() |
Modifier and Type | Method and Description |
---|---|
HGAtomCache |
getCacheImplementation()
Return the cache implementation configured for this
HyperGraph instance. |
boolean |
getCancelMaintenance()
Return true if HyperGraph will cancel maintenance operation when it is being open.
|
ClassLoader |
getClassLoader()
Return the configured Java class loader for use by this HyperGraphDB instance or
null if no loader was configured. |
HGEventManager |
getEventManager()
Return the
HGEventManager to be used by the database. |
HGHandleFactory |
getHandleFactory()
Return the handle factory configured for this database.
|
int |
getMaxCachedIncidenceSetSize()
Return the configured maximum size of atom incidence sets that are kept in
RAM.
|
boolean |
getPreventDanglingAtomReferences()
Return
true if the system should detect and throw an exception
when a possible invalid HGAtomRef occurs. |
HGQueryConfiguration |
getQueryConfiguration()
Return the
HGQueryConfiguration associated with the HyperGraph
instance. |
boolean |
getSkipMaintenance()
Return true if HyperGraph should skip scheduled maintenance operations when
it is open.
|
boolean |
getSkipOpenedEvent()
Return
true if the startup process should NOT
fire a HGOpenedEvent so none of the registered listeners will
be triggered. |
HGStoreImplementation |
getStoreImplementation()
Return the low-level storage implementation to be used for this
database instance.
|
HGTypeConfiguration |
getTypeConfiguration()
Return the configuration bean for the type system.
|
boolean |
isKeepIncidentLinksOnRemoval()
Return
true if links incident to an atom are kept in the database
when that atom is being removed through the HyperGraph.remove(HGHandle) method
and false otherwise. |
boolean |
isTransactional()
true if the database is configured to support transactions and false
otherwise. |
boolean |
isUseSystemAtomAttributes()
Return
true (the default) if system-level atom attributes are
stored and false otherwise. |
void |
resetDefaults()
Set all parameters of this configuration to their default values.
|
void |
setCacheImplementation(HGAtomCache cacheImplementation)
Configure a cache implementation to be used for this
HyperGraph instance. |
void |
setCancelMaintenance(boolean cancelMaintenance)
Specify whether HyperGraph should cancel maintenance operation when it is being open.
|
void |
setClassLoader(ClassLoader classLoader)
Configure a
ClassLoader for this HyperGraphDB instance. |
void |
setEventManager(HGEventManager eventManager)
Specify the
HGEventManager to be used by the database. |
void |
setHandleFactory(HGHandleFactory handleFactory)
Set the persistent handle factory for this database.
|
void |
setKeepIncidentLinksOnRemoval(boolean keepIncidentLinksOnRemoval)
Specify whether links incident to an atom are kept in the database
when that atom is being removed through the
HyperGraph.remove(HGHandle) method. |
void |
setMaxCachedIncidenceSetSize(int maxCachedIncidenceSetSize)
Set the configured maximum size of atom incidence sets that are kept in
RAM.
|
void |
setPreventDanglingAtomReferences(boolean preventDanglingAtomReferences)
Specify whether the system should detect and throw an exception
when a possible invalid
HGAtomRef occurs. |
void |
setSkipMaintenance(boolean skipMaintenance)
Specify whether HyperGraph should skip maintenance operation when it is being open.
|
void |
setSkipOpenedEvent(boolean skipOpenedEvent)
Specify whether the startup process should NOT
fire a
HGOpenedEvent so none of the registered listeners will
be triggered. |
void |
setStoreImplementation(HGStoreImplementation storeImplementation)
Specify the low-level storage implementation to be used for this database instance.
|
void |
setTransactional(boolean transactional)
Specifies if the database should be opened in transactional mode which is the default
mode.
|
void |
setUseSystemAtomAttributes(boolean useSystemAtomAttributes)
Specify whether system-level atom attributes are
stored - the default is
true . |
public HGHandleFactory getHandleFactory()
Return the handle factory configured for this database. If no factory has been explicitly configured, a default implementation based on UUIDs is provided.
public void setHandleFactory(HGHandleFactory handleFactory)
Set the persistent handle factory for this database.
handleFactory
- The handle factory instance.public HGStoreImplementation getStoreImplementation()
Return the low-level storage implementation to be used for this database instance.
public void setStoreImplementation(HGStoreImplementation storeImplementation)
Specify the low-level storage implementation to be used for this database instance.
storeImplementation
- public void resetDefaults()
Set all parameters of this configuration to their default values.
public boolean isTransactional()
true
if the database is configured to support transactions and false
otherwise.
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.
Note that being transactional is not a property of the database instance, but rather of the current interaction session.
transactional
- public boolean getSkipMaintenance()
Return true if HyperGraph should skip scheduled maintenance operations when it is open. Return false otherwise.
public void setSkipMaintenance(boolean skipMaintenance)
Specify whether HyperGraph should skip maintenance operation when it is being open.
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.
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.
public boolean getSkipOpenedEvent()
Return true
if the startup process should NOT
fire a HGOpenedEvent
so none of the registered listeners will
be triggered.
public void setSkipOpenedEvent(boolean skipOpenedEvent)
Specify whether the startup process should NOT
fire a HGOpenedEvent
so none of the registered listeners will
be triggered. This is useful whenever a HyperGraphDB instance should be
opened "merely" for examining/querying data and user-defined bootstrap
operations are to be skipped.
Note that setting this flag to true
is meaningful only
when you have defined one or more listeners to the HGOpenedEvent
.
For example, a brand new HyperGraphDB instance will not have any such
listeners defined.
public int getMaxCachedIncidenceSetSize()
Return the configured maximum size of atom incidence sets that are kept in RAM. Small incidence sets are kept in a (usually MRU) cache, which significantly speeds up querying. This configuration options defines how small is "small". The default is 10000 - that is, incidence sets of 10000 or fewer elements are cached in RAM the first time they are accessed.
public void setMaxCachedIncidenceSetSize(int maxCachedIncidenceSetSize)
Set the configured maximum size of atom incidence sets that are kept in RAM. Small incidence sets are kept in a (usually MRU) cache, which significantly speeds up querying. This configuration options defines how small is "small". The default is 10000 - that is, incidence sets of 10000 or fewer elements are cached in RAM the first time they are accessed.
public boolean isUseSystemAtomAttributes()
true
(the default) if system-level atom attributes are
stored and false
otherwise. When false, this means that all system
facilities depending on the availability of those attributes are not available.public boolean getPreventDanglingAtomReferences()
Return true
if the system should detect and throw an exception
when a possible invalid HGAtomRef
occurs. This happens when when an atom
is being removed, but here's a HGAtomRef.Mode.hard
reference to it. The
default is true
.
public void setPreventDanglingAtomReferences(boolean preventDanglingAtomReferences)
Specify whether the system should detect and throw an exception
when a possible invalid HGAtomRef
occurs. This happens when when an atom
is being removed, but here's a HGAtomRef.Mode.hard
reference to it. The
default is true
.
public void setUseSystemAtomAttributes(boolean useSystemAtomAttributes)
true
. When false, this means that all system
facilities depending on the availability of those attributes are not available.public HGTypeConfiguration getTypeConfiguration()
Return the configuration bean for the type system.
public HGEventManager getEventManager()
Return the HGEventManager
to be used by the database. The default is an
instance of HGDefaultEventManager
.
public void setEventManager(HGEventManager eventManager)
Specify the HGEventManager
to be used by the database. The default is an
instance of HGDefaultEventManager
.
public boolean isKeepIncidentLinksOnRemoval()
Return true
if links incident to an atom are kept in the database
when that atom is being removed through the HyperGraph.remove(HGHandle)
method
and false
otherwise.
public void setKeepIncidentLinksOnRemoval(boolean keepIncidentLinksOnRemoval)
Specify whether links incident to an atom are kept in the database
when that atom is being removed through the HyperGraph.remove(HGHandle)
method.
public ClassLoader getClassLoader()
Return the configured Java class loader for use by this HyperGraphDB instance or
null
if no loader was configured.
public void setClassLoader(ClassLoader classLoader)
Configure a ClassLoader
for this HyperGraphDB instance. The class loader is most
importantly used by HGTypeSystem
when loading
Java classes based on the classname<->HGDB type
mapping. By default, the
type system will use the current thread's context class loader. Setting a custom
class loader overrides this behavior.
classLoader
- public HGQueryConfiguration getQueryConfiguration()
Return the HGQueryConfiguration
associated with the HyperGraph
instance.
public HGAtomCache getCacheImplementation()
Return the cache implementation configured for this HyperGraph
instance.
public void setCacheImplementation(HGAtomCache cacheImplementation)
Configure a cache implementation to be used for this HyperGraph
instance.
cacheImplementation
- Copyright © 2015. All rights reserved.