cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r901915 - in /incubator/cassandra/trunk: ./ interface/gen-java/org/apache/cassandra/service/ src/java/org/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/io/ test/unit/org/ test/unit/or...
Date Thu, 21 Jan 2010 23:10:25 GMT
Author: gdusbabek
Date: Thu Jan 21 23:10:23 2010
New Revision: 901915

URL: http://svn.apache.org/viewvc?rev=901915&view=rev
Log:
merging from 0.5 branch

Modified:
    incubator/cassandra/trunk/   (props changed)
    incubator/cassandra/trunk/CHANGES.txt
    incubator/cassandra/trunk/build.xml
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
  (props changed)
    incubator/cassandra/trunk/src/java/org/   (props changed)
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/io/Streaming.java
    incubator/cassandra/trunk/test/unit/org/   (props changed)
    incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootstrapTest.java

Propchange: incubator/cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,3 +1,3 @@
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5:888872-900497
+/incubator/cassandra/branches/cassandra-0.5:888872-901913

Modified: incubator/cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/CHANGES.txt?rev=901915&r1=901914&r2=901915&view=diff
==============================================================================
--- incubator/cassandra/trunk/CHANGES.txt (original)
+++ incubator/cassandra/trunk/CHANGES.txt Thu Jan 21 23:10:23 2010
@@ -15,6 +15,11 @@
  * add bin/sstablekeys (CASSNADRA-679)
 
 
+0.5.1
+ * ensure all files for an sstable are streamed to the same directory.
+   (CASSANDRA-716)
+
+
 0.5.0 final
  * avoid attempting to delete temporary bootstrap files twice (CASSANDRA-681)
  * fix bogus NaN in nodeprobe cfstats output (CASSANDRA-646)

Modified: incubator/cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/build.xml?rev=901915&r1=901914&r2=901915&view=diff
==============================================================================
--- incubator/cassandra/trunk/build.xml (original)
+++ incubator/cassandra/trunk/build.xml Thu Jan 21 23:10:23 2010
@@ -39,7 +39,7 @@
     <property name="test.name" value="*Test"/>
     <property name="test.unit.src" value="${test.dir}/unit"/>
     <property name="dist.dir" value="${build.dir}/dist"/>
-    <property name="version" value="0.5.0-rc3"/>
+    <property name="version" value="0.5.0"/>
     <property name="final.name" value="${ant.project.name}-${version}"/>
 
     <!-- http://cobertura.sourceforge.net/ -->

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-901913
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-901913
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-901913
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-901913
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-901913
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:749219-768588

Propchange: incubator/cassandra/trunk/src/java/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/src/java/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/src/java/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-901913
 /incubator/cassandra/trunk/src/java/org:749219-769885

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=901915&r1=901914&r2=901915&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Thu Jan 21 23:10:23 2010
@@ -912,9 +912,9 @@
         return tableLocations;
     }
 
-    public static String getDataFileLocationForTable(String table)
+    public synchronized static String getNextAvailableDataLocation()
     {
-        String dataFileDirectory = dataFileDirectories_[currentIndex_] + File.separator +
table;
+        String dataFileDirectory = dataFileDirectories_[currentIndex_];
         currentIndex_ = (currentIndex_ + 1) % dataFileDirectories_.length;
         return dataFileDirectory;
     }

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=901915&r1=901914&r2=901915&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 Thu
Jan 21 23:10:23 2010
@@ -330,7 +330,7 @@
     synchronized String getTempSSTablePath()
     {
         String fname = getTempSSTableFileName();
-        return new File(DatabaseDescriptor.getDataFileLocationForTable(table_), fname).getAbsolutePath();
+        return new File(DatabaseDescriptor.getNextAvailableDataLocation() + File.separator
+ table_, fname).getAbsolutePath();
     }
 
     public String getTempSSTableFileName()

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/io/Streaming.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/io/Streaming.java?rev=901915&r1=901914&r2=901915&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/io/Streaming.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/io/Streaming.java Thu Jan 21 23:10:23
2010
@@ -182,6 +182,9 @@
                 }
 
                 Map<String, String> fileNames = getNewNames(streamContexts);
+                Map<String, String> pathNames = new HashMap<String, String>();
+                for (String ssName : fileNames.keySet())
+                    pathNames.put(ssName, DatabaseDescriptor.getNextAvailableDataLocation());
                 /*
                  * For each of stream context's in the incoming message
                  * generate the new file names and store the new file names
@@ -190,7 +193,7 @@
                 for (StreamContextManager.StreamContext streamContext : streamContexts )
                 {
                     StreamContextManager.StreamStatus streamStatus = new StreamContextManager.StreamStatus(streamContext.getTargetFile(),
streamContext.getExpectedBytes() );
-                    String file = getNewFileNameFromOldContextAndNames(fileNames, streamContext);
+                    String file = getNewFileNameFromOldContextAndNames(fileNames, pathNames,
streamContext);
 
                     if (logger.isDebugEnabled())
                       logger.debug("Received Data from  : " + message.getFrom() + " " + streamContext.getTargetFile()
+ " " + file);
@@ -211,6 +214,7 @@
         }
 
         public String getNewFileNameFromOldContextAndNames(Map<String, String> fileNames,
+                                                           Map<String, String> pathNames,
                 StreamContextManager.StreamContext streamContext)
         {
             File sourceFile = new File( streamContext.getTargetFile() );
@@ -219,12 +223,14 @@
             String ssTableNum = piece[1];
             String typeOfFile = piece[2];
 
-            String newFileNameExpanded = fileNames.get( streamContext.getTable() + "-" +
cfName + "-" + ssTableNum );
+            String newFileNameExpanded = fileNames.get(streamContext.getTable() + "-" + cfName
+ "-" + ssTableNum);
+            String path = pathNames.get(streamContext.getTable() + "-" + cfName + "-" + ssTableNum);
             //Drop type (Data.db) from new FileName
             String newFileName = newFileNameExpanded.replace("Data.db", typeOfFile);
-            return DatabaseDescriptor.getDataFileLocationForTable(streamContext.getTable())
+ File.separator + newFileName;
+            return path + File.separator + streamContext.getTable() + File.separator + newFileName;
         }
 
+        // todo: this method needs to be private, or package at the very least for easy unit
testing.
         public Map<String, String> getNewNames(StreamContextManager.StreamContext[]
streamContexts) throws IOException
         {
             /*

Propchange: incubator/cassandra/trunk/test/unit/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 21 23:10:23 2010
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/test/unit/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/test/unit/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-900497
+/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-901913
 /incubator/cassandra/trunk/test/unit/org:749219-768583

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootstrapTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootstrapTest.java?rev=901915&r1=901914&r2=901915&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootstrapTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BootstrapTest.java Thu Jan
21 23:10:23 2010
@@ -23,8 +23,10 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.net.io.StreamContextManager;
 import org.apache.cassandra.io.Streaming;
 
@@ -36,18 +38,22 @@
     public void testGetNewNames() throws IOException
     {
         StreamContextManager.StreamContext[] streamContexts = new StreamContextManager.StreamContext[3];
-        streamContexts[0] = new StreamContextManager.StreamContext("/foo/Standard1-500-Data.db",
100, "Keyspace1");
-        streamContexts[1] = new StreamContextManager.StreamContext("/foo/Standard1-500-Index.db",
100, "Keyspace1");
-        streamContexts[2] = new StreamContextManager.StreamContext("/foo/Standard1-500-Filter.db",
100, "Keyspace1");
+        streamContexts[0] = new StreamContextManager.StreamContext("/baz/foo/Standard1-500-Data.db",
100, "Keyspace1");
+        streamContexts[1] = new StreamContextManager.StreamContext("/bar/foo/Standard1-500-Index.db",
100, "Keyspace1");
+        streamContexts[2] = new StreamContextManager.StreamContext("/bad/foo/Standard1-500-Filter.db",
100, "Keyspace1");
         Streaming.StreamInitiateVerbHandler bivh = new Streaming.StreamInitiateVerbHandler();
         Map<String, String> fileNames = bivh.getNewNames(streamContexts);
+        Map<String, String> paths = new HashMap<String, String>();
+        for (String ssName : fileNames.keySet())
+            paths.put(ssName, DatabaseDescriptor.getNextAvailableDataLocation());
+        assertEquals(1, paths.size());
         String result = fileNames.get("Keyspace1-Standard1-500");
         assertEquals(true, result.contains("Standard1"));
         assertEquals(true, result.contains("Data.db"));
         assertEquals(1, fileNames.entrySet().size());
 
-        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, streamContexts[0])).getName().matches("Standard1-tmp-\\d+-Data.db"));
-        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, streamContexts[1])).getName().matches("Standard1-tmp-\\d+-Index.db"));
-        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, streamContexts[2])).getName().matches("Standard1-tmp-\\d+-Filter.db"));
+        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, paths, streamContexts[0])).getName().matches("Standard1-tmp-\\d+-Data.db"));
+        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, paths, streamContexts[1])).getName().matches("Standard1-tmp-\\d+-Index.db"));
+        assertTrue(new File(bivh.getNewFileNameFromOldContextAndNames(fileNames, paths, streamContexts[2])).getName().matches("Standard1-tmp-\\d+-Filter.db"));
     }
 }



Mime
View raw message