Package org.apache.vxquery.context

Examples of org.apache.vxquery.context.StaticContextImpl


                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();
View Full Code Here


        }
    }

    private static void runTestInternal(String testName, String query) throws Exception {
        XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, 65536);
        CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                new ResultSetId(System.nanoTime()), null);
        compiler.compile(testName, new StringReader(query), ccb, Integer.MAX_VALUE);
    }
View Full Code Here

            };

            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();
View Full Code Here

    }

    public Module translateModule(ModuleNode moduleNode) throws SystemException {
        Module module = new Module();

        moduleCtx = new StaticContextImpl(rootCtx);
        moduleCtx.registerVariable(new XQueryVariable(XMLQueryCompilerConstants.DOT_VAR_NAME, SequenceType.create(
                AnyItemType.INSTANCE, Quantifier.QUANT_ONE), newLogicalVariable()));
        rootVarScope = new RootVariableScope();
        currCtx = moduleCtx;
        module.setModuleContext(moduleCtx);
View Full Code Here

                    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();
View Full Code Here

                        }
                    }
                };
                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;
View Full Code Here

        }
    }

    private static void runTestInternal(String testName, String query) throws Exception {
        XMLQueryCompiler compiler = new XMLQueryCompiler(null);
        CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE),
                new FileSplit[] { new FileSplit("CHANGE_ME", File.createTempFile("foo", ".bar").getAbsolutePath()) });
        compiler.compile(testName, new StringReader(query), ccb, Integer.MAX_VALUE);
    }
View Full Code Here

    }

    public Module translateModule(ModuleNode moduleNode) throws SystemException {
        Module module = new Module();

        moduleCtx = new StaticContextImpl(rootCtx);
        moduleCtx.registerVariable(new XQueryVariable(XMLQueryCompilerConstants.DOT_VAR_NAME, SequenceType.create(
                AnyItemType.INSTANCE, Quantifier.QUANT_ONE), newLogicalVariable()));
        rootVarScope = new RootVariableScope();
        currCtx = moduleCtx;
        module.setModuleContext(moduleCtx);
View Full Code Here

    }

    public Module translateModule(ModuleNode moduleNode) throws SystemException {
        Module module = new Module();

        moduleCtx = new StaticContextImpl(rootCtx);
        moduleCtx.registerVariable(new XQueryVariable(XMLQueryCompilerConstants.DOT_VAR_NAME, SequenceType.create(
                AnyItemType.INSTANCE, Quantifier.QUANT_ONE), newLogicalVariable()));
        rootVarScope = new RootVariableScope();
        currCtx = moduleCtx;
        module.setModuleContext(moduleCtx);
View Full Code Here

        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();
View Full Code Here

TOP

Related Classes of org.apache.vxquery.context.StaticContextImpl

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.