cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r964141 - in /cassandra/branches/cassandra-0.6: src/java/org/apache/cassandra/config/ test/unit/org/apache/cassandra/config/ test/unit/org/apache/cassandra/service/
Date Wed, 14 Jul 2010 19:20:46 GMT
Author: jbellis
Date: Wed Jul 14 19:20:46 2010
New Revision: 964141

URL: http://svn.apache.org/viewvc?rev=964141&view=rev
Log:
r/m MetaData serialize code that isn't relevant until 0.7.  patch by jbellis

Removed:
    cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/CFMetaData.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/KSMetaData.java
    cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/CFMetaData.java?rev=964141&r1=964140&r2=964141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/CFMetaData.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/CFMetaData.java
Wed Jul 14 19:20:46 2010
@@ -61,57 +61,6 @@ public final class CFMetaData
                + "Columns Sorted By: " + comparator + "\n";
     }
 
-    public static byte[] serialize(CFMetaData cfm) throws IOException
-    {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        DataOutputStream dout = new DataOutputStream(bout);
-        dout.writeUTF(cfm.tableName);
-        dout.writeUTF(cfm.cfName);
-        dout.writeUTF(cfm.columnType);
-        dout.writeUTF(cfm.comparator.getClass().getName());
-        dout.writeBoolean(cfm.subcolumnComparator != null);
-        if (cfm.subcolumnComparator != null)
-            dout.writeUTF(cfm.subcolumnComparator.getClass().getName());
-        dout.writeBoolean(cfm.comment != null);
-        if (cfm.comment != null)
-            dout.writeUTF(cfm.comment);
-        dout.writeDouble(cfm.rowCacheSize);
-        dout.writeDouble(cfm.keyCacheSize);
-        dout.close();
-        return bout.toByteArray();
-}
-
-    public static CFMetaData deserialize(InputStream in) throws IOException
-    {
-
-        DataInputStream din = new DataInputStream(in);
-        String tableName = din.readUTF();
-        String cfName = din.readUTF();
-        String columnType = din.readUTF();
-        AbstractType comparator = null;
-        try
-        {
-            comparator = (AbstractType)Class.forName(din.readUTF()).newInstance();
-        }
-        catch (Exception ex)
-        {
-            throw new IOException(ex);
-        }
-        AbstractType subcolumnComparator = null;
-        try
-        {
-            subcolumnComparator = din.readBoolean() ? (AbstractType)Class.forName(din.readUTF()).newInstance()
: null;
-        }
-        catch (Exception ex)
-        {
-
-        }
-        String comment = din.readBoolean() ? din.readUTF() : null;
-        double rowCacheSize = din.readDouble();
-        double keyCacheSize = din.readDouble();
-        return new CFMetaData(tableName, cfName, columnType, comparator, subcolumnComparator,
comment, rowCacheSize, keyCacheSize);
-    }
-
     public boolean equals(Object obj)
     {
         if (!(obj instanceof CFMetaData))

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/KSMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/KSMetaData.java?rev=964141&r1=964140&r2=964141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/KSMetaData.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/config/KSMetaData.java
Wed Jul 14 19:20:46 2010
@@ -73,64 +73,4 @@ public final class KSMetaData
         else
             return a.epSnitch.getClass().getName().equals(b.epSnitch.getClass().getName());
     }
-    
-    public static byte[] serialize(KSMetaData ksm) throws IOException
-    {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        DataOutputStream dout = new DataOutputStream(bout);
-        dout.writeUTF(ksm.name);
-        dout.writeBoolean(ksm.repStratClass != null);
-        if (ksm.repStratClass != null)
-            dout.writeUTF(ksm.repStratClass.getName());
-        dout.writeInt(ksm.replicationFactor);
-        dout.writeBoolean(ksm.epSnitch != null);
-        if (ksm.epSnitch != null)
-            dout.writeUTF(ksm.epSnitch.getClass().getName());
-        dout.writeInt(ksm.cfMetaData.size());
-        for (CFMetaData cfm : ksm.cfMetaData.values())
-            dout.write(CFMetaData.serialize(cfm));
-        dout.close();
-        return bout.toByteArray();
-    }
-
-    public static KSMetaData deserialize(InputStream in) throws IOException
-    {
-        DataInputStream din = new DataInputStream(in);
-        String name = din.readUTF();
-        Class<AbstractReplicationStrategy> repStratClass = null;
-        try
-        {
-            repStratClass = din.readBoolean() ? (Class<AbstractReplicationStrategy>)Class.forName(din.readUTF())
: null;
-        }
-        catch (Exception ex)
-        {
-            throw new IOException(ex);
-        }
-        int replicationFactor = din.readInt();
-        IEndPointSnitch epSnitch = null;
-        try
-        {
-            epSnitch = din.readBoolean() ? (IEndPointSnitch)Class.forName(din.readUTF()).newInstance()
: null;
-        }
-        catch (Exception ex)
-        {
-            throw new IOException(ex);
-        }
-        int cfsz = din.readInt();
-        KSMetaData ksm = new KSMetaData(name, repStratClass, replicationFactor, epSnitch);
-        for (int i = 0; i < cfsz; i++)
-        {
-            try
-            {
-                CFMetaData cfm = CFMetaData.deserialize(din);
-                ksm.cfMetaData.put(cfm.cfName, cfm);
-            }
-            catch (IOException ex)
-            {
-                System.err.println(ksm.name);
-                throw ex;
-            }
-        }
-        return ksm;
-    }
 }

Modified: cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java?rev=964141&r1=964140&r2=964141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java
(original)
+++ cassandra/branches/cassandra-0.6/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java
Wed Jul 14 19:20:46 2010
@@ -38,7 +38,6 @@ import org.apache.cassandra.utils.FBUtil
 import org.apache.cassandra.utils.MerkleTree;
 
 import org.apache.cassandra.CleanupHelper;
-import org.apache.cassandra.config.DatabaseDescriptorTest;
 import org.apache.cassandra.Util;
 
 import org.junit.Before;



Mime
View raw message