|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.dbschema.DatabaseSchema
org.griphyn.vdl.dbschema.ChunkSchema
public class ChunkSchema
This class provides basic functionalities to interact with the backend database, such as insertion, deletion, and search of entities in the VDC.
| Field Summary | |
|---|---|
protected static String[] |
c_lfn_names
Name of the four parameter tables in human readable format. |
protected Cache |
m_cache
A cache for definitions to avoid reloading from the database. |
protected boolean |
m_deferDeleteCommit
Communication between saveDefinition and deleteDefinition in update mode. |
private VDLxParser |
m_parser
An instance of the VDLx XML parser. |
| Fields inherited from class org.griphyn.vdl.dbschema.DatabaseSchema |
|---|
m_dbdriver, m_dbschemaprops |
| Fields inherited from interface org.griphyn.vdl.dbschema.VDC |
|---|
PROPERTY_PREFIX |
| Constructor Summary | |
|---|---|
ChunkSchema(String dbDriverName)
Default constructor for the "chunk" schema. |
|
| Method Summary | |
|---|---|
boolean |
containsDefinition(Definition definition)
Search the database for the existence of a definition. |
boolean |
deleteDefinition(Definition definition)
Delete a specific Definition objects from the database. |
List |
deleteDefinition(String namespace,
String name,
String version,
int type)
Delete Definition objects from the database. |
protected Long |
getDefinitionId(Definition d)
Obtains the primary key id for a given definition. |
protected List |
getDefinitionId(String namespace,
String name,
String version,
int type)
Obtains the list of primary key ids for a matching definitions. |
private Definition |
loadDefinition(long id)
Load a single Definition from the backend database into a Java object by its primary key id. |
Definition |
loadDefinition(String namespace,
String name,
String version,
int type)
Loads a single Definition from the backend database into an Java object. |
private VDLxParser |
parserInstance()
Instantiates an XML parser for VDLx on demand. |
boolean |
saveDefinition(Definition definition,
boolean overwrite)
Saves a Definition, that is either a Transformation or Derivation, into the backend database. |
private void |
saveScalar(long id,
Scalar scalar,
Set already,
PreparedStatement[] stmt,
int[] count)
Saves all logical filenames from a Scalar object. |
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). |
List |
searchFilename(String lfn,
int link)
Searches the database for all derivations that contain a certain LFN. |
private String |
what(Definition d)
Compiles the name of a DV/TR for log messages. |
| Methods inherited from class org.griphyn.vdl.dbschema.DatabaseSchema |
|---|
cachingMakesSense, close, finalize, loadSchema, loadSchema, longOrNull, makeNotNull, stringOrNull |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String[] c_lfn_names
protected boolean m_deferDeleteCommit
private VDLxParser m_parser
protected Cache m_cache
| Constructor Detail |
|---|
public ChunkSchema(String dbDriverName)
throws ClassNotFoundException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException,
InvocationTargetException,
SQLException,
IOException
dbDriverName - is the database driver name
ClassNotFoundException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
SQLException
IOException| Method Detail |
|---|
private VDLxParser parserInstance()
public Definition loadDefinition(String namespace,
String name,
String version,
int type)
throws SQLException
loadDefinition in interface VDCnamespace - namespace, null will be converted into empty stringname - name, null will be converted into empty stringversion - version, null will be converted into empty stringtype - type of the definition (TR or DV), must not be -1.
SQLExceptionDefinition.TRANSFORMATION,
Definition.DERIVATION,
saveDefinition( Definition, boolean )
private Definition loadDefinition(long id)
throws SQLException
id - is a long which represent the primary id.
SQLExceptionloadDefinition( String, String, String, int ),
saveDefinition( Definition, boolean )private String what(Definition d)
d - is a definition
public boolean saveDefinition(Definition definition,
boolean overwrite)
throws SQLException
saveDefinition in interface VDCdefinition - is the new Definition to store.overwrite - true, if existing defitions will be overwritten by
new ones with the same primary (or secondary) key (-set), or false,
if a new definition will be rejected on key matches.
SQLExceptionDefinition,
Transformation,
Derivation,
loadDefinition( String, String, String, int )
private void saveScalar(long id,
Scalar scalar,
Set already,
PreparedStatement[] stmt,
int[] count)
throws SQLException
id - is the definition id in the DEFINITION tablescalar - is a Scalar instance of which the LFNs are to be saved.already - is a set of filenames that were already added during
this sessionstmt - is an array of the ids of the prepared statements for
the different tables.count - count the number of entries in a prepared statement.
SQLExceptionsaveDefinition( Definition, boolean )
protected Long getDefinitionId(Definition d)
throws SQLException
d - is a definition specification.
SQLExceptiongetDefinitionId( String, String, String, int )
protected List getDefinitionId(String namespace,
String name,
String version,
int type)
throws SQLException
namespace - namespace, null to match any namespacename - name, null to match any nameversion - version, null to match any versiontype - definition type (TR or DV)
SQLExceptionDefinition.TRANSFORMATION,
Definition.DERIVATION,
getDefinitionId( Definition )
public boolean containsDefinition(Definition definition)
throws SQLException
containsDefinition in interface VDCdefinition - the definition object to search for
SQLException
public boolean deleteDefinition(Definition definition)
throws SQLException
deleteDefinition in interface VDCdefinition - is the definition specification to delete
SQLExceptionDefinition.TRANSFORMATION,
Definition.DERIVATION
public List deleteDefinition(String namespace,
String name,
String version,
int type)
throws SQLException
deleteDefinition in interface VDCnamespace - namespace, null to match any namespacename - name, null to match any nameversion - version, null to match any versiontype - definition type (TR or DV)
SQLExceptionDefinition.TRANSFORMATION,
Definition.DERIVATION
public List searchDefinition(String namespace,
String name,
String version,
int type)
throws SQLException
searchDefinition in interface VDCnamespace - namespace, null to match any namespacename - name, null to match any nameversion - version, null to match any versiontype - type of definition (TR/DV, or both)
SQLExceptionDefinition.TRANSFORMATION,
Definition.DERIVATION
public List searchFilename(String lfn,
int link)
throws SQLException
searchFilename in interface VDClfn - the LFN namelink - the linkage type of the LFN
SQLExceptionLFN.NONE,
LFN.INPUT,
LFN.OUTPUT,
LFN.INOUT
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||