Package org.voltdb.catalog

Examples of org.voltdb.catalog.ProcParameter


        Set<String> param_order = PartitionerUtil.generateProcParameterOrder(this.info, catalog_db, catalog_proc, hints);
        assertNotNull(param_order);
        assertFalse(param_order.isEmpty());
       
        // We should get back the first ProcParameter for each Procedure, since that maps to S_ID
        ProcParameter catalog_proc_param = CatalogKey.getFromKey(catalog_db, CollectionUtil.first(param_order), ProcParameter.class);
        assertNotNull(catalog_proc_param);
        assertEquals(0, catalog_proc_param.getIndex());
    }
View Full Code Here


     * testProcedureEntrySerialization
     */
    @Test
    public void testProcedureEntrySerialization() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        ProcParameter catalog_params[] = {
            this.getProcParameter(catalog_proc, 0),
            this.getProcParameter(catalog_proc, 1),
        };
       
        ProcedureEntry entries[] = {
View Full Code Here

    /**
     * testFindBestProcParameter
     */
    public void testFindBestProcParameter() throws Exception {
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        ProcParameter catalog_param = null;

        this.partitioner.init(this.hints);
        catalog_param = this.partitioner.findBestProcParameter(this.hints, catalog_proc);
        assertNotNull(catalog_param);
        assertEquals(0, catalog_param.getIndex());
    }
View Full Code Here

            @Override
            public void whenSelecting(String selectedItemName)
            {
                Procedure curProc = ProcEnv.getProcedure(m_lstProcNames.getSelectedValue().toString());
                ProcParameter para = curProc.getParameters().get(getSelectedIndex());
                RandomDistributionEditorManager.display(m_paneParaDistribution, para);
            }
        });
    }
View Full Code Here

                        } // FOR
                    }
                }
                for (ParameterMapping m : mappings) {
                    if (trace.val) LOG.trace("Mapping: " + m);
                    ProcParameter catalog_proc_param = m.getProcParameter();
                    if (catalog_proc_param.getIsarray()) {
                        Object proc_inner_args[] = (Object[])procParams[m.getProcParameter().getIndex()];
                        if (trace.val)
                            LOG.trace(CatalogUtil.getDisplayName(m.getProcParameter(), true) + " is an array: " +
                                      Arrays.toString(proc_inner_args));
                       
View Full Code Here

        }
       
        // Convert parameters to the proper type
        Object parameters[] = new Object[expectedParams];
        for (int i = 0; i < expectedParams; i++) {
            ProcParameter catalog_param = catalog_proc.getParameters().get(i);
            assert(catalog_param != null) : String.format("Null %s parameter at %d", catalog_proc.getName(), i);
            VoltType vt = VoltType.get(catalog_param.getType());
           
            try {
                // Split into array
                if (catalog_param.getIsarray()) {
                    List<String> arr = (List<String>)CollectionUtil.addAll(new ArrayList<String>(),
                                                                           params[i].split(","));
                    Object inner[] = new Object[arr.size()];
                    for (int ii = 0, cnt = arr.size(); ii < cnt; ii++) {
                        inner[ii] = VoltTypeUtil.getObjectFromString(vt, arr.get(ii));
                    } // FOR
                    parameters[i] = inner;
                // Scalar Paramter
                } else {
                    parameters[i] = VoltTypeUtil.getObjectFromString(vt, params[i]);
                }
            } catch (ParseException ex) {
                LOG.error("Invalid parameter #" + i + ": " + params[i], ex);
                return (null);
            }
            if (LOG.isDebugEnabled())
                LOG.debug(String.format("%s: %s [%s / %s]", catalog_param.fullName(),
                                                            (catalog_param.getIsarray() ? Arrays.toString((Object[])parameters[i]) : parameters[i]),
                                                            vt, parameters[i].getClass()));
        } // FOR
       
        LOG.info(String.format("Invoking %s [params=%s]",
                               catalog_proc.getName(), Arrays.toString(parameters)));
View Full Code Here

    /**
     * testMultiProcParameter
     */
    public void testMultiProcParameter() throws Exception {
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        ProcParameter params[] = {
            catalog_proc.getParameters().get(0),
            catalog_proc.getParameters().get(1),
        };
        int num_params = catalog_proc.getParameters().size();
        MultiProcParameter item0 = MultiProcParameter.get(params);
View Full Code Here

        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetNewDestination.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
            this.getProcParameter(clone_db, catalog_proc, 1),   // SF_TYPE
        };
        MultiProcParameter mpp = MultiProcParameter.get(catalog_params);
        assertNotNull(mpp);
View Full Code Here

        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetAccessData.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
            this.getProcParameter(clone_db, catalog_proc, 1),   // AI_TYPE
        };
        MultiProcParameter mpp = MultiProcParameter.get(catalog_params);
        assertNotNull(mpp);
View Full Code Here

          .append("# of Batches: " + this.query_batches.size() + "\n");
       
        // Params
        sb.append("Transasction Parameters: [" + this.params.length + "]\n");
        for (int i = 0; i < this.params.length; i++) {
            ProcParameter catalog_param = catalog_proc.getParameters().get(i);
            Object param = this.params[i];
            String type_name = VoltType.get(catalog_param.getType()).name();
            if (ClassUtil.isArray(param)) type_name += "[" + ((Object[])param).length + "]";
           
            sb.append("   [" + i + "] -> ")
              .append(String.format("%-11s ", "(" + type_name + ")"))
              .append(ClassUtil.isArray(param) ? Arrays.toString((Object[])param) : param)
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.ProcParameter

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.