Package org.json_voltpatches

Examples of org.json_voltpatches.JSONArray


                    if (digest.has("instanceId")) {
                        iid = new InstanceId(digest.getJSONObject("instanceId"));
                    }
                    named_s.setInstanceId(iid);
                    TreeSet<String> tableSet = new TreeSet<String>();
                    JSONArray tables = digest.getJSONArray("tables");
                    for (int ii = 0; ii < tables.length(); ii++) {
                        tableSet.add(tables.getString(ii));
                    }
                    named_s.m_digestTables.add(tableSet);
                    named_s.m_digests.add(f);
                } else if (f.getName().endsWith(".jar")) {
                    String nonce = parseNonceFromSnapshotFilename(f.getName());
View Full Code Here


    private static void parseJSONObject(JSONObject jsonObject) {
        try {
            m_workingDir = jsonObject.getString("workingDir");

            m_logPaths.clear();
            JSONArray jsonArray = jsonObject.getJSONArray("log4jDst");
            for (int i = 0; i < jsonArray.length(); i++) {
                String path = jsonArray.getJSONObject(i).getString("path");
                m_logPaths.add(path);
            }
        } catch (JSONException e) {
            System.err.println(e.getMessage());
        }
View Full Code Here

            InetAddress addr = null;
            int httpPort = VoltDB.DEFAULT_HTTP_PORT;
            try {
                String localMetadata = VoltDB.instance().getLocalMetadata();
                JSONObject jsObj = new JSONObject(localMetadata);
                JSONArray interfaces = jsObj.getJSONArray("interfaces");
                //The first interface is external interface if specified.
                String iface = interfaces.getString(0);
                addr = InetAddress.getByName(iface);
                httpPort = jsObj.getInt("httpPort");
            } catch (Exception e) {
                logger.warn("Failed to get HTTP interface information.", e);
            }
View Full Code Here

    public static String formatHostMetadataFromJSON(String json) {
        try {
            JSONObject obj = new JSONObject(json);
            StringBuilder sb = new StringBuilder();

            JSONArray interfaces = (JSONArray) obj.get("interfaces");

            for (int ii = 0; ii < interfaces.length(); ii++) {
                sb.append(interfaces.getString(ii));
                if (ii + 1 < interfaces.length()) {
                    sb.append(" ");
                }
            }
            sb.append(" ");
            sb.append(obj.getString("clientPort")).append(',');
View Full Code Here

        expr.m_left = AbstractExpression.fromJSONChild(obj, Members.LEFT.name(), tableScan);
        expr.m_right = AbstractExpression.fromJSONChild(obj, Members.RIGHT.name(), tableScan);

        if (!obj.isNull(Members.ARGS.name())) {
            JSONArray jarray = obj.getJSONArray(Members.ARGS.name());
            ArrayList<AbstractExpression> arguments = new ArrayList<AbstractExpression>();
            loadFromJSONArray(arguments, jarray, tableScan);
            expr.setArgs(arguments);
        }
View Full Code Here

        return expr;
    }

    public static List<AbstractExpression> fromJSONArrayString(String jsontext, StmtTableScan tableScan) throws JSONException
    {
        JSONArray jarray = new JSONArray(jsontext);
        List<AbstractExpression> result = new ArrayList<AbstractExpression>();
        loadFromJSONArray(result, jarray, tableScan);
        return result;
    }
View Full Code Here

    throws JSONException
    {
        if( parent.isNull(label) ) {
            return;
        }
        JSONArray jarray = parent.getJSONArray(label);
        loadFromJSONArray(starter, jarray, tableScan);
    }
View Full Code Here

            m_generation = jsObj.getLong("generation");
            m_partitionId = jsObj.getInt("partitionId");
            m_signature = jsObj.getString("signature");
            m_signatureBytes = m_signature.getBytes(Constants.UTF8ENCODING);
            m_tableName = jsObj.getString("tableName");
            JSONArray columns = jsObj.getJSONArray("columns");
            for (int ii = 0; ii < columns.length(); ii++) {
                JSONObject column = columns.getJSONObject(ii);
                m_columnNames.add(column.getString("name"));
                int columnType = column.getInt("type");
                m_columnTypes.add(columnType);
                m_columnLengths.add(column.getInt("length"));
            }
View Full Code Here

            if (digest_detail.has("newPartitionCount")) {
                newParitionCount = digest_detail.getInt("newPartitionCount");
            }

            if (digest_detail.has("tables")) {
                JSONArray tableObj = digest_detail.getJSONArray("tables");
                for (int i = 0; i < tableObj.length(); i++) {
                    digestTableNames.add(tableObj.getString(i));
                }
            }
        }
        catch (IOException ioe)
        {
View Full Code Here

                    String msg = "Database actions are not consistent, please enter " +
                        "the same database action on the command-line.";
                    throw new RuntimeException(msg);
                }

                JSONArray snapInfos = json.getJSONArray("snapInfos");
                int snapInfoCnt = snapInfos.length();
                for (int i=0; i < snapInfoCnt; i++) {
                    JSONObject jsonInfo = snapInfos.getJSONObject(i);
                    SnapshotInfo info = new SnapshotInfo(jsonInfo);
                    Set<SnapshotInfo> fragments = snapshotFragments.get(info.nonce);
                    if (fragments == null) {
                        fragments = new HashSet<SnapshotInfo>();
                        snapshotFragments.put(info.nonce, fragments);
View Full Code Here

TOP

Related Classes of org.json_voltpatches.JSONArray

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.