Search in sources :

Example 41 with MetadataTransactionContext

use of org.apache.asterix.metadata.MetadataTransactionContext in project asterixdb by apache.

the class AdmDataGen method init.

public void init() throws IOException, ParseException, AsterixException, ACIDException, MetadataException, AlgebricksException {
    FileReader aql = new FileReader(schemaFile);
    IParser parser = parserFactory.createParser(aql);
    List<Statement> statements = parser.parse();
    aql.close();
    // TODO: Need to fix how to use transactions here.
    MetadataTransactionContext mdTxnCtx = new MetadataTransactionContext(new JobId(-1));
    ADGenDmlTranslator dmlt = new ADGenDmlTranslator(mdTxnCtx, statements);
    dmlt.translate();
    typeMap = dmlt.getTypeMap();
    typeAnnotMap = dmlt.getTypeDataGenMap();
    dgCtx = new DataGeneratorContext();
}
Also used : Statement(org.apache.asterix.lang.common.base.Statement) ADGenDmlTranslator(org.apache.asterix.tools.translator.ADGenDmlTranslator) MetadataTransactionContext(org.apache.asterix.metadata.MetadataTransactionContext) FileReader(java.io.FileReader) JobId(org.apache.asterix.common.transactions.JobId) IParser(org.apache.asterix.lang.common.base.IParser)

Aggregations

MetadataTransactionContext (org.apache.asterix.metadata.MetadataTransactionContext)41 RemoteException (java.rmi.RemoteException)32 ACIDException (org.apache.asterix.common.exceptions.ACIDException)32 IOException (java.io.IOException)30 AsterixException (org.apache.asterix.common.exceptions.AsterixException)30 MetadataException (org.apache.asterix.metadata.MetadataException)30 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)29 AlgebricksException (org.apache.hyracks.algebricks.common.exceptions.AlgebricksException)28 CompilationException (org.apache.asterix.common.exceptions.CompilationException)27 Dataset (org.apache.asterix.metadata.entities.Dataset)14 JobSpecification (org.apache.hyracks.api.job.JobSpecification)12 ArrayList (java.util.ArrayList)11 Dataverse (org.apache.asterix.metadata.entities.Dataverse)11 IDataset (org.apache.asterix.common.metadata.IDataset)8 IHyracksDataset (org.apache.hyracks.api.dataset.IHyracksDataset)8 ActiveJobNotificationHandler (org.apache.asterix.active.ActiveJobNotificationHandler)7 ActiveLifecycleListener (org.apache.asterix.active.ActiveLifecycleListener)7 EntityId (org.apache.asterix.active.EntityId)6 Function (org.apache.asterix.metadata.entities.Function)6 ARecordType (org.apache.asterix.om.types.ARecordType)6