Search in sources :

Example 86 with RemoteException

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);
}
Also used : FeedConnection(org.apache.asterix.metadata.entities.FeedConnection) RemoteException(java.rmi.RemoteException) Feed(org.apache.asterix.metadata.entities.Feed)

Example 87 with RemoteException

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);
}
Also used : FeedPolicyEntity(org.apache.asterix.metadata.entities.FeedPolicyEntity) RemoteException(java.rmi.RemoteException)

Example 88 with RemoteException

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;
}
Also used : Dataset(org.apache.asterix.metadata.entities.Dataset) RemoteException(java.rmi.RemoteException)

Example 89 with RemoteException

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;
}
Also used : RemoteException(java.rmi.RemoteException) ARecordType(org.apache.asterix.om.types.ARecordType) Datatype(org.apache.asterix.metadata.entities.Datatype)

Example 90 with RemoteException

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;
}
Also used : Function(org.apache.asterix.metadata.entities.Function) RemoteException(java.rmi.RemoteException)

Aggregations

RemoteException (java.rmi.RemoteException)368 IOException (java.io.IOException)54 VmwareContext (com.cloud.hypervisor.vmware.util.VmwareContext)38 VmwareHypervisorHost (com.cloud.hypervisor.vmware.mo.VmwareHypervisorHost)34 SSOException (com.iplanet.sso.SSOException)32 AMException (com.iplanet.am.sdk.AMException)31 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)29 AMEntryExistsException (com.iplanet.am.sdk.AMEntryExistsException)29 AMEventManagerException (com.iplanet.am.sdk.AMEventManagerException)29 LocateRegistry (java.rmi.registry.LocateRegistry)29 Registry (java.rmi.registry.Registry)29 UnsupportedEncodingException (java.io.UnsupportedEncodingException)27 EJBException (javax.ejb.EJBException)25 VirtualMachineMO (com.cloud.hypervisor.vmware.mo.VirtualMachineMO)24 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)24 ArrayList (java.util.ArrayList)22 InvocationTargetException (java.lang.reflect.InvocationTargetException)21 ConnectException (java.net.ConnectException)20 DatastoreMO (com.cloud.hypervisor.vmware.mo.DatastoreMO)18 ExecutionException (com.cloud.utils.exception.ExecutionException)18