|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.bnl.star.offline.scheduler.CatalogQuery
public class CatalogQuery
Encapsulate a query to the file catalog. This class is a wrapper around a URI that describes a file catalog query. The syntax of the URI is:
catalog:catalogName?query
catalogName is the name that identifies the catalog that should resolve the query. If can be directly a machine name, or a more abstract name that can be resolved to a specific machine at a later time.
query is the actual query to pass to the catalog. The syntax of the query is the one defined by the perl interface.
Different counting methods can be used. By counting methods, we mean the method used by the query resolver to decide how many and which records to return. Right now, two methods are supported:
START-LIMIT, which maps directly to the SQL START LIMIT definition. One can think the result returned as a view on the total result. Basically, only the records between start and start+limit are returned. By executing the same query with a different start, one can view all the result a chunk at a time.
NFILES, which returns a given number of files (that is of records) in no particular order. The query resolver is allowed to return whatever files it decides. This allows the query resolver to perform optimizations.
Field Summary | |
---|---|
static int |
NFILES_COUNTING
The method to specify how many records to return is by returning the specified number of valid records. |
static int |
NO_COUNTING
No method for determine how long the result should be was specified. |
static int |
START_LIMIT_COUNTING
The method to specify how many records to return is the SQL START and LIMIT model. |
Constructor Summary | |
---|---|
CatalogQuery()
|
|
CatalogQuery(CatalogQuery query)
Creates a copy of a given query. |
|
CatalogQuery(java.lang.String uri)
Creates a query to the file catalog. |
Method Summary | |
---|---|
void |
addToEventsReturned(int eventsReturned)
|
void |
filesReturned()
|
java.util.List |
getAttributes()
Getter for property attributes. |
java.lang.String |
getCatalogName()
Returns the catalog to which the query should be sent. |
int |
getCountingType()
Returns the counting method used to decide how many records the query should return. |
int |
getEventsReturned()
|
int |
getFilesReturned()
|
java.lang.Integer |
getLimit()
Returns the number of records this query should return. |
java.lang.Integer |
getNFiles()
Returns the number of files the query should return. |
java.lang.String |
getPreferStorage()
Tells which copy is preferred in case more than one copy for the same file is found. |
java.lang.String |
getQuery()
Returns the query to be passed to the file catalog. |
java.lang.Integer |
getStart()
Returns the first element to be returned. |
boolean |
isSingleCopy()
Tells whether single copy or multiple copies for the same file should be returned. |
void |
setAttributes(java.util.List attributes)
Setter for property attributes. |
void |
setEventsReturned(int eventsReturned)
|
void |
setFilesReturned(int filesReturned)
|
void |
setLimit(java.lang.Integer limit)
Sets the number of records this query should return. |
void |
setNFiles(java.lang.Integer nFiles)
Sets the number of files the query should return. |
void |
setPreferStorage(java.lang.String preferStorage)
Sets which copy is preferred in case of more than one copy for the same file is found. |
void |
setSingleCopy(boolean singleCopy)
Sets whether single copy or multiple copies for the same file should be returned. |
void |
setStart(java.lang.Integer start)
Sets the first element to be returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_COUNTING
public static final int START_LIMIT_COUNTING
public static final int NFILES_COUNTING
Constructor Detail |
---|
public CatalogQuery(java.lang.String uri)
catalog:catalogName?query
catalogName
defines which catalog to look. For example,
star.bnl.gov specifies the STAR catalog.
query
is the query that will be used to search for the entry. The
exact syntax is specified by the catalog itself. For STAR, it
is a series of comma separated assignments between keywords and values.
uri
- specifies the full uri: ex. catalog:star.bnl.gov:collision=AuAu200,storage=local
public CatalogQuery(CatalogQuery query)
query
- the query to be copiedpublic CatalogQuery()
Method Detail |
---|
public int getEventsReturned()
public void setEventsReturned(int eventsReturned)
public void addToEventsReturned(int eventsReturned)
public int getFilesReturned()
public void setFilesReturned(int filesReturned)
public void filesReturned()
public java.lang.String getCatalogName()
This method is provided for forward compatibility and is not actually used
public java.lang.String getQuery()
public java.lang.Integer getLimit()
public void setLimit(java.lang.Integer limit)
limit
- number of files returned by the querypublic java.lang.Integer getStart()
public void setStart(java.lang.Integer start)
start
- row of the first element to be returnedpublic boolean isSingleCopy()
public java.lang.String getPreferStorage()
public void setPreferStorage(java.lang.String preferStorage)
preferStorage
- a String representing a storage (es. "local", "NFS", ... )public void setSingleCopy(boolean singleCopy)
singleCopy
- true if the query should return only one copy for each file in the catalogpublic java.lang.Integer getNFiles()
public void setNFiles(java.lang.Integer nFiles)
nFiles
- the number of files to be returned by the query.public int getCountingType()
public java.util.List getAttributes()
public void setAttributes(java.util.List attributes)
attributes
- New value of property attributes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |