←Older revision | Newer revision→
Smeta - modifies metadata information about SRB data objects.
Smeta -i -I metaAttrNameEqValue [ [-I metaAttrNameEqValue] ... ] dataName
Smeta -u metadataIndex metaAttrNameEqValue dataName
Smeta -d metadataIndex dataName
Smeta -c -i -I metaAttrNameEqValue [ [-I metaAttrNameEqValue] ... ] collectionName
Smeta -c -u metadataIndex metaAttrNameEqValue collectionName
Smeta -c -d [metadataIndex | -1] collectionName
Smeta [-R] [-I metaAttrNameOrCondition [-I metaAttrNameOrCondition] ...] [-Y n] [-L n] [-T dataType] dataName|collectionName
Smeta -c [-R] [-I metaAttrNameOrCondition [-I metaAttrNameOrCondition] ... ] [-Y n] [-L n] [-T dataType] [collectionName]
Smeta provides the facility for inserting, deleting, updating and accessing meta-data on data object dataName or collection collectionName.
Currently, we support ten string attributes for data objects visible as UDSMD0, UDSMD1, ... UDSMD9 and two integer attributes visible as UDIMD0 and UDIMD1. Similarly, we support ten string attributes for collections visible as UDSMD_COLL0, UDSMD_COLL1, ... UDSMD9_COLL and two integer attributes visible as UDIMD_COLL0 and UDIMD_COLL1. Note that the sets may increase over time per user requests. The names are generic with the idea that users remap them at the application level. Owners and users with 'all' access permission are permitted to insert, delete, and update the metadata. Users with 'read' permission can view the metadata.
For insertion, metaAttrNameEqValue is used to provide the metadata as a pair of meta-attribute name and value conjoined with '=' sign. When inserted, a new metadata row is created and a unique integral identifier metadataIndex is created. This identifier can be used during updates and deletion of specific rows of metadata.
When Querying, the user has two options for specifying the names of meta attributes: the meta-attribute name can be specified by itself in which case, the value for that name is retrieved, or a meta-attribute condition can be specified as a pair of meta-attribute name and value conjoined with conditional sign. Values can be numbers or single-quoted character strings with possible wild-card characters, * and ?. The conditions supported are =, >, <, >=, <=, <>, like, not like, in, not in, between and not between.
A user can query to discover datasets, using both collection and dataset metadata. When the 'c' option is used, discovery is limited only to collections, and metadata relevant to collections are only required. With the 'c' option, if collectionName is not given, then the search is made for all collections in the catalog.
- display command options
- insert meta-data
- update meta-data
- delete meta-data for a given metadataIndex. If -1 is used all metadata rows are deleted.
- defines that the insert, update, and deletes are for collection metadata; in query mode the option implies that only collections need to be displayed.
- recursively view meta-data under collectionName. If this option is not used then the meta-data is given for dataName (the value can have wild cards).
- dataType gets meta-data of particular data type (the value can have wild cards)
- [number] controls display format. Without -Y, information is displayed one item-per-line with each attribute spaced at DEFAULT_FIELD_WIDTH characters. With -Y 0 will display in vertical, one attribute-per-line format. With Y n, n > 0, information is displayed one item-per-line with each attribute spaced at number characters. With Y -1, information is displayed without headers, with each item quoted and separated by a blank and with no row control.
- [number] controls number of items displayed at a time under user's control. Without -L, DEFAULT_ROW_COUNT items of information is displayed at a time. With L n, n > 0, n items are displayed at a time.
Insert a new set of metadata for the dataObject foo.txt in current collection:
Smeta -i -I UDSMD1=abcedeff -I UDSMD5 = 'rrrr' -I UDIMD1=5577 foo.txt
Insert another set of metadata for the same object:
Smeta -i -I UDIMD0=2222 -I UDIMD1=5555 foo.txt
Display all the metadata for the object:
Display all the metadata for all objects in current collection:
Delete metadata for the object which has the metadata index = 1 (all sets of metadata for an object are given integral numbers for identification):
Smeta -d 1 foo.txt
Update the value of the 7th string metadata for the object:
Smeta -u 0 UDSMD6='trert' foo.txt
Display the first and second string metadata for all objects in the collection where the second metadata has a 'c' (possibly later) followed by 'e':
Smeta -I UDSMD1 like '*c*e*' -I UDSMD0 .
Currently there is no access control on metadata.