Skip to content
Permalink
Browse files
Updated for Asterix change to remove IStorageComponentProvider
Change-Id: Ia2c816cb350a93d6212c939efc6d0f21a9816499
  • Loading branch information
sjaco002 committed Feb 3, 2017
1 parent c91fc34 commit 3dcf57c4de9786bfbc544523edd2896d333b0078
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
@@ -22,6 +22,7 @@

import org.apache.asterix.app.translator.DefaultStatementExecutorFactory;
import org.apache.asterix.app.translator.QueryTranslator;
import org.apache.asterix.common.context.IStorageComponentProvider;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.lang.common.base.Statement;
import org.apache.asterix.translator.SessionConfig;
@@ -30,7 +31,7 @@ public class BADQueryTranslatorFactory extends DefaultStatementExecutorFactory {

@Override
public QueryTranslator create(List<Statement> statements, SessionConfig conf,
ILangCompilationProvider compilationProvider) {
return new BADStatementExecutor(statements, conf, compilationProvider);
ILangCompilationProvider compilationProvider, IStorageComponentProvider storageComponentProvider) {
return new BADStatementExecutor(statements, conf, compilationProvider, storageComponentProvider);
}
}
@@ -25,6 +25,7 @@
import org.apache.asterix.bad.lang.statement.ChannelDropStatement;
import org.apache.asterix.bad.metadata.Broker;
import org.apache.asterix.bad.metadata.Channel;
import org.apache.asterix.common.context.IStorageComponentProvider;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.lang.common.base.Statement;
import org.apache.asterix.lang.common.statement.DataverseDropStatement;
@@ -38,8 +39,8 @@
public class BADStatementExecutor extends QueryTranslator {

public BADStatementExecutor(List<Statement> aqlStatements, SessionConfig conf,
ILangCompilationProvider compliationProvider) {
super(aqlStatements, conf, compliationProvider);
ILangCompilationProvider compliationProvider, IStorageComponentProvider storageComponentProvider) {
super(aqlStatements, conf, compliationProvider, storageComponentProvider);
}


@@ -45,7 +45,7 @@
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
import org.apache.asterix.metadata.declared.MetadataProvider;
import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.asterix.runtime.utils.AppContextInfo;
import org.apache.asterix.translator.IStatementExecutor;
import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
import org.apache.asterix.translator.IStatementExecutor.Stats;
@@ -47,10 +47,10 @@
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.functions.FunctionSignature;
import org.apache.asterix.common.utils.JobUtils;
import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber;
import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber.ActiveLifecycleEvent;
import org.apache.asterix.external.feed.management.ActiveLifecycleEventSubscriber;
import org.apache.asterix.file.JobSpecificationUtils;
import org.apache.asterix.lang.aql.parser.AQLParserFactory;
import org.apache.asterix.lang.common.base.Expression;
import org.apache.asterix.lang.common.base.Statement;
@@ -69,12 +69,12 @@
import org.apache.asterix.metadata.declared.MetadataProvider;
import org.apache.asterix.metadata.entities.Function;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.asterix.runtime.util.ClusterStateManager;
import org.apache.asterix.runtime.utils.AppContextInfo;
import org.apache.asterix.runtime.utils.ClusterStateManager;
import org.apache.asterix.runtime.utils.RuntimeUtils;
import org.apache.asterix.translator.IStatementExecutor;
import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
import org.apache.asterix.translator.IStatementExecutor.Stats;
import org.apache.asterix.util.JobUtils;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
@@ -186,7 +186,7 @@ public byte getKind() {
public Pair<JobSpecification, AlgebricksAbsolutePartitionConstraint> buildChannelJobSpec(String dataverse,
String channelName, String duration, MetadataProvider metadataProvider, JobSpecification channeljobSpec,
String strIP, int port) throws Exception {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
JobSpecification spec = RuntimeUtils.createJobSpecification();
IOperatorDescriptor channelQueryExecuter;
AlgebricksPartitionConstraint executerPc;

@@ -28,23 +28,24 @@
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
import org.apache.asterix.metadata.api.ExtensionMetadataDataset;
import org.apache.asterix.metadata.api.IMetadataEntity;
import org.apache.asterix.metadata.api.IMetadataExtension;
import org.apache.asterix.metadata.api.IMetadataIndex;
import org.apache.asterix.metadata.bootstrap.MetadataBootstrap;
import org.apache.asterix.metadata.entities.Datatype;
import org.apache.asterix.metadata.entities.Dataverse;
import org.apache.asterix.metadata.entitytupletranslators.MetadataTupleTranslatorProvider;
import org.apache.asterix.metadata.utils.MetadataUtil;
import org.apache.asterix.runtime.formats.NonTaggedDataFormat;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.api.application.INCApplicationContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;

public class BADMetadataExtension implements IMetadataExtension {

public static final ExtensionId BAD_METADATA_EXTENSION_ID = new ExtensionId(
BADConstants.BAD_METADATA_EXTENSION_NAME, 0);
public static final Dataverse BAD_DATAVERSE = new Dataverse(BADConstants.BAD_DATAVERSE_NAME,
NonTaggedDataFormat.class.getName(), IMetadataEntity.PENDING_NO_OP);
NonTaggedDataFormat.class.getName(), MetadataUtil.PENDING_NO_OP);

public static final Datatype BAD_SUBSCRIPTION_DATATYPE = new Datatype(BADConstants.BAD_DATAVERSE_NAME,
BADConstants.ChannelSubscriptionsType, BADMetadataRecordTypes.channelSubscriptionsType, false);
@@ -87,11 +88,12 @@ public List<ExtensionMetadataDataset> getExtensionIndexes() {
}

@Override
public void initializeMetadata() throws HyracksDataException, RemoteException, ACIDException {
public void initializeMetadata(INCApplicationContext appCtx)
throws HyracksDataException, RemoteException, ACIDException {
// enlist datasets
MetadataBootstrap.enlistMetadataDataset(BADMetadataIndexes.CHANNEL_DATASET);
MetadataBootstrap.enlistMetadataDataset(BADMetadataIndexes.BROKER_DATASET);
MetadataBootstrap.enlistMetadataDataset(BADMetadataIndexes.PROCEDURE_DATASET);
MetadataBootstrap.enlistMetadataDataset(appCtx, BADMetadataIndexes.CHANNEL_DATASET);
MetadataBootstrap.enlistMetadataDataset(appCtx, BADMetadataIndexes.BROKER_DATASET);
MetadataBootstrap.enlistMetadataDataset(appCtx, BADMetadataIndexes.PROCEDURE_DATASET);
if (MetadataBootstrap.isNewUniverse()) {
MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
try {
@@ -35,7 +35,7 @@
import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber;
import org.apache.asterix.external.feed.api.IActiveLifecycleEventSubscriber.ActiveLifecycleEvent;
import org.apache.asterix.external.feed.management.FeedConnectionId;
import org.apache.asterix.runtime.util.AppContextInfo;
import org.apache.asterix.runtime.utils.AppContextInfo;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.IOperatorDescriptor;
import org.apache.hyracks.api.dataflow.OperatorDescriptorId;

0 comments on commit 3dcf57c

Please sign in to comment.