| java.lang.Object org.griphyn.vdl.dbschema.DatabaseSchema org.griphyn.vdl.dbschema.InMemorySchema
All known Subclasses: org.griphyn.vdl.dbschema.SingleFileSchema,
InMemorySchema | public class InMemorySchema extends DatabaseSchema implements VDC(Code) | | This is a class that falls back not on a real database backend,
but rather on an existing Definitions data structure in main
memory. This schema is for internal use only.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: org.griphyn.vdl.dbdriver See Also: org.griphyn.vdl.classes.Definitions |
Field Summary | |
protected Definitions | m_memory Stores a reference to the in-memory data structure that hold
all definitions that we can access from within this instance. |
Method Summary | |
public Definitions | backdoor() Dirty hack: Returns a reference to the in-memory database for
preliminary routing into DAXes. | public boolean | cachingMakesSense() Pass-thru to driver. | public boolean | containsDefinition(Definition definition) Check with the backend database, if the given definition exists. | public boolean | deleteDefinition(Definition definition) Delete a specific Definition objects from the database. | public java.util.List | deleteDefinition(String namespace, String name, String version, int type) Delete one or more definitions from the backend database. | public Definition | loadDefinition(String namespace, String name, String version, int type) Loads a single Definition from the backend database into an Java object.
This method does not allow wildcarding!
Parameters: namespace - namespace, null will be converted into empty string Parameters: name - name, null will be converted into empty string Parameters: version - version, null will be converted into empty string Parameters: type - type of the definition (TR or DV), must not be -1. | public boolean | saveDefinition(Definition definition, boolean overwrite) Saves a Definition, that is either a Transformation or Derivation,
into the backend database. | protected boolean | scalarContainsLfn(Scalar scalar, String lfn, int link) This helper function checks, if a given Scalar instance
contains the specified logical filename as LFN instance anywhere
in its sub-structures.
Parameters: scalar - is a Scalar instance to check Parameters: lfn - is a logical filename string to check for Parameters: link - is the linkage type of the lfn. | public java.util.List | searchDefinition(String namespace, String name, String version, int type) Search the database for definitions by ns::name:version triple
and by type (either Transformation or Derivation). | public java.util.List | searchFilename(String lfn, int link) Searches the database for all derivations that contain a certain LFN.
The linkage is an additional constraint. |
m_memory | protected Definitions m_memory(Code) | | Stores a reference to the in-memory data structure that hold
all definitions that we can access from within this instance.
|
InMemorySchema | protected InMemorySchema()(Code) | | Default ctor does nothing.
|
backdoor | public Definitions backdoor()(Code) | | Dirty hack: Returns a reference to the in-memory database for
preliminary routing into DAXes. This is to avoid the duplication
of DVs in memory, as memory becomes quickly a scarce resource.
a reference to the in-memory database. |
cachingMakesSense | public boolean cachingMakesSense()(Code) | | Pass-thru to driver. Always returns false, as the backend is
main memory.
true, if it is feasible to cache results from the driverfalse, if requerying the driver is sufficiently fast (e.g. driveris in main memory, or driver does caching itself). |
containsDefinition | public boolean containsDefinition(Definition definition) throws SQLException(Code) | | Check with the backend database, if the given definition exists.
Parameters: definition - is a Definition object to search for true, if the Definition exists, false if not found |
loadDefinition | public Definition loadDefinition(String namespace, String name, String version, int type) throws SQLException(Code) | | Loads a single Definition from the backend database into an Java object.
This method does not allow wildcarding!
Parameters: namespace - namespace, null will be converted into empty string Parameters: name - name, null will be converted into empty string Parameters: version - version, null will be converted into empty string Parameters: type - type of the definition (TR or DV), must not be -1. the Definition as specified, or null if not found. See Also: org.griphyn.vdl.classes.Definition.TRANSFORMATION See Also: org.griphyn.vdl.classes.Definition.DERIVATION See Also: InMemorySchema.saveDefinition(Definition,boolean) See Also: InMemorySchema.searchDefinition(String,String,String,int) |
saveDefinition | public boolean saveDefinition(Definition definition, boolean overwrite) throws SQLException(Code) | | Saves a Definition, that is either a Transformation or Derivation,
into the backend database.
Parameters: definition - is the new Definition to store. Parameters: overwrite - true, if existing defitions will be overwritten bynew ones with the same primary (or secondary) key (-set), or false,if a new definition will be rejected on key matches. true, if the backend database was changed, orfalse, if the definition was not accepted into the backend. See Also: org.griphyn.vdl.classes.Definition See Also: org.griphyn.vdl.classes.Transformation See Also: org.griphyn.vdl.classes.Derivation See Also: InMemorySchema.loadDefinition(String,String,String,int) See Also: InMemorySchema.deleteDefinition(String,String,String,int) See Also: |
scalarContainsLfn | protected boolean scalarContainsLfn(Scalar scalar, String lfn, int link)(Code) | | This helper function checks, if a given Scalar instance
contains the specified logical filename as LFN instance anywhere
in its sub-structures.
Parameters: scalar - is a Scalar instance to check Parameters: lfn - is a logical filename string to check for Parameters: link - is the linkage type of the lfn. if -1, do not check the linkage type. true, if the file was found |
searchDefinition | public java.util.List searchDefinition(String namespace, String name, String version, int type) throws SQLException(Code) | | Search the database for definitions by ns::name:version triple
and by type (either Transformation or Derivation). This version
of the search allows for jokers expressed as null value.
This method is not implemented!
Parameters: namespace - namespace, null to match any namespace Parameters: name - name, null to match any name Parameters: version - version, null to match any version Parameters: type - type of definition, see below, or -1 as wildcard a list of Definition items, which may be empty See Also: org.griphyn.vdl.classes.Definition.TRANSFORMATION See Also: org.griphyn.vdl.classes.Definition.DERIVATION See Also: InMemorySchema.loadDefinition(String,String,String,int) |
Methods inherited from org.griphyn.vdl.dbschema.DatabaseSchema | public boolean cachingMakesSense()(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public static DatabaseSchema loadSchema(String dbSchemaName, String propertyPrefix, Object[] arguments) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException(Code)(Java Doc) public static DatabaseSchema loadSchema(String propertyPrefix) throws ClassNotFoundException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException(Code)(Java Doc) protected void longOrNull(PreparedStatement ps, int pos, long l) throws SQLException(Code)(Java Doc) protected String makeNotNull(String s)(Code)(Java Doc) protected void stringOrNull(PreparedStatement ps, int pos, String s) throws SQLException(Code)(Java Doc)
|
|
|