public class DefaultMetadataStore extends Object implements MetadataStore
MetadataStore used in distributed mode.| Modifier and Type | Field and Description |
|---|---|
static Id.DatasetInstance |
BUSINESS_METADATA_INSTANCE_ID |
| Modifier and Type | Method and Description |
|---|---|
void |
addTags(MetadataScope scope,
Id.NamespacedId entityId,
String... tagsToAdd)
Adds tags for the specified
Id.NamespacedId. |
Set<MetadataRecord> |
getMetadata(Id.NamespacedId entityId) |
MetadataRecord |
getMetadata(MetadataScope scope,
Id.NamespacedId entityId) |
Set<MetadataRecord> |
getMetadata(MetadataScope scope,
Set<Id.NamespacedId> entityIds) |
Map<String,String> |
getProperties(Id.NamespacedId entityId) |
Map<String,String> |
getProperties(MetadataScope scope,
Id.NamespacedId entityId) |
Set<MetadataRecord> |
getSnapshotBeforeTime(MetadataScope scope,
Set<Id.NamespacedId> entityIds,
long timeMillis)
Returns the snapshot of the metadata for entities on or before the given time in the specified
MetadataScope. |
Set<MetadataRecord> |
getSnapshotBeforeTime(Set<Id.NamespacedId> entityIds,
long timeMillis)
Returns the snapshot of the metadata for entities on or before the given time in both
MetadataScope.USER
and MetadataScope.SYSTEM. |
Set<String> |
getTags(Id.NamespacedId entityId) |
Set<String> |
getTags(MetadataScope scope,
Id.NamespacedId entityId) |
void |
removeMetadata(Id.NamespacedId entityId)
Removes all metadata (including properties and tags) for the specified
Id.NamespacedId in both
MetadataScope.USER and MetadataScope.SYSTEM. |
void |
removeMetadata(MetadataScope scope,
Id.NamespacedId entityId)
Removes all metadata (including properties and tags) for the specified
Id.NamespacedId. |
void |
removeProperties(MetadataScope scope,
Id.NamespacedId entityId)
Removes all properties for the specified
Id.NamespacedId. |
void |
removeProperties(MetadataScope scope,
Id.NamespacedId entityId,
String... keys)
Removes the specified properties of the
Id.NamespacedId. |
void |
removeTags(MetadataScope scope,
Id.NamespacedId entityId)
Removes all the tags from the
Id.NamespacedId |
void |
removeTags(MetadataScope scope,
Id.NamespacedId entityId,
String... tagsToRemove)
Removes the specified tags from the
Id.NamespacedId |
Set<MetadataSearchResultRecord> |
searchMetadata(MetadataScope scope,
String namespaceId,
String searchQuery)
Search the Metadata Dataset in the specified
MetadataScope. |
Set<MetadataSearchResultRecord> |
searchMetadata(String namespaceId,
String searchQuery)
Search the Metadata Dataset in both
MetadataScope.USER and MetadataScope.SYSTEM. |
Set<MetadataSearchResultRecord> |
searchMetadataOnType(MetadataScope scope,
String namespaceId,
String searchQuery,
MetadataSearchTargetType type)
Search the Metadata Dataset for the specified target type in the specified
MetadataScope. |
Set<MetadataSearchResultRecord> |
searchMetadataOnType(String namespaceId,
String searchQuery,
MetadataSearchTargetType type)
Search the Metadata Dataset for the specified target type in both
MetadataScope.USER and
MetadataScope.SYSTEM. |
void |
setProperties(MetadataScope scope,
Id.NamespacedId entityId,
Map<String,String> properties)
Adds/updates properties for the specified
Id.NamespacedId in the specified MetadataScope. |
void |
setProperties(MetadataScope scope,
Id.NamespacedId entityId,
Map<String,String> properties,
Indexer indexer)
Adds/updates metadata for the specified
Id.NamespacedId. |
static void |
setupDatasets(DatasetFramework framework)
Adds datasets and types to the given
DatasetFramework. |
void |
upgrade()
Upgrades the
MetadataStore |
public static final Id.DatasetInstance BUSINESS_METADATA_INSTANCE_ID
public void setProperties(MetadataScope scope, Id.NamespacedId entityId, Map<String,String> properties)
MetadataStoreId.NamespacedId in the specified MetadataScope.setProperties in interface MetadataStorescope - the MetadataScope to add/update the properties inentityId - the Id.NamespacedId to add the properties toproperties - the properties to add/updatepublic void setProperties(MetadataScope scope, Id.NamespacedId entityId, Map<String,String> properties, @Nullable Indexer indexer)
Id.NamespacedId.setProperties in interface MetadataStorescope - the MetadataScope to add/update the properties inentityId - the Id.NamespacedId to add the properties toproperties - the properties to add/updateindexer - Indexer to use for creating indexespublic void addTags(MetadataScope scope, Id.NamespacedId entityId, String... tagsToAdd)
Id.NamespacedId.addTags in interface MetadataStorescope - the MetadataScope to add the tags inentityId - the Id.NamespacedId to add the tags totagsToAdd - the tags to addpublic Set<MetadataRecord> getMetadata(Id.NamespacedId entityId)
getMetadata in interface MetadataStoreMetadataRecord representing all the metadata (including properties and tags) for the
specified Id.NamespacedId in both MetadataScope.USER and MetadataScope.SYSTEM.public MetadataRecord getMetadata(MetadataScope scope, Id.NamespacedId entityId)
getMetadata in interface MetadataStoreMetadataRecord representing all the metadata (including properties and tags) for the specified
Id.NamespacedId in the specified MetadataScope.public Set<MetadataRecord> getMetadata(MetadataScope scope, Set<Id.NamespacedId> entityIds)
getMetadata in interface MetadataStoreMetadataRecords representing all the metadata (including properties and tags)
for the specified set of Id.NamespacedIds.public Map<String,String> getProperties(Id.NamespacedId entityId)
getProperties in interface MetadataStoreId.NamespacedId in both MetadataScope.USER and
MetadataScope.SYSTEMpublic Map<String,String> getProperties(MetadataScope scope, Id.NamespacedId entityId)
getProperties in interface MetadataStoreId.NamespacedIdpublic Set<String> getTags(Id.NamespacedId entityId)
getTags in interface MetadataStoreId.NamespacedId in both MetadataScope.USER and
MetadataScope.SYSTEMpublic Set<String> getTags(MetadataScope scope, Id.NamespacedId entityId)
getTags in interface MetadataStoreId.NamespacedIdpublic void removeMetadata(Id.NamespacedId entityId)
MetadataStoreId.NamespacedId in both
MetadataScope.USER and MetadataScope.SYSTEM.removeMetadata in interface MetadataStoreentityId - the Id.NamespacedId to remove all metadata forpublic void removeMetadata(MetadataScope scope, Id.NamespacedId entityId)
Id.NamespacedId.removeMetadata in interface MetadataStorescope - the MetadataScopeentityId - the Id.NamespacedId to remove all metadata forpublic void removeProperties(MetadataScope scope, Id.NamespacedId entityId)
Id.NamespacedId.removeProperties in interface MetadataStorescope - the MetadataScopeentityId - the Id.NamespacedId to remove all properties forpublic void removeProperties(MetadataScope scope, Id.NamespacedId entityId, String... keys)
Id.NamespacedId.removeProperties in interface MetadataStorescope - the MetadataScopeentityId - the Id.NamespacedId to remove the specified keys forkeys - the keys to removepublic void removeTags(MetadataScope scope, Id.NamespacedId entityId)
Id.NamespacedIdremoveTags in interface MetadataStorescope - the MetadataScopeentityId - the Id.NamespacedId to remove all tags forpublic void removeTags(MetadataScope scope, Id.NamespacedId entityId, String... tagsToRemove)
Id.NamespacedIdremoveTags in interface MetadataStorescope - the MetadataScopeentityId - the Id.NamespacedId to remove the specified tags fortagsToRemove - the tags to removepublic Set<MetadataSearchResultRecord> searchMetadata(String namespaceId, String searchQuery)
MetadataStoreMetadataScope.USER and MetadataScope.SYSTEM.searchMetadata in interface MetadataStorepublic Set<MetadataSearchResultRecord> searchMetadata(MetadataScope scope, String namespaceId, String searchQuery)
MetadataStoreMetadataScope.searchMetadata in interface MetadataStorescope - the MetadataScope to restrict the search tonamespaceId - the namespace to search insearchQuery - the search query, which could be of two forms: [key]:[value] or just [value]public Set<MetadataSearchResultRecord> searchMetadataOnType(String namespaceId, String searchQuery, MetadataSearchTargetType type)
MetadataStoreMetadataScope.USER and
MetadataScope.SYSTEM.searchMetadataOnType in interface MetadataStorenamespaceId - the namespace to search insearchQuery - the search query, which could be of two forms: [key]:[value] or just [value]type - the MetadataSearchTargetType to restrict the search topublic Set<MetadataSearchResultRecord> searchMetadataOnType(MetadataScope scope, String namespaceId, String searchQuery, MetadataSearchTargetType type)
MetadataStoreMetadataScope.searchMetadataOnType in interface MetadataStorescope - the MetadataScope to restrict the search tonamespaceId - the namespace to search insearchQuery - the search query, which could be of two forms: [key]:[value] or just [value]type - the MetadataSearchTargetType to restrict the search topublic Set<MetadataRecord> getSnapshotBeforeTime(Set<Id.NamespacedId> entityIds, long timeMillis)
MetadataStoreMetadataScope.USER
and MetadataScope.SYSTEM.getSnapshotBeforeTime in interface MetadataStoreentityIds - entity idstimeMillis - time in millisecondspublic Set<MetadataRecord> getSnapshotBeforeTime(MetadataScope scope, Set<Id.NamespacedId> entityIds, long timeMillis)
MetadataStoreMetadataScope.getSnapshotBeforeTime in interface MetadataStorescope - the MetadataScope to get the snapshot inentityIds - entity idstimeMillis - time in millisecondspublic static void setupDatasets(DatasetFramework framework) throws IOException, DatasetManagementException
DatasetFramework. Used by the upgrade tool to upgrade Metadata
Datasets.framework - Dataset framework to add types and datasets toIOExceptionDatasetManagementExceptionpublic void upgrade()
MetadataStoreMetadataStoreupgrade in interface MetadataStoreCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.