Package org.apache.vxquery.xmlquery.query

Examples of org.apache.vxquery.xmlquery.query.XMLQueryCompiler


                    System.err.println("Starting " + testCase.getXQueryDisplayName());
                }
                long start = System.currentTimeMillis();
                try {
                    try {
                        XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, 65536);
                        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));
View Full Code Here


                    return sb;
                }
            };

            start = opts.timing ? new Date() : null;
            XMLQueryCompiler compiler = new XMLQueryCompiler(listener, getNodeList(), opts.frameSize, opts.availableProcessors);
            resultSetId = createResultSetId();
            CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                    resultSetId, null);
            compiler.compile(query, new StringReader(qStr), ccb, opts.optimizationLevel);
            // if -timing argument passed, show the starting and ending times
            if (opts.timing) {
                end = new Date();
                message = "Compile time: " + (end.getTime() - start.getTime()) + "ms";
                System.out.println(message);
                timing.add(message);
            }
            if (opts.compileOnly) {
                continue;
            }

            Module module = compiler.getModule();
            JobSpecification js = module.getHyracksJobSpecification();

            DynamicContext dCtx = new DynamicContextImpl(module.getModuleContext());
            js.setGlobalJobDataFactory(new VXQueryGlobalDataFactory(dCtx.createFactory()));
View Full Code Here

                    System.err.println("Starting " + testCase.getXQueryDisplayName());
                }
                long start = System.currentTimeMillis();
                try {
                    try {
                        XMLQueryCompiler compiler = new XMLQueryCompiler(null);
                        File tempFile = File.createTempFile(testCase.getXQueryFile().getName(), ".tmp");
                        tempFile.deleteOnExit();
                        Reader in = new InputStreamReader(new FileInputStream(testCase.getXQueryFile()), "UTF-8");
                        CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
                                RootStaticContextImpl.INSTANCE), new FileSplit[] { new FileSplit("nc1",
                                tempFile.getAbsolutePath()) });
                        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("test", spec, EnumSet.of(JobFlag.PROFILE_RUNTIME));
                        hcc.waitForCompletion(jobId);
View Full Code Here

                            System.err.println(new XStream(new DomDriver()).toXML(moduleNode));
                        }
                    }
                };
                File result = createTempFile("test");
                XMLQueryCompiler compiler = new XMLQueryCompiler(listener);
                CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
                        RootStaticContextImpl.INSTANCE), new FileSplit[] { new FileSplit("nc1",
                        result.getAbsolutePath()) });
                compiler.compile(query, new StringReader(qStr), ccb, opts.optimizationLevel);
                if (opts.compileOnly) {
                    continue;
                }

                Module module = compiler.getModule();
                JobSpecification js = module.getHyracksJobSpecification();

                DynamicContext dCtx = new DynamicContextImpl(module.getModuleContext());
                js.setGlobalJobDataFactory(new VXQueryGlobalDataFactory(dCtx.createFactory()));
View Full Code Here

            System.err.println("Starting " + testCase.getXQueryDisplayName());
        }
        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));
View Full Code Here

                    return sb;
                }
            };

            start = opts.timing ? new Date() : null;
            XMLQueryCompiler compiler = new XMLQueryCompiler(listener, getNodeList(), opts.frameSize,
                    opts.availableProcessors, opts.joinHashSize);
            resultSetId = createResultSetId();
            CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                    resultSetId, null);
            compiler.compile(query, new StringReader(qStr), ccb, opts.optimizationLevel);
            // if -timing argument passed, show the starting and ending times
            if (opts.timing) {
                end = new Date();
                timingMessage("Compile time: " + (end.getTime() - start.getTime()) + " ms");
            }
            if (opts.compileOnly) {
                continue;
            }

            Module module = compiler.getModule();
            JobSpecification js = module.getHyracksJobSpecification();

            DynamicContext dCtx = new DynamicContextImpl(module.getModuleContext());
            js.setGlobalJobDataFactory(new VXQueryGlobalDataFactory(dCtx.createFactory()));
View Full Code Here

TOP

Related Classes of org.apache.vxquery.xmlquery.query.XMLQueryCompiler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.