Examples of VoltType


Examples of org.voltdb.VoltType

            QueryTrace loader_query = new QueryTrace(catalog_stmt, new Object[0], 0);
            loader_xact.addQuery(loader_query);
           
            // Gather column types
            int num_columns = voltTable.getColumnCount();
            VoltType col_types[] = new VoltType[num_columns];
            for (int i = 0; i < num_columns; i++) {
                Column catalog_col = catalog_tbl.getColumns().get(i);
                col_types[i] = VoltType.get((byte)catalog_col.getType());
            } // FOR
View Full Code Here

Examples of org.voltdb.VoltType

    public ParamNumericValuesFeature(PartitionEstimator p_estimator, Procedure catalog_proc) {
        super(p_estimator, catalog_proc, ParamNumericValuesFeature.class);
       
        for (ProcParameter catalog_param : catalog_proc.getParameters()) {
            VoltType type = VoltType.get(catalog_param.getType());
            switch (type) {
                case TINYINT:
                case SMALLINT:
                case INTEGER:
                case BIGINT:
View Full Code Here

Examples of org.voltdb.VoltType

                LOG.debug(catalog_tbl.getName() + " MultiColumn: " + mc);

            Object values[] = new Object[mc.size()];
            for (int i = 0; i < values.length; i++) {
                Column inner = mc.get(i);
                VoltType type = VoltType.get(inner.getType());
                values[i] = row.get(inner.getIndex(), type);
            } // FOR
            partition = this.hasher.multiValueHash(values);

            // Single-Column Partitioning
        } else {
            VoltType type = VoltType.get(catalog_col.getType());
            Object value = row.get(catalog_col.getIndex(), type);
            partition = this.hasher.hash(value, catalog_col);
            if (debug.val)
                LOG.debug(String.format("%s SingleColumn: Value=%s / Partition=%d", catalog_col.fullName(), value, partition));
        }
View Full Code Here

Examples of org.voltdb.VoltType

                    param.setIsarray(true);
                    cls = cls.getComponentType();
                } else
                    param.setIsarray(false);

                VoltType type;
                try {
                    type = VoltType.typeFromClass(cls);
                } catch (RuntimeException e) {
                    // handle the case where the type is invalid
                    String msg = "Procedure: " + shortName + " has a parameter with invalid type: ";
                    msg += cls.getSimpleName();
                    throw compiler.new VoltCompilerException(msg);
                }
                param.setType(type.getValue());
            } // FOR
        }
        // The input parameters to the MapInputQuery are the input parameters
        // for the Procedure
        else {
            paramTypes = new Class<?>[mapStatement.getParameters().size()];
            for (int i = 0; i < paramTypes.length; i++) {
                StmtParameter catalog_stmt_param = mapStatement.getParameters().get(i);
                assert (catalog_stmt_param != null);
                VoltType vtype = VoltType.get(catalog_stmt_param.getJavatype());
                paramTypes[i] = vtype.classFromType();

                ProcParameter catalog_proc_param = procedure.getParameters().add(catalog_stmt_param.getName());
                catalog_proc_param.setIndex(i);
                catalog_proc_param.setIsarray(false); // One day...
                catalog_proc_param.setType(vtype.getValue());
            } // FOR
        }
        return (paramTypes);
    }
View Full Code Here

Examples of org.voltdb.VoltType

            }
            // CONSTANT VALUE
            // This is more rare
            else if (param instanceof ConstantValue) {
                ConstantValue const_param = (ConstantValue)param;
                VoltType vtype = VoltType.get(const_param.getType());
                Object const_value = VoltTypeUtil.getObjectFromString(vtype, const_param.getValue());
                int partition_id = this.hasher.hash(const_value);
                partitions.add(partition_id);
            }
            // BUSTED!
View Full Code Here

Examples of org.voltdb.VoltType

        // That's ok really, because all we really need to do is look at size of
        // the strings
        bytes = 0l;
        boolean numerals_only = true;
        for (Column catalog_col : CatalogUtil.getSortedCatalogItems(catalog_tbl.getColumns(), "index")) {
            VoltType type = VoltType.get((byte) catalog_col.getType());
            switch (type) {
                case TINYINT:
                    bytes += 1;
                    break;
                case SMALLINT:
View Full Code Here

Examples of org.voltdb.VoltType

        // AbstractExpressions
        // That's ok really, because all we really need to do is look at size of
        // the strings
        boolean numerals_only = true;
        for (Column catalog_col : CatalogUtil.getSortedCatalogItems(catalog_tbl.getColumns(), "index")) {
            VoltType type = VoltType.get((byte) catalog_col.getType());
            switch (type) {
                case TINYINT:
                    bytes += 1;
                    break;
                case SMALLINT:
View Full Code Here

Examples of org.voltdb.VoltType

                                           catalog_proc.getParameters().size(), catalog_proc.getName(), params.size());
                throw new Exception(msg);
            }
            int i = 0;
            for (ProcParameter catalog_param : catalog_proc.getParameters()) {
                VoltType vtype = VoltType.get(catalog_param.getType());
                Object value = VoltTypeUtil.getObjectFromString(vtype, params.get(i));
               
                // HACK: Allow us to send one-element array parameters
                if (catalog_param.getIsarray()) {
                    switch (vtype) {
View Full Code Here

Examples of org.voltdb.VoltType

            ((JSONSerializable) value).fromJSON(new JSONObject(json_value), catalog_db);
        }
        // Everything else
        else {
            // LOG.debug(json_value + " -> " + field_class);
            VoltType volt_type = VoltType.typeFromClass(field_class);
            value = VoltTypeUtil.getObjectFromString(volt_type, json_value);
        }
        return (value);
    }
View Full Code Here

Examples of org.voltdb.VoltType

                                    .value(this.keep_zero_entries);
                        }
                        break;
                    }
                    case VALUE_TYPE: {
                        VoltType vtype = (VoltType)field.get(this);
                        stringer.key(element.name()).value(vtype.name());
                        break;
                    }
                    default:
                        stringer.key(element.name())
                                .value(field.get(this));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.