use of java.rmi.RemoteException in project asterixdb by apache.
the class MetadataManager method dropFeed.
@Override
public void dropFeed(MetadataTransactionContext ctx, String dataverse, String feedName) throws MetadataException {
Feed feed = null;
List<FeedConnection> feedConnections = null;
try {
feed = metadataNode.getFeed(ctx.getJobId(), dataverse, feedName);
feedConnections = metadataNode.getFeedConnections(ctx.getJobId(), dataverse, feedName);
metadataNode.dropFeed(ctx.getJobId(), dataverse, feedName);
for (FeedConnection feedConnection : feedConnections) {
metadataNode.dropFeedConnection(ctx.getJobId(), dataverse, feedName, feedConnection.getDatasetName());
ctx.dropFeedConnection(dataverse, feedName, feedConnection.getDatasetName());
}
} catch (RemoteException e) {
throw new MetadataException(e);
}
ctx.dropFeed(feed);
}
use of java.rmi.RemoteException in project asterixdb by apache.
the class MetadataManager method dropFeedPolicy.
@Override
public void dropFeedPolicy(MetadataTransactionContext mdTxnCtx, String dataverseName, String policyName) throws MetadataException {
FeedPolicyEntity feedPolicy;
try {
feedPolicy = metadataNode.getFeedPolicy(mdTxnCtx.getJobId(), dataverseName, policyName);
metadataNode.dropFeedPolicy(mdTxnCtx.getJobId(), dataverseName, policyName);
} catch (RemoteException e) {
throw new MetadataException(e);
}
mdTxnCtx.dropFeedPolicy(feedPolicy);
}
use of java.rmi.RemoteException in project asterixdb by apache.
the class MetadataManager method getDataset.
@Override
public Dataset getDataset(MetadataTransactionContext ctx, String dataverseName, String datasetName) throws MetadataException {
// First look in the context to see if this transaction created the
// requested dataset itself (but the dataset is still uncommitted).
Dataset dataset = ctx.getDataset(dataverseName, datasetName);
if (dataset != null) {
// uncommitted.
return dataset;
}
if (ctx.datasetIsDropped(dataverseName, datasetName)) {
// in the cache.
return null;
}
dataset = cache.getDataset(dataverseName, datasetName);
if (dataset != null) {
// Dataset is already in the cache, don't add it again.
return dataset;
}
try {
dataset = metadataNode.getDataset(ctx.getJobId(), dataverseName, datasetName);
} catch (RemoteException e) {
throw new MetadataException(e);
}
// when this transaction commits.
if (dataset != null) {
ctx.addDataset(dataset);
}
return dataset;
}
use of java.rmi.RemoteException in project asterixdb by apache.
the class MetadataManager method getDatatype.
@Override
public Datatype getDatatype(MetadataTransactionContext ctx, String dataverseName, String datatypeName) throws MetadataException {
// First look in the context to see if this transaction created the
// requested datatype itself (but the datatype is still uncommitted).
Datatype datatype = ctx.getDatatype(dataverseName, datatypeName);
if (datatype != null) {
// uncommitted.
return datatype;
}
if (ctx.datatypeIsDropped(dataverseName, datatypeName)) {
// in the cache.
return null;
}
datatype = cache.getDatatype(dataverseName, datatypeName);
if (datatype != null) {
// Datatype is already in the cache, don't add it again.
//create a new Datatype object with a new ARecordType object in order to avoid
//concurrent access to UTF8StringPointable comparator in ARecordType object.
//see issue 510
ARecordType aRecType = (ARecordType) datatype.getDatatype();
return new Datatype(datatype.getDataverseName(), datatype.getDatatypeName(), new ARecordType(aRecType.getTypeName(), aRecType.getFieldNames(), aRecType.getFieldTypes(), aRecType.isOpen()), datatype.getIsAnonymous());
}
try {
datatype = metadataNode.getDatatype(ctx.getJobId(), dataverseName, datatypeName);
} catch (RemoteException e) {
throw new MetadataException(e);
}
// when this transaction commits.
if (datatype != null) {
ctx.addDatatype(datatype);
}
return datatype;
}
use of java.rmi.RemoteException in project asterixdb by apache.
the class MetadataManager method getFunction.
@Override
public Function getFunction(MetadataTransactionContext ctx, FunctionSignature functionSignature) throws MetadataException {
// First look in the context to see if this transaction created the
// requested dataset itself (but the dataset is still uncommitted).
Function function = ctx.getFunction(functionSignature);
if (function != null) {
// uncommitted.
return function;
}
if (ctx.functionIsDropped(functionSignature)) {
// in the cache.
return null;
}
if (ctx.getDataverse(functionSignature.getNamespace()) != null) {
// dataverse.
return null;
}
function = cache.getFunction(functionSignature);
if (function != null) {
// Function is already in the cache, don't add it again.
return function;
}
try {
function = metadataNode.getFunction(ctx.getJobId(), functionSignature);
} catch (RemoteException e) {
throw new MetadataException(e);
}
// when this transaction commits.
if (function != null) {
ctx.addFunction(function);
}
return function;
}
Aggregations