Package org.json_voltpatches

Examples of org.json_voltpatches.JSONStringer.endObject()


            stringer.key("adminInterface").value(m_config.m_adminInterface);
            stringer.key("httpPort").value(m_config.m_httpPort);
            stringer.key("httpInterface").value(m_config.m_httpPortInterface);
            stringer.key("drPort").value(m_config.m_drAgentPortStart);
            stringer.key("drInterface").value(m_config.m_drInterface);
            stringer.endObject();
            JSONObject obj = new JSONObject(stringer.toString());
            // possibly atomic swap from null to realz
            m_localMetadata = obj.toString(4);
            hostLog.debug("System Metadata is: " + m_localMetadata);
        } catch (Exception e) {
View Full Code Here


                JSONStringer js = new JSONStringer();
                js.object();
                // Replication role should the be same across the cluster
                js.key("role").value(getReplicationRole().ordinal());
                js.key("active").value(m_replicationActive);
                js.endObject();

                getHostMessenger().getZK().setData(VoltZK.replicationconfig,
                                                   js.toString().getBytes("UTF-8"),
                                                   -1);
            } catch (Exception e) {
View Full Code Here

                        stringer.object();
                        stringer.key("path").value(new File(((FileAppender) appender).getFile()).getCanonicalPath());
                        if (appender instanceof DailyRollingFileAppender) {
                            stringer.key("format").value(((DailyRollingFileAppender)appender).getDatePattern());
                        }
                        stringer.endObject();
                    }
                }

                Enumeration<?> loggers = Logger.getRootLogger().getLoggerRepository().getCurrentLoggers();
                while (loggers.hasMoreElements()) {
View Full Code Here

                stringer.key("partitionTransactionIds").object();
                for (Map.Entry<Integer, Long> entry : partitionTransactionIds.entrySet()) {
                    stringer.key(entry.getKey().toString()).value(entry.getValue());
                }
                stringer.endObject();

                stringer.key("catalogCRC").value(catalogCRC);
                stringer.key("instanceId").value(instanceId.serializeToJSONObject());
                stringer.endObject();
            } catch (JSONException e) {
View Full Code Here

                }
                stringer.endObject();

                stringer.key("catalogCRC").value(catalogCRC);
                stringer.key("instanceId").value(instanceId.serializeToJSONObject());
                stringer.endObject();
            } catch (JSONException e) {
                throw new IOException(e);
            }

            sw.append(stringer.toString());
View Full Code Here

    {
        try {
            JSONStringer jsStringer = new JSONStringer();
            jsStringer.object();
            config.toJSONString(jsStringer);
            jsStringer.endObject();
            return jsStringer.toString();
        } catch (Exception e) {
            VoltDB.crashLocalVoltDB("Failed to serialize to JSON", true, e);
        }
        // unreachable;
View Full Code Here

                    for (Map.Entry<Integer, Pair<Long,Long>> sequenceNumber : entry.getValue().entrySet()) {
                        stringer.object();
                        stringer.key("partition").value(sequenceNumber.getKey());
                        //First value is the ack offset which matters for pauseless rejoin, but not persistence
                        stringer.key("exportSequenceNumber").value(sequenceNumber.getValue().getSecond());
                        stringer.endObject();
                    }
                    stringer.endArray();

                    stringer.endObject();
                }
View Full Code Here

                        stringer.key("exportSequenceNumber").value(sequenceNumber.getValue().getSecond());
                        stringer.endObject();
                    }
                    stringer.endArray();

                    stringer.endObject();
                }
                stringer.endArray();

                stringer.key("partitionTransactionIds").object();
                for (Map.Entry<Integer, Long> entry : partitionTransactionIds.entrySet()) {
View Full Code Here

                // but without the overhead of the evaluating the expression. This avoids the
                // overhead when there is only one data target that wants all the rows.
                if (predicate != null) {
                    stringer.key("predicateExpression").object();
                    predicate.toJSONString(stringer);
                    stringer.endObject();
                }
                stringer.endObject();
                predicates[i] = stringer.toString().getBytes(Charsets.UTF_8);
                size += predicates[i].length;
                i++;
View Full Code Here

                if (predicate != null) {
                    stringer.key("predicateExpression").object();
                    predicate.toJSONString(stringer);
                    stringer.endObject();
                }
                stringer.endObject();
                predicates[i] = stringer.toString().getBytes(Charsets.UTF_8);
                size += predicates[i].length;
                i++;
            }
        } catch (Exception e) {
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.