Package org.json_voltpatches

Examples of org.json_voltpatches.JSONStringer.object()


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

            js.object();
            js.key("type");
            js.value(getExceptionType().ordinal());
            js.key("message");
            js.value(m_message);
            js.endObject();
View Full Code Here


    @Override
    public String toJSONString() {
        JSONStringer stringer = new JSONStringer();
        try {
            stringer.object();
            super.toJSONString(stringer);

            stringer.key(Members.EXECUTE_LIST.name()).array();
            for (AbstractPlanNode node : m_list) {
                stringer.value(node.getPlanNodeId().intValue());
View Full Code Here

    @Override
    public String toJSONString() {
        JSONStringer stringer = new JSONStringer();
        try
        {
            stringer.object();
            toJSONString(stringer);
            stringer.endObject();
        }
        catch (JSONException e)
        {
View Full Code Here

        if (m_verboseExplainForDebugging && m_hasSignificantOutputSchema) {
            sb.append(indent + "Detailed Output Schema: ");
            JSONStringer stringer = new JSONStringer();
            try
            {
                stringer.object();
                outputSchemaToJSON(stringer);
                stringer.endObject();
                sb.append(stringer.toString());
            }
            catch (Exception e)
View Full Code Here

    @Override
    public String toJSONString() {
        JSONStringer stringer = new JSONStringer();
        try {
            stringer.object();
            toJSONString(stringer);
            stringer.endObject();
        } catch (JSONException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
View Full Code Here

    public String toJSONString()
    {
        JSONStringer stringer = new JSONStringer();

        try {
            stringer.object();
            stringer.key("partitionPairs").array();

            for (PartitionPair pair : partitionPairs) {
                stringer.object();
View Full Code Here

        try {
            stringer.object();
            stringer.key("partitionPairs").array();

            for (PartitionPair pair : partitionPairs) {
                stringer.object();

                stringer.key("srcPartition").value(pair.srcPartition);
                stringer.key("destPartition").value(pair.destPartition);
                stringer.key("rangeStart").value(pair.rangeStart);
                stringer.key("rangeEnd").value(pair.rangeEnd);
View Full Code Here

        @Override
        public void run() {
            try {
                JSONStringer js = new JSONStringer();
                js.object();
                js.key("role").value(m_config.m_replicationRole.ordinal());
                js.key("active").value(m_rvdb.getReplicationActive());
                js.endObject();

                ZooKeeper zk = m_rvdb.getHostMessenger().getZK();
View Full Code Here

        for (Map.Entry<Integer, ArrayList<Integer>> e : partToHosts.entrySet()) {
            Collections.sort(e.getValue());
        }

        JSONStringer stringer = new JSONStringer();
        stringer.object();
        stringer.key("hostcount").value(m_hostCount);
        stringer.key("kfactor").value(getReplicationFactor());
        stringer.key("sites_per_host").value(sitesPerHost);
        stringer.key("partitions").array();
        for (int part = 0; part < partitionCount; part++)
View Full Code Here

        stringer.key("kfactor").value(getReplicationFactor());
        stringer.key("sites_per_host").value(sitesPerHost);
        stringer.key("partitions").array();
        for (int part = 0; part < partitionCount; part++)
        {
            stringer.object();
            stringer.key("partition_id").value(part);
            // This two-line magic deterministically spreads the partition leaders
            // evenly across the cluster at startup.
            int index = part % (getReplicationFactor() + 1);
            int master = partToHosts.get(part).get(index);
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.