Package org.json_voltpatches

Examples of org.json_voltpatches.JSONStringer.object()


        if (m_replicationActive != active) {
            m_replicationActive = active;

            try {
                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();
View Full Code Here


            File configInfo = new File(pathToConfigInfo);

            byte jsonBytes[] = null;
            try {
                JSONStringer stringer = new JSONStringer();
                stringer.object();

                stringer.key("workingDir").value(System.getProperty("user.dir"));
                stringer.key("pid").value(CLibrary.getpid());

                stringer.key("log4jDst").array();
View Full Code Here

                stringer.key("log4jDst").array();
                Enumeration<?> appenders = Logger.getRootLogger().getAllAppenders();
                while (appenders.hasMoreElements()) {
                    Appender appender = (Appender) appenders.nextElement();
                    if (appender instanceof FileAppender){
                        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();
View Full Code Here

                    Logger logger = (Logger) loggers.nextElement();
                    appenders = logger.getAllAppenders();
                    while (appenders.hasMoreElements()) {
                        Appender appender = (Appender) appenders.nextElement();
                        if (appender instanceof FileAppender){
                            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();
View Full Code Here

    public static String makeSnapshotRequest(SnapshotRequestConfig config)
    {
        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);
View Full Code Here

    @Override
    public String toJSONString() {
        JSONStringer js = new JSONStringer();
        try {

            js.object();

            // status code (1 byte)
            js.key(JSON_STATUS_KEY).value(getStatusCode());

            // column schema
View Full Code Here

        try {
            final FileOutputStream fos = new FileOutputStream(f);
            StringWriter sw = new StringWriter();
            JSONStringer stringer = new JSONStringer();
            try {
                stringer.object();
                stringer.key("version").value(1);
                stringer.key("txnId").value(txnId);
                stringer.key("timestamp").value(timestamp);
                stringer.key("timestampString").value(SnapshotUtil.formatHumanReadableDate(timestamp));
                stringer.key("newPartitionCount").value(newPartitionCount);
View Full Code Here

                    stringer.value(tables.get(ii).getTypeName());
                }
                stringer.endArray();
                stringer.key("exportSequenceNumbers").array();
                for (Map.Entry<String, Map<Integer, Pair<Long, Long>>> entry : exportSequenceNumbers.entrySet()) {
                    stringer.object();

                    stringer.key("exportTableName").value(entry.getKey());

                    stringer.key("sequenceNumberPerPartition").array();
                    for (Map.Entry<Integer, Pair<Long,Long>> sequenceNumber : entry.getValue().entrySet()) {
View Full Code Here

                    stringer.key("exportTableName").value(entry.getKey());

                    stringer.key("sequenceNumberPerPartition").array();
                    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();
                    }
View Full Code Here

        int size = 0;
        try {
            for (Pair<AbstractExpression, Boolean> p : m_predicates) {
                final AbstractExpression predicate = p.getFirst();
                JSONStringer stringer = new JSONStringer();
                stringer.object();
                stringer.key("triggersDelete").value(p.getSecond());
                // If the predicate is null, EE will serialize all rows to the corresponding data
                // target. It's the same as passing an always-true expression,
                // 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.
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.