cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [5/6] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Thu, 08 Jan 2015 04:14:58 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	test/unit/org/apache/cassandra/db/DirectoriesTest.java


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5ac5ee66
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5ac5ee66
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5ac5ee66

Branch: refs/heads/cassandra-2.1
Commit: 5ac5ee666d754e39db8dcad474a51e140f3511ef
Parents: dcc90ef ad37533
Author: Yuki Morishita <yukim@apache.org>
Authored: Wed Jan 7 22:13:15 2015 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Wed Jan 7 22:13:15 2015 -0600

----------------------------------------------------------------------
 .../apache/cassandra/db/DirectoriesTest.java    | 25 ++++++++------------
 1 file changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5ac5ee66/test/unit/org/apache/cassandra/db/DirectoriesTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/DirectoriesTest.java
index 34d10d2,c4471e5..b1c51ee
--- a/test/unit/org/apache/cassandra/db/DirectoriesTest.java
+++ b/test/unit/org/apache/cassandra/db/DirectoriesTest.java
@@@ -19,19 -19,13 +19,21 @@@ package org.apache.cassandra.db
  
  import java.io.File;
  import java.io.IOException;
 -import java.util.*;
 -import java.util.concurrent.*;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.IdentityHashMap;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Set;
 +import java.util.concurrent.Callable;
 +import java.util.concurrent.Executors;
 +import java.util.concurrent.Future;
  
+ import org.apache.commons.lang3.StringUtils;
+ 
  import org.junit.AfterClass;
 -import org.junit.Assert;
  import org.junit.BeforeClass;
  import org.junit.Test;
  
@@@ -42,7 -35,8 +44,8 @@@ import org.apache.cassandra.db.Director
  import org.apache.cassandra.io.sstable.Component;
  import org.apache.cassandra.io.sstable.Descriptor;
  import org.apache.cassandra.io.util.FileUtils;
 +import org.apache.cassandra.utils.ByteBufferUtil;
+ import org.apache.cassandra.io.FSWriteError;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertFalse;
@@@ -194,20 -193,18 +197,18 @@@ public class DirectoriesTes
          try 
          {
              DatabaseDescriptor.setDiskFailurePolicy(DiskFailurePolicy.best_effort);
-             
-             for (DataDirectory dd : Directories.dataDirectories)
+             // Fake a Directory creation failure
 -            if (Directories.dataFileLocations.length > 0)
++            if (Directories.dataDirectories.length > 0)
              {
-                 dd.location.setExecutable(false);
-                 dd.location.setWritable(false);
+                 String[] path = new String[] {KS, "bad"};
 -                File dir = new File(Directories.dataFileLocations[0].location, StringUtils.join(path,
File.separator));
++                File dir = new File(Directories.dataDirectories[0].location, StringUtils.join(path,
File.separator));
+                 FileUtils.handleFSError(new FSWriteError(new IOException("Unable to create
directory " + dir), dir));
              }
  
-             // nested folders in /tmp is enough to fail on *nix but we need to pass the
255 char limit to get a failure on Windows and blacklist
-             CFMetaData cfm = new CFMetaData(KS, "badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbad",
ColumnFamilyType.Standard, null);
-             Directories dir = new Directories(cfm);
- 
-             for (File file : dir.getCFDirectories())
 -            for (DataDirectory dd : Directories.dataFileLocations)
++            for (DataDirectory dd : Directories.dataDirectories)
              {
+                 File file = new File(dd.location, new File(KS, "bad").getPath());
 -                Assert.assertTrue(BlacklistedDirectories.isUnwritable(file));
 +                assertTrue(BlacklistedDirectories.isUnwritable(file));
              }
          } 
          finally 


Mime
View raw message