cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r800440 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: db/ColumnFamilyStore.java dht/BootstrapMetadataVerbHandler.java net/MessagingService.java net/TcpConnection.java net/io/ContentStreamState.java service/StreamManager.java
Date Mon, 03 Aug 2009 16:01:01 GMT
Author: jbellis
Date: Mon Aug  3 16:01:00 2009
New Revision: 800440

URL: http://svn.apache.org/viewvc?rev=800440&view=rev
Log:
renames and cleanup for bootstrap-related code.
patch by Sandeep Tata; reviewed by jbellis for CASSANDRA-213

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/BootstrapMetadataVerbHandler.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/io/ContentStreamState.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StreamManager.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Mon
Aug  3 16:01:00 2009
@@ -344,9 +344,9 @@
 
     String getNextFileName()
     {
-        // Psuedo increment so that we do not generate consecutive numbers
+        // increment twice so that we do not generate consecutive numbers
         fileIndexGenerator_.incrementAndGet();
-        return table_ + "-" + columnFamily_ + "-" + fileIndexGenerator_.incrementAndGet();
+        return String.format("%s-%s-Data.db", columnFamily_, fileIndexGenerator_.incrementAndGet());
     }
 
     /*
@@ -1033,8 +1033,11 @@
             rangeWriter.closeAndOpenReader(DatabaseDescriptor.getKeysCachedFraction(table_));
             if (fileList != null)
             {
+                fileList.add(rangeWriter.indexFilename());
+                fileList.add(rangeWriter.filterFilename());
                 fileList.add(rangeWriter.getFilename());
             }
+            result = true;
         }
 
         if (logger_.isDebugEnabled())

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/BootstrapMetadataVerbHandler.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/BootstrapMetadataVerbHandler.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/BootstrapMetadataVerbHandler.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/BootstrapMetadataVerbHandler.java
Mon Aug  3 16:01:00 2009
@@ -125,8 +125,9 @@
               logger_.debug("Forcing compaction ...");
             /* Get the counting bloom filter for each endpoint and the list of files that
need to be streamed */
             List<String> fileList = new ArrayList<String>();
-            boolean bVal = table.forceCompaction(ranges, target, fileList);             
  
+            table.forceCompaction(ranges, target, fileList);
             doHandoff(target, fileList, tName);
+            //In Handoff, Streaming the file also deletes the file, so no cleanup needed
           
         }
     }
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Mon
Aug  3 16:01:00 2009
@@ -601,7 +601,7 @@
         return messageSerializerExecutor_;
     }
     
-    public static ExecutorService getDeserilizationExecutor()
+    public static ExecutorService getDeserializationExecutor()
     {
         return messageDeserializerExecutor_;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java Mon Aug
 3 16:01:00 2009
@@ -469,7 +469,7 @@
                         }
                         
                         /* Deserialize and handle the message */
-                        MessagingService.getDeserilizationExecutor().submit( new MessageDeserializationTask(pH.serializerType_,
bytes) );                                                  
+                        MessagingService.getDeserializationExecutor().submit( new MessageDeserializationTask(pH.serializerType_,
bytes) );                                                  
                         tcpReader_.resetState();
                     }
                     else
@@ -490,7 +490,8 @@
             }
             finally
             {
-                turnOnInterestOps(key_, SelectionKey.OP_READ);
+                if (key_.isValid()) //not valid if closeSocket has been called above
+                    turnOnInterestOps(key_, SelectionKey.OP_READ);
             }
         }
         

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/io/ContentStreamState.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/io/ContentStreamState.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/io/ContentStreamState.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/io/ContentStreamState.java
Mon Aug  3 16:01:00 2009
@@ -68,7 +68,7 @@
     {        
         SocketChannel socketChannel = stream_.getStream();
         InetSocketAddress remoteAddress = (InetSocketAddress)socketChannel.socket().getRemoteSocketAddress();
-        String remoteHost = remoteAddress.getHostName();  
+        String remoteHostIp = remoteAddress.getAddress().getHostAddress();
         createFileChannel();
         if ( streamContext_ != null )
         {  
@@ -82,7 +82,7 @@
             {
                 /* Ask the source node to re-stream this file. */
                 streamStatus_.setAction(StreamContextManager.StreamCompletionAction.STREAM);
               
-                handleStreamCompletion(remoteHost);
+                handleStreamCompletion(remoteHostIp);
                 /* Delete the orphaned file. */
                 File file = new File(streamContext_.getTargetFile());
                 file.delete();
@@ -92,7 +92,7 @@
             {       
                 if (logger_.isDebugEnabled())
                     logger_.debug("Removing stream context " + streamContext_);         
       
-                handleStreamCompletion(remoteHost);                              
+                handleStreamCompletion(remoteHostIp);                              
                 bytesRead_ = 0L;
                 fc_.close();
                 morphState();

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StreamManager.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StreamManager.java?rev=800440&r1=800439&r2=800440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StreamManager.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StreamManager.java Mon
Aug  3 16:01:00 2009
@@ -44,7 +44,7 @@
     
     public static class BootstrapTerminateVerbHandler implements IVerbHandler
     {
-        private static Logger logger_ = Logger.getLogger( BootstrapInitiateDoneVerbHandler.class
);
+        private static Logger logger_ = Logger.getLogger( BootstrapTerminateVerbHandler.class
);
 
         public void doVerb(Message message)
         {



Mime
View raw message