Package org.voltdb

Examples of org.voltdb.ProcInfo


        ProcInfoData info = compiler.getProcInfoOverride(shortName);
        // then check for the usual one in the class itself
        // and create a ProcInfo.Data instance for it
        if (info == null) {
            info = new ProcInfoData();
            ProcInfo annotationInfo = procClass.getAnnotation(ProcInfo.class);
            if (annotationInfo != null) {
                info.partitionInfo = annotationInfo.partitionInfo();
                info.partitionParam = annotationInfo.partitionParam();
                info.singlePartition = annotationInfo.singlePartition();
                info.mapInputQuery = annotationInfo.mapInputQuery();
                // info.mapEmitTable = annotationInfo.mapEmitTable();
                info.reduceInputQuery = annotationInfo.reduceInputQuery();
                // info.reduceEmitTable = annotationInfo.reduceEmitTable();
            }
        }
        assert (info != null);
View Full Code Here


                                           VoltSystemProcedure.class.getSimpleName());
                throw new VoltCompilerException(msg);
            }
           
            // read annotations
            final ProcInfo info = procClass.getAnnotation(ProcInfo.class);
            if (info == null) {
                throw new VoltCompilerException("Sysproc " + shortName + " is missing annotation.");
            }

            // add an entry to the catalog
            final Procedure procedure = database.getProcedures().add(shortName);
            procedure.setId(this.getNextProcedureId());
            procedure.setClassname(procClass.getCanonicalName());
            procedure.setReadonly(readonly);
            procedure.setSystemproc(true);
            procedure.setHasjava(true);
            procedure.setSinglepartition(info.singlePartition());
            procedure.setEverysite(everysite);
            ProcedureCompiler.populateProcedureParameters(this, procClass, procedure);
           
            // ProcInfo.partitionParam overrides everything else
            if (info.partitionParam() != -1) {
                if (info.partitionParam() >= procedure.getParameters().size() || info.partitionParam() < 0) {
                    String msg = "PartitionInfo 'partitionParam' not a valid parameter for procedure: " + procedure.getClassname();
                    throw new VoltCompilerException(msg);
                }
                procedure.setPartitionparameter(info.partitionParam());
            }
            else {
                procedure.setPartitionparameter(NullProcParameter.PARAM_IDX);
            }
View Full Code Here

            throw new VoltAbortException();
        }
    }

    public long run(long partitionParam, int[] opsForBatch1, int[] opsForBatch2) {
        ProcInfo pi = getClass().getAnnotation(ProcInfo.class);
        boolean singlePartition = (pi != null) && pi.singlePartition();

        // ensure the state is right
        voltQueueSQL(rRead, EXPECT_SCALAR_MATCH(1));
        voltQueueSQL(pRead, EXPECT_SCALAR_MATCH(1));
        voltExecuteSQL();
View Full Code Here

        }
        // then check for the usual one in the class itself
        // and create a ProcInfo.Data instance for it
        if (info == null) {
            info = new ProcInfoData();
            ProcInfo annotationInfo = procClass.getAnnotation(ProcInfo.class);
            // error out if partition info is present in both ddl and annotation
            if (annotationInfo != null) {
                if (ddlInfo != null) {
                    String msg = "Procedure: " + shortName + " has partition properties defined both in ";
                    msg += "class \"" + className + "\" and in the schema defintion file(s)";
                    throw compiler.new VoltCompilerException(msg);
                }
                // Prevent AutoGenerated DDL from including PARTITION PROCEDURE for this procedure.
                pa.classAnnotated = true;
                info.partitionInfo = annotationInfo.partitionInfo();
                info.singlePartition = annotationInfo.singlePartition();
            }
            else if (ddlInfo != null) {
                info = ddlInfo;
            }
        }
View Full Code Here

TOP

Related Classes of org.voltdb.ProcInfo

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.