public class MetadataNode extends Object implements IMetadataNode
| Modifier and Type | Field and Description |
|---|---|
static MetadataNode |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction(JobId jobId)
Aborts a local transaction against the metadata.
|
void |
addAdapter(JobId jobId,
DatasourceAdapter adapter) |
void |
addCompactionPolicy(JobId jobId,
CompactionPolicy compactionPolicy) |
void |
addDataset(JobId jobId,
Dataset dataset)
Inserts a new dataset into the metadata, acquiring local locks on behalf
of the given transaction id.
|
void |
addDatatype(JobId jobId,
Datatype datatype)
Inserts a datatype, acquiring local locks on behalf of the given
transaction id.
|
void |
addDataverse(JobId jobId,
Dataverse dataverse)
Inserts a new dataverse into the metadata, acquiring local locks on
behalf of the given transaction id.
|
void |
addExternalFile(JobId jobId,
ExternalFile externalFile) |
void |
addFeed(JobId jobId,
Feed feed) |
void |
addFeedPolicy(JobId jobId,
FeedPolicy feedPolicy) |
void |
addFunction(JobId jobId,
Function function) |
void |
addIndex(JobId jobId,
Index index)
Inserts an index into the metadata, acquiring local locks on behalf of
the given transaction id.
|
void |
addLibrary(JobId jobId,
Library library)
Adds a library, acquiring local locks on behalf of the given
transaction id.
|
void |
addNode(JobId jobId,
Node node)
Inserts a node (compute node), acquiring local locks on behalf of the
given transaction id.
|
void |
addNodeGroup(JobId jobId,
NodeGroup nodeGroup)
Inserts a node group, acquiring local locks on behalf of the given
transaction id.
|
void |
beginTransaction(JobId transactionId)
Begins a local transaction against the metadata.
|
void |
commitTransaction(JobId jobId)
Commits a local transaction against the metadata.
|
org.apache.hyracks.dataflow.common.data.accessors.ITupleReference |
createExternalFileSearchTuple(String dataverseName,
String datasetName,
int fileNumber) |
org.apache.hyracks.dataflow.common.data.accessors.ITupleReference |
createTuple(String... fields) |
void |
dropAdapter(JobId jobId,
String dataverseName,
String adapterName)
Deletes a adapter , acquiring local locks on behalf of the given
transaction id.
|
void |
dropDataset(JobId jobId,
String dataverseName,
String datasetName)
Deletes the dataset with given name, and all it's associated indexes,
acquiring local locks on behalf of the given transaction id.
|
void |
dropDatatype(JobId jobId,
String dataverseName,
String datatypeName)
Deletes the given datatype in given dataverse, acquiring local locks on
behalf of the given transaction id.
|
void |
dropDataverse(JobId jobId,
String dataverseName)
Deletes the dataverse with given name, and all it's associated datasets,
indexes, and types, acquiring local locks on behalf of the given
transaction id.
|
void |
dropExternalFile(JobId jobId,
String dataverseName,
String datasetName,
int fileNumber)
Deletes an externalFile , acquiring local locks on behalf of the given
transaction id.
|
void |
dropExternalFiles(JobId jobId,
Dataset dataset)
Deletes all external files belonging to a dataset, acquiring local locks on behalf of the given
transaction id.
|
void |
dropFeed(JobId jobId,
String dataverse,
String feedName) |
void |
dropFeedPolicy(JobId jobId,
String dataverseName,
String policyName)
delete a give feed (ingestion) policy
|
void |
dropFunction(JobId jobId,
FunctionSignature functionSignature)
Deletes a function, acquiring local locks on behalf of the given
transaction id.
|
void |
dropIndex(JobId jobId,
String dataverseName,
String datasetName,
String indexName)
Deletes the index with given name, in given dataverse and dataset,
acquiring local locks on behalf of the given transaction id.
|
void |
dropLibrary(JobId jobId,
String dataverseName,
String libraryName)
Removes a library , acquiring local locks on behalf of the given
transaction id.
|
void |
dropNodegroup(JobId jobId,
String nodeGroupName)
Deletes a node group, acquiring local locks on behalf of the given
transaction id.
|
DatasourceAdapter |
getAdapter(JobId jobId,
String dataverseName,
String adapterName) |
CompactionPolicy |
getCompactionPolicy(JobId jobId,
String dataverse,
String policyName) |
Dataset |
getDataset(JobId jobId,
String dataverseName,
String datasetName)
Retrieves a dataset within a given dataverse, acquiring local locks on
behalf of the given transaction id.
|
List<Index> |
getDatasetIndexes(JobId jobId,
String dataverseName,
String datasetName)
Retrieves all indexes of a dataset, acquiring local locks on behalf of
the given transaction id.
|
List<String> |
getDatasetNamesPartitionedOnThisNodeGroup(JobId jobId,
String nodegroup) |
Datatype |
getDatatype(JobId jobId,
String dataverseName,
String datatypeName)
Retrieves the datatype with given name in given dataverse, acquiring
local locks on behalf of the given transaction id.
|
List<String> |
getDatatypeNamesUsingThisDatatype(JobId jobId,
String dataverseName,
String datatypeName) |
Dataverse |
getDataverse(JobId jobId,
String dataverseName)
Retrieves a dataverse with given name, acquiring local locks on behalf of
the given transaction id.
|
List<DatasourceAdapter> |
getDataverseAdapters(JobId jobId,
String dataverseName) |
List<Dataset> |
getDataverseDatasets(JobId jobId,
String dataverseName)
Retrieves all datasets belonging to the given dataverse, acquiring local
locks on behalf of the given transaction id.
|
List<Feed> |
getDataverseFeeds(JobId jobId,
String dataverseName) |
List<Function> |
getDataverseFunctions(JobId jobId,
String dataverseName) |
List<Library> |
getDataverseLibraries(JobId jobId,
String dataverseName)
Retireve libraries installed in a given dataverse.
|
List<FeedPolicy> |
getDataversePolicies(JobId jobId,
String dataverse) |
List<Dataverse> |
getDataverses(JobId jobId)
Retrieves all dataverses, acquiring local locks on behalf of
the given transaction id.
|
ExternalFile |
getExternalFile(JobId jobId,
String dataverseName,
String datasetName,
Integer fileNumber)
Retrieves the file with given number, in given dataverse and dataset,
acquiring local locks on behalf of the given transaction id.
|
List<ExternalFile> |
getExternalFiles(JobId jobId,
Dataset dataset) |
Feed |
getFeed(JobId jobId,
String dataverse,
String feedName) |
FeedPolicy |
getFeedPolicy(JobId jobId,
String dataverse,
String policyName) |
Function |
getFunction(JobId jobId,
FunctionSignature functionSignature) |
Index |
getIndex(JobId jobId,
String dataverseName,
String datasetName,
String indexName)
Retrieves the index with given name, in given dataverse and dataset,
acquiring local locks on behalf of the given transaction id.
|
Library |
getLibrary(JobId jobId,
String dataverseName,
String libraryName) |
int |
getMostRecentDatasetId() |
NodeGroup |
getNodeGroup(JobId jobId,
String nodeGroupName)
Retrieves a node group, acquiring local locks on behalf of the given
transaction id.
|
void |
initialize(IAsterixAppRuntimeContext runtimeContext) |
void |
initializeDatasetIdFactory(JobId jobId) |
void |
insertIntoDatatypeSecondaryIndex(JobId jobId,
String dataverseName,
String nestedTypeName,
String topTypeName) |
void |
lock(JobId jobId,
byte lockMode)
Locally locks the entire metadata in given mode on behalf of given
transaction id.
|
String |
printMetadata() |
void |
unlock(JobId jobId,
byte lockMode)
Releases all local locks of given transaction id.
|
void |
updateDataset(JobId jobId,
Dataset dataset)
update an existing dataset in the metadata, acquiring local locks on behalf
of the given transaction id.
|
public static final MetadataNode INSTANCE
public void initialize(IAsterixAppRuntimeContext runtimeContext)
public void beginTransaction(JobId transactionId) throws ACIDException, RemoteException
IMetadataNodebeginTransaction in interface IMetadataNodeACIDExceptionRemoteExceptionpublic void commitTransaction(JobId jobId) throws RemoteException, ACIDException
IMetadataNodecommitTransaction in interface IMetadataNodeRemoteExceptionACIDExceptionpublic void abortTransaction(JobId jobId) throws RemoteException, ACIDException
IMetadataNodeabortTransaction in interface IMetadataNodeRemoteExceptionACIDExceptionpublic void lock(JobId jobId, byte lockMode) throws ACIDException, RemoteException
IMetadataNodelock in interface IMetadataNodeACIDExceptionRemoteExceptionpublic void unlock(JobId jobId, byte lockMode) throws ACIDException, RemoteException
IMetadataNodeunlock in interface IMetadataNodeACIDExceptionRemoteExceptionpublic void addDataverse(JobId jobId, Dataverse dataverse) throws MetadataException, RemoteException
IMetadataNodeaddDataverse in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverse - Dataverse instance to be inserted.MetadataException - For example, if the dataverse already exists.RemoteExceptionpublic void addDataset(JobId jobId, Dataset dataset) throws MetadataException, RemoteException
IMetadataNodeaddDataset in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataset - Dataset instance to be inserted.MetadataException - For example, if the dataset already exists.RemoteExceptionpublic void addIndex(JobId jobId, Index index) throws MetadataException, RemoteException
IMetadataNodeaddIndex in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.index - Index instance to be inserted.MetadataException - For example, if the index already exists.RemoteExceptionpublic void addNode(JobId jobId, Node node) throws MetadataException, RemoteException
IMetadataNodeaddNode in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.node - Node instance to be inserted.MetadataException - For example, if the node already exists.RemoteExceptionpublic void addNodeGroup(JobId jobId, NodeGroup nodeGroup) throws MetadataException, RemoteException
IMetadataNodeaddNodeGroup in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.nodeGroup - Node group instance to insert.MetadataException - For example, if the node group already exists.RemoteExceptionpublic void addDatatype(JobId jobId, Datatype datatype) throws MetadataException, RemoteException
IMetadataNodeaddDatatype in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.datatype - Datatype instance to be inserted.MetadataException - For example, if the datatype already exists.RemoteExceptionpublic void addFunction(JobId jobId, Function function) throws MetadataException, RemoteException
addFunction in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.function - Function to be insertedMetadataException - for example, if the function already exists or refers to an
unknown functionRemoteExceptionpublic void insertIntoDatatypeSecondaryIndex(JobId jobId, String dataverseName, String nestedTypeName, String topTypeName) throws Exception
Exceptionpublic void dropDataverse(JobId jobId, String dataverseName) throws MetadataException, RemoteException
IMetadataNodedropDataverse in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.MetadataException - For example, if the dataverse does not exist.RemoteExceptionpublic void dropDataset(JobId jobId, String dataverseName, String datasetName) throws MetadataException, RemoteException
IMetadataNodedropDataset in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of dataverse which holds the given dataset.datasetName - Name of dataset to delete.MetadataException - For example, if the dataset and/or dataverse does not exist.RemoteExceptionpublic void dropIndex(JobId jobId, String dataverseName, String datasetName, String indexName) throws MetadataException, RemoteException
IMetadataNodedropIndex in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of the datavers holding the given dataset.datasetName - Name of the dataset holding the index.MetadataException - For example, if the index does not exist.RemoteExceptionpublic void dropNodegroup(JobId jobId, String nodeGroupName) throws MetadataException, RemoteException
IMetadataNodedropNodegroup in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.nodeGroupName - Name of node group to be deleted.MetadataException - For example, there are still datasets partitioned on the node
group to be deleted.RemoteExceptionpublic void dropDatatype(JobId jobId, String dataverseName, String datatypeName) throws MetadataException, RemoteException
IMetadataNodedropDatatype in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of dataverse holding the datatype.datatypeName - Name of datatype to be deleted.MetadataException - For example, if there are still datasets using the type to be
deleted.RemoteExceptionpublic List<Dataverse> getDataverses(JobId jobId) throws MetadataException, RemoteException
IMetadataNodegetDataverses in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.MetadataException - For example, if the dataverse does not exist.RemoteExceptionpublic Dataverse getDataverse(JobId jobId, String dataverseName) throws MetadataException, RemoteException
IMetadataNodegetDataverse in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of the dataverse to retrieve.MetadataException - For example, if the dataverse does not exist.RemoteExceptionpublic List<Dataset> getDataverseDatasets(JobId jobId, String dataverseName) throws MetadataException, RemoteException
IMetadataNodegetDataverseDatasets in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of the dataverse of which to find all datasets.MetadataException - For example, if the dataverse does not exist. RemoteExceptionRemoteExceptionpublic List<Feed> getDataverseFeeds(JobId jobId, String dataverseName) throws MetadataException, RemoteException
getDataverseFeeds in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic List<Library> getDataverseLibraries(JobId jobId, String dataverseName) throws MetadataException, RemoteException
IMetadataNodegetDataverseLibraries in interface IMetadataNodedataverseName - dataverse asociated with the library that is to be retrieved.MetadataExceptionRemoteExceptionpublic Dataset getDataset(JobId jobId, String dataverseName, String datasetName) throws MetadataException, RemoteException
IMetadataNodegetDataset in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Dataverse name to look for the dataset.datasetName - Name of dataset to be retrieved.MetadataException - For example, if the dataset does not exist.RemoteExceptionpublic List<String> getDatatypeNamesUsingThisDatatype(JobId jobId, String dataverseName, String datatypeName) throws MetadataException, RemoteException
MetadataExceptionRemoteExceptionpublic List<String> getDatasetNamesPartitionedOnThisNodeGroup(JobId jobId, String nodegroup) throws MetadataException, RemoteException
MetadataExceptionRemoteExceptionpublic Index getIndex(JobId jobId, String dataverseName, String datasetName, String indexName) throws MetadataException, RemoteException
IMetadataNodegetIndex in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of the datavers holding the given dataset.datasetName - Name of the dataset holding the index.MetadataException - For example, if the index does not exist.RemoteExceptionpublic List<Index> getDatasetIndexes(JobId jobId, String dataverseName, String datasetName) throws MetadataException, RemoteException
IMetadataNodegetDatasetIndexes in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of dataverse which holds the given dataset.datasetName - Name of dataset for which to retrieve all indexes.MetadataException - For example, if the dataset and/or dataverse does not exist.RemoteExceptionpublic Datatype getDatatype(JobId jobId, String dataverseName, String datatypeName) throws MetadataException, RemoteException
IMetadataNodegetDatatype in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of dataverse holding the datatype.datatypeName - Name of datatype to be retrieved.MetadataException - For example, if the datatype does not exist.RemoteExceptionpublic NodeGroup getNodeGroup(JobId jobId, String nodeGroupName) throws MetadataException, RemoteException
IMetadataNodegetNodeGroup in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.nodeGroupName - Name of node group to be retrieved.MetadataException - For example, if the node group does not exist.RemoteExceptionpublic Function getFunction(JobId jobId, FunctionSignature functionSignature) throws MetadataException, RemoteException
getFunction in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.functionSignature - An instance of functionSignature representing the functionMetadataExceptionRemoteExceptionpublic void dropFunction(JobId jobId, FunctionSignature functionSignature) throws MetadataException, RemoteException
IMetadataNodedropFunction in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.functionSignature - An instance of functionSignature representing the functionMetadataException - For example, there are still datasets partitioned on the node
group to be deleted.RemoteExceptionpublic String printMetadata()
public void initializeDatasetIdFactory(JobId jobId) throws MetadataException, RemoteException
initializeDatasetIdFactory in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic org.apache.hyracks.dataflow.common.data.accessors.ITupleReference createTuple(String... fields) throws org.apache.hyracks.api.exceptions.HyracksDataException
org.apache.hyracks.api.exceptions.HyracksDataExceptionpublic List<Function> getDataverseFunctions(JobId jobId, String dataverseName) throws MetadataException, RemoteException
getDataverseFunctions in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addAdapter(JobId jobId, DatasourceAdapter adapter) throws MetadataException, RemoteException
addAdapter in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.adapter - Adapter to be insertedMetadataException - for example, if the adapter already exists.RemoteExceptionpublic void dropAdapter(JobId jobId, String dataverseName, String adapterName) throws MetadataException, RemoteException
IMetadataNodedropAdapter in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - dataverse asociated with the adapter that is to be deleted.adapterName - Name of adapter to be deleted. MetadataException for example,
if the adapter does not exists.RemoteExceptionMetadataExceptionpublic DatasourceAdapter getAdapter(JobId jobId, String dataverseName, String adapterName) throws MetadataException, RemoteException
getAdapter in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addCompactionPolicy(JobId jobId, CompactionPolicy compactionPolicy) throws MetadataException, RemoteException
addCompactionPolicy in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic CompactionPolicy getCompactionPolicy(JobId jobId, String dataverse, String policyName) throws MetadataException, RemoteException
getCompactionPolicy in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic List<DatasourceAdapter> getDataverseAdapters(JobId jobId, String dataverseName) throws MetadataException, RemoteException
getDataverseAdapters in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addLibrary(JobId jobId, Library library) throws MetadataException, RemoteException
IMetadataNodeaddLibrary in interface IMetadataNodelibrary - Library to be addedMetadataException - for example, if the library is already added.RemoteExceptionpublic void dropLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException, RemoteException
IMetadataNodedropLibrary in interface IMetadataNodedataverseName - dataverse asociated with the adapter that is to be deleted.libraryName - Name of library to be deleted. MetadataException for example,
if the library does not exists.RemoteExceptionMetadataExceptionpublic Library getLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException, RemoteException
getLibrary in interface IMetadataNodedataverseName - dataverse asociated with the library that is to be retrieved.libraryName - name of the library that is to be retrievedMetadataExceptionRemoteExceptionpublic int getMostRecentDatasetId()
throws MetadataException,
RemoteException
getMostRecentDatasetId in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addFeedPolicy(JobId jobId, FeedPolicy feedPolicy) throws MetadataException, RemoteException
addFeedPolicy in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic FeedPolicy getFeedPolicy(JobId jobId, String dataverse, String policyName) throws MetadataException, RemoteException
getFeedPolicy in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addFeed(JobId jobId, Feed feed) throws MetadataException, RemoteException
addFeed in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic Feed getFeed(JobId jobId, String dataverse, String feedName) throws MetadataException, RemoteException
getFeed in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void dropFeed(JobId jobId, String dataverse, String feedName) throws MetadataException, RemoteException
dropFeed in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void dropFeedPolicy(JobId jobId, String dataverseName, String policyName) throws MetadataException, RemoteException
IMetadataNodedropFeedPolicy in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic List<FeedPolicy> getDataversePolicies(JobId jobId, String dataverse) throws MetadataException, RemoteException
getDataversePolicies in interface IMetadataNodeMetadataExceptionRemoteExceptionpublic void addExternalFile(JobId jobId, ExternalFile externalFile) throws MetadataException, RemoteException
addExternalFile in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.externalFile - An object representing the external file entityMetadataException - for example, if the file already exists.RemoteExceptionpublic List<ExternalFile> getExternalFiles(JobId jobId, Dataset dataset) throws MetadataException, RemoteException
getExternalFiles in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataset - A dataset the files belongs to.MetadataExceptionRemoteExceptionpublic void dropExternalFile(JobId jobId, String dataverseName, String datasetName, int fileNumber) throws MetadataException, RemoteException
IMetadataNodedropExternalFile in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - dataverse asociated with the external dataset that owns the file to be deleted.datasetName - Name of dataset owning the file to be deleted.fileNumber - the id number for the file to be deletedRemoteExceptionMetadataExceptionpublic void dropExternalFiles(JobId jobId, Dataset dataset) throws MetadataException, RemoteException
IMetadataNodedropExternalFiles in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataset - An external dataset the files belong to.RemoteExceptionMetadataExceptionpublic org.apache.hyracks.dataflow.common.data.accessors.ITupleReference createExternalFileSearchTuple(String dataverseName, String datasetName, int fileNumber) throws org.apache.hyracks.api.exceptions.HyracksDataException
org.apache.hyracks.api.exceptions.HyracksDataExceptionpublic ExternalFile getExternalFile(JobId jobId, String dataverseName, String datasetName, Integer fileNumber) throws MetadataException, RemoteException
IMetadataNodegetExternalFile in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataverseName - Name of the datavers holding the given dataset.datasetName - Name of the dataset holding the index.fileNumber - Number of the fileMetadataException - For example, if the index does not exist.RemoteExceptionpublic void updateDataset(JobId jobId, Dataset dataset) throws MetadataException, RemoteException
IMetadataNodeupdateDataset in interface IMetadataNodejobId - A globally unique id for an active metadata transaction.dataset - updated Dataset instance.MetadataException - For example, if the dataset already exists.RemoteExceptionCopyright © 2016 The Apache Software Foundation. All rights reserved.