long start = System.currentTimeMillis();
try {
try {
XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, FRAME_SIZE);
Reader in = new InputStreamReader(new FileInputStream(testCase.getXQueryFile()), "UTF-8");
CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
RootStaticContextImpl.INSTANCE), new ResultSetId(testCase.getXQueryDisplayName().hashCode()),
testCase.getSourceFileMap());
compiler.compile(testCase.getXQueryDisplayName(), in, ccb, opts.optimizationLevel);
JobSpecification spec = compiler.getModule().getHyracksJobSpecification();
DynamicContext dCtx = new DynamicContextImpl(compiler.getModule().getModuleContext());
spec.setGlobalJobDataFactory(new VXQueryGlobalDataFactory(dCtx.createFactory()));
spec.setMaxReattempts(0);
JobId jobId = hcc.startJob(spec, EnumSet.of(JobFlag.PROFILE_RUNTIME));
if (hds == null) {
hds = new HyracksDataset(hcc, spec.getFrameSize(), opts.threads);
}
ByteBuffer buffer = ByteBuffer.allocate(spec.getFrameSize());
IHyracksDatasetReader reader = hds.createReader(jobId, ccb.getResultSetId());
IFrameTupleAccessor frameTupleAccessor = new ResultFrameTupleAccessor(spec.getFrameSize());
buffer.clear();
res.result = "";
while (reader.read(buffer) > 0) {
buffer.clear();