cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r924481 - in /cassandra/trunk/src/java/org/apache/cassandra: io/DeletionService.java net/MessagingService.java
Date Wed, 17 Mar 2010 20:41:25 GMT
Author: gdusbabek
Date: Wed Mar 17 20:41:25 2010
New Revision: 924481

URL: http://svn.apache.org/viewvc?rev=924481&view=rev
Log:
cleanup DeletionService and MessagingService. Patch by Gary Dusbabek, reviewed by Jonathan
Ellis. CASSANDRA-880

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/io/DeletionService.java
    cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/DeletionService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/DeletionService.java?rev=924481&r1=924480&r2=924481&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/DeletionService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/DeletionService.java Wed Mar 17 20:41:25
2010
@@ -26,8 +26,8 @@ import java.io.IOException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 
+
 import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
-import org.apache.cassandra.concurrent.NamedThreadFactory;
 import org.apache.cassandra.io.util.FileUtils;
 import org.apache.cassandra.utils.WrappedRunnable;
 
@@ -54,41 +54,4 @@ public class DeletionService
     {
         executor.submit(new Runnable() { public void run() { }}).get();
     }
-
-    public static void submitDeleteWithRetry(String file)
-    {
-        submitDeleteWithRetry(file, 0);
-    }
-
-    private static void submitDeleteWithRetry(final String file, final int retryCount)
-    {
-        Runnable deleter = new WrappedRunnable()
-        {
-            @Override
-            protected void runMayThrow() throws IOException
-            {
-                if (!new File(file).delete())
-                {
-                    if (retryCount > MAX_RETRIES)
-                        throw new IOException("Unable to delete " + file + " after " + MAX_RETRIES
+ " tries");
-                    new Thread(new Runnable()
-                    {
-                        public void run()
-                        {
-                            try
-                            {
-                                Thread.sleep(10000);
-                            }
-                            catch (InterruptedException e)
-                            {
-                                throw new AssertionError(e);
-                            }
-                            submitDeleteWithRetry(file, retryCount + 1);
-                        }
-                    }, "Delete submission: " + file).start();
-                }
-            }
-        };
-        executor.submit(deleter);
-    }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=924481&r1=924480&r2=924481&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Wed Mar 17 20:41:25
2010
@@ -20,7 +20,6 @@ package org.apache.cassandra.net;
 
 import org.apache.cassandra.concurrent.*;
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.gms.FailureDetector;
 import org.apache.cassandra.gms.IFailureDetectionEventListener;
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.net.io.SerializerType;
@@ -55,8 +54,6 @@ public class MessagingService implements
 
     /** we preface every message with this number so the recipient can validate the sender
is sane */
     public static final int PROTOCOL_MAGIC = 0xCA552DFA;
-    /* Verb Handler for the Response */
-    public static final String responseVerbHandler_ = "RESPONSE";
 
     /* This records all the results mapped by message Id */
     private static ExpiringMap<String, IAsyncCallback> callbackMap_;
@@ -79,11 +76,6 @@ public class MessagingService implements
     
     private SocketThread socketThread;
 
-    public static int getVersion()
-    {
-        return version_;
-    }
-
     public Object clone() throws CloneNotSupportedException
     {
         //Prevents the singleton from being cloned
@@ -401,11 +393,6 @@ public class MessagingService implements
         if (magic != PROTOCOL_MAGIC)
             throw new IOException("invalid protocol header");
     }
-    
-    public static boolean isEqual(byte digestA[], byte digestB[])
-    {
-        return MessageDigest.isEqual(digestA, digestB);
-    }
 
     public static int getBits(int x, int p, int n)
     {



Mime
View raw message