You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2009/12/28 23:20:53 UTC

svn commit: r894259 - in /incubator/cassandra/trunk: LICENSE.txt NOTICE.txt lib/flexjson-1.7.jar src/java/org/apache/cassandra/client/RingCache.java src/java/org/apache/cassandra/service/CassandraServer.java

Author: eevans
Date: Mon Dec 28 22:20:52 2009
New Revision: 894259

URL: http://svn.apache.org/viewvc?rev=894259&view=rev
Log:
consolidate json libraries

Patch by eevans; reviewed by jbellis for CASSANDRA-587

Removed:
    incubator/cassandra/trunk/lib/flexjson-1.7.jar
Modified:
    incubator/cassandra/trunk/LICENSE.txt
    incubator/cassandra/trunk/NOTICE.txt
    incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java

Modified: incubator/cassandra/trunk/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/LICENSE.txt?rev=894259&r1=894258&r2=894259&view=diff
==============================================================================
--- incubator/cassandra/trunk/LICENSE.txt (original)
+++ incubator/cassandra/trunk/LICENSE.txt Mon Dec 28 22:20:52 2009
@@ -209,8 +209,8 @@
 use of these libraries is subject to the terms and conditions of the 
 following licenses.
 
-For lib/flexjson-1.7.jar, lib/google-collect-1.0-rc1.jar, 
-lib/clhm-production.jar, and lib/json_simple-1.1.jar:
+For lib/google-collect-1.0-rc1.jar, lib/clhm-production.jar, and
+lib/json_simple-1.1.jar:
 
 While developed outside the ASF, these projects are also licensed under
 the Apache License 2.0. The full text of the Apache License 2.0 can be

Modified: incubator/cassandra/trunk/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/NOTICE.txt?rev=894259&r1=894258&r2=894259&view=diff
==============================================================================
--- incubator/cassandra/trunk/NOTICE.txt (original)
+++ incubator/cassandra/trunk/NOTICE.txt Mon Dec 28 22:20:52 2009
@@ -18,10 +18,7 @@
 This product makes use of JLine for console input (http://jline.sf.net).
 Copyright (c) 2002-2006, Marc Prud'hommeaux <mw...@cornell.edu>
 
-JSON serialization provided by Flexjson (http://flexjson.sf.net).
-Copyright 2007 Charlie Hubbard.
-
-JSON parsing provided by json-simple (http://code.google.com/p/json-simple/).
+JSON support provided by json-simple (http://code.google.com/p/json-simple/).
 Copyright 2006-2009 Yidong Fang.
 
 This product makes use of the JUnit test framework (http://junit.org).

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java?rev=894259&r1=894258&r2=894259&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/client/RingCache.java Mon Dec 28 22:20:52 2009
@@ -34,8 +34,8 @@
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.transport.TSocket;
+import org.json.simple.JSONValue;
 
-import flexjson.JSONTokener;
 import com.google.common.collect.BiMap;
 import com.google.common.collect.HashBiMap;
 
@@ -72,7 +72,7 @@
                 Cassandra.Client client = new Cassandra.Client(binaryProtocol);
                 socket.open();
 
-                Map<String,String> tokenToHostMap = (Map<String,String>) new JSONTokener(client.get_string_property(CassandraServer.TOKEN_MAP)).nextValue();
+                Map<String,String> tokenToHostMap = (Map<String,String>) JSONValue.parse(client.get_string_property(CassandraServer.TOKEN_MAP));
                 
                 BiMap<Token, InetAddress> tokenEndpointMap = HashBiMap.create();
                 for (Map.Entry<String,String> entry : tokenToHostMap.entrySet())

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java?rev=894259&r1=894258&r2=894259&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java Mon Dec 28 22:20:52 2009
@@ -36,8 +36,7 @@
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.Pair;
 import org.apache.thrift.TException;
-
-import flexjson.JSONSerializer;
+import org.json.simple.JSONValue;
 
 public class CassandraServer implements Cassandra.Iface
 {
@@ -529,7 +528,7 @@
         }
         else if (propertyName.equals(TOKEN_MAP))
         {
-            return new JSONSerializer().serialize(storageService.getStringEndpointMap());
+            return JSONValue.toJSONString(storageService.getStringEndpointMap());
         }
         else if (propertyName.equals("version"))
         {