Skip to content
Permalink
Browse files
Match SessionOutput changes from Asterix
Change-Id: I0b64141926b5161dcb44bb6edbc19c2d0cdf2860
  • Loading branch information
westmann committed May 12, 2017
1 parent dcbd6d1 commit 74191538f02880ba503c736d1ac4292957723396
Showing 6 changed files with 11 additions and 11 deletions.
@@ -26,14 +26,14 @@
import org.apache.asterix.common.dataflow.ICcApplicationContext;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.lang.common.base.Statement;
import org.apache.asterix.translator.SessionConfig;
import org.apache.asterix.translator.SessionOutput;

public class BADQueryTranslatorFactory extends DefaultStatementExecutorFactory {

@Override
public QueryTranslator create(ICcApplicationContext appCtx, List<Statement> statements, SessionConfig conf,
public QueryTranslator create(ICcApplicationContext appCtx, List<Statement> statements, SessionOutput output,
ILangCompilationProvider compilationProvider, IStorageComponentProvider storageComponentProvider) {
return new BADStatementExecutor(appCtx, statements, conf, compilationProvider, storageComponentProvider,
return new BADStatementExecutor(appCtx, statements, output, compilationProvider, storageComponentProvider,
executorService);
}
}
@@ -38,15 +38,15 @@
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
import org.apache.asterix.metadata.declared.MetadataProvider;
import org.apache.asterix.translator.SessionConfig;
import org.apache.asterix.translator.SessionOutput;
import org.apache.hyracks.api.client.IHyracksClientConnection;

public class BADStatementExecutor extends QueryTranslator {

public BADStatementExecutor(ICcApplicationContext appCtx, List<Statement> statements, SessionConfig conf,
public BADStatementExecutor(ICcApplicationContext appCtx, List<Statement> statements, SessionOutput output,
ILangCompilationProvider compliationProvider, IStorageComponentProvider storageComponentProvider,
ExecutorService executorService) {
super(appCtx, statements, conf, compliationProvider, storageComponentProvider, executorService);
super(appCtx, statements, output, compliationProvider, storageComponentProvider, executorService);
}

@Override
@@ -210,13 +210,13 @@ public void handle(IStatementExecutor statementExecutor, MetadataProvider metada
InsertStatement insert = new InsertStatement(new Identifier(dataverse),
new Identifier(subscriptionsDatasetName), subscriptionTuple, varCounter, resultVar, accessor);
((QueryTranslator) statementExecutor).handleInsertUpsertStatement(tempMdProvider, insert, hcc, hdc,
resultDelivery, stats, false, null, null);
resultDelivery, null, stats, false, null, null);
} else {
//To update an existing subscription
UpsertStatement upsert = new UpsertStatement(new Identifier(dataverse),
new Identifier(subscriptionsDatasetName), subscriptionTuple, varCounter, null, null);
((QueryTranslator) statementExecutor).handleInsertUpsertStatement(tempMdProvider, upsert, hcc, hdc,
resultDelivery, stats, false, null, null);
resultDelivery, null, stats, false, null, null);
}

MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
@@ -236,7 +236,7 @@ private JobSpecification createChannelJob(IStatementExecutor statementExecutor,
metadataProvider.getConfig().put(ss.getPropName(), ss.getPropValue());

return ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider, fStatements.get(1),
hcc, hdc, ResultDelivery.ASYNC, stats, true, null, null);
hcc, hdc, ResultDelivery.ASYNC, null, stats, true, null, null);
}

private void setupExecutorJob(EntityId entityId, JobSpecification channeljobSpec, IHyracksClientConnection hcc,
@@ -172,7 +172,7 @@ private Pair<JobSpecification, PrecompiledType> createProcedureJob(String body,
if (fStatements.get(0).getKind() == Statement.Kind.INSERT) {
return new Pair<>(
((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider,
fStatements.get(0), hcc, hdc, ResultDelivery.ASYNC, stats, true, null, null),
fStatements.get(0), hcc, hdc, ResultDelivery.ASYNC, null, stats, true, null, null),
PrecompiledType.INSERT);
} else if (fStatements.get(0).getKind() == Statement.Kind.QUERY) {
Pair<JobSpecification, PrecompiledType> pair =
@@ -121,7 +121,7 @@ public void handle(IStatementExecutor statementExecutor, MetadataProvider metada
hcc.waitForCompletion(hyracksJobId);
ResultReader resultReader = listener.getResultReader();
ResultUtil.printResults(appCtx, resultReader,
((QueryTranslator) statementExecutor).getSessionConfig(), new Stats(), null);
((QueryTranslator) statementExecutor).getSessionOutput(), new Stats(), null);
}

} else {

0 comments on commit 7419153

Please sign in to comment.