Skip to content
Permalink
Browse files
Updated BAD to work with recent Asterix changes
Change-Id: I20f2e86ff47f92477ffc1d20514127af41340346
  • Loading branch information
sjaco002 committed Mar 1, 2017
1 parent 79226b5 commit 936674a37d801a707bbd65a5490f065ab2567196
Showing 6 changed files with 8 additions and 14 deletions.
@@ -144,6 +144,9 @@
<usedDependencies>
<usedDependency>org.apache.hadoop:hadoop-minicluster</usedDependency>
</usedDependencies>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>org.apache.asterix:asterix-common</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
@@ -245,7 +245,7 @@ private void setupExecutorJob(EntityId entityId, JobSpecification channeljobSpec
}
ScheduledExecutorService ses = ChannelJobService.startJob(channeljobSpec, EnumSet.noneOf(JobFlag.class),
jobId, hcc, ChannelJobService.findPeriod(duration));
listener.storeDistributedInfo(jobId, ses, null, null);
listener.storeDistributedInfo(jobId, ses, null);
}

}
@@ -172,7 +172,7 @@ private void setupDistributedJob(EntityId entityId, JobSpecification jobSpec, IH
PrecompiledJobEventListener listener, MetadataProvider metadataProvider, IHyracksDataset hdc, Stats stats)
throws Exception {
JobId jobId = hcc.distributeJob(jobSpec);
listener.storeDistributedInfo(jobId, null, new ResultReader(hdc), metadataProvider.getResultSetId());
listener.storeDistributedInfo(jobId, null, new ResultReader(hdc, jobId, metadataProvider.getResultSetId()));
}

@Override
@@ -118,15 +118,14 @@ public void handle(IStatementExecutor statementExecutor, MetadataProvider metada
if (listener.getType() == PrecompiledType.QUERY) {
hcc.waitForCompletion(hyracksJobId);
ResultReader resultReader = listener.getResultReader();
resultReader.open(hyracksJobId, listener.getResultSetId());
ResultUtil.printResults(resultReader, ((QueryTranslator) statementExecutor).getSessionConfig(),
new Stats(), null);
}

} else {
ScheduledExecutorService ses = ChannelJobService.startJob(null, EnumSet.noneOf(JobFlag.class),
hyracksJobId, hcc, ChannelJobService.findPeriod(procedure.getDuration()));
listener.storeDistributedInfo(hyracksJobId, ses, listener.getResultReader(), listener.getResultSetId());
listener.storeDistributedInfo(hyracksJobId, ses, listener.getResultReader());
}

MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
@@ -28,7 +28,6 @@
import org.apache.asterix.app.result.ResultReader;
import org.apache.asterix.common.metadata.IDataset;
import org.apache.asterix.external.feed.management.ActiveEntityEventsListener;
import org.apache.hyracks.api.dataset.ResultSetId;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.job.JobId;
import org.apache.log4j.Logger;
@@ -38,7 +37,6 @@ public class PrecompiledJobEventListener extends ActiveEntityEventsListener {

private ScheduledExecutorService executorService = null;
private ResultReader resultReader;
private ResultSetId resultSetId;

public enum PrecompiledType {
CHANNEL,
@@ -60,20 +58,14 @@ public ResultReader getResultReader() {
return resultReader;
}

public ResultSetId getResultSetId() {
return resultSetId;
}

public PrecompiledType getType() {
return type;
}

public void storeDistributedInfo(JobId jobId, ScheduledExecutorService ses, ResultReader resultReader,
ResultSetId resultSetId) {
public void storeDistributedInfo(JobId jobId, ScheduledExecutorService ses, ResultReader resultReader) {
this.jobId = jobId;
this.executorService = ses;
this.resultReader = resultReader;
this.resultSetId = resultSetId;
}

public ScheduledExecutorService getExecutorService() {
@@ -24,7 +24,7 @@
import java.util.logging.Logger;

import org.apache.asterix.common.config.TransactionProperties;
import org.apache.asterix.test.aql.TestExecutor;
import org.apache.asterix.test.common.TestExecutor;
import org.apache.asterix.test.runtime.ExecutionTestUtil;
import org.apache.asterix.testframework.context.TestCaseContext;
import org.apache.asterix.testframework.xml.TestGroup;

0 comments on commit 936674a

Please sign in to comment.