cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [3/3] cassandra git commit: merge fixes for CASSANDRA-8452
Date Mon, 15 Dec 2014 17:36:00 GMT
merge fixes for CASSANDRA-8452


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

Branch: refs/heads/trunk
Commit: 574e2652ef1c5bc8813ae48ebfe785424795e7b5
Parents: 3a0dc2c
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Mon Dec 15 11:33:18 2014 -0600
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Mon Dec 15 11:33:18 2014 -0600

----------------------------------------------------------------------
 .../cassandra/config/DatabaseDescriptor.java      | 18 +++++++++---------
 .../apache/cassandra/service/StorageService.java  |  1 +
 .../org/apache/cassandra/utils/FBUtilities.java   |  2 +-
 .../org/apache/cassandra/utils/SigarLibrary.java  |  2 +-
 test/pig/org/apache/pig/test/MiniCluster.java     |  2 +-
 5 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/574e2652/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index c34c6ea..958cf8c 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -177,7 +177,15 @@ public class DatabaseDescriptor
         if (conf.commitlog_total_space_in_mb == null)
             conf.commitlog_total_space_in_mb = hasLargeAddressSpace() ? 8192 : 32;
 
-        if (FBUtilities.isUnix())
+        // Always force standard mode access on Windows - CASSANDRA-6993. Windows won't allow
deletion of hard-links to files that
+        // are memory-mapped which causes trouble with snapshots.
+        if (FBUtilities.isWindows())
+        {
+            conf.disk_access_mode = Config.DiskAccessMode.standard;
+            indexAccessMode = conf.disk_access_mode;
+            logger.info("Non-unix environment detected.  DiskAccessMode set to {}, indexAccessMode
{}", conf.disk_access_mode, indexAccessMode);
+        }
+        else
         {
             /* evaluate the DiskAccessMode Config directive, which also affects indexAccessMode
selection */
             if (conf.disk_access_mode == Config.DiskAccessMode.auto)
@@ -198,14 +206,6 @@ public class DatabaseDescriptor
                 logger.info("DiskAccessMode is {}, indexAccessMode is {}", conf.disk_access_mode,
indexAccessMode);
             }
         }
-        // Always force standard mode access on Windows - CASSANDRA-6993. Windows won't allow
deletion of hard-links to files that
-        // are memory-mapped which causes trouble with snapshots.
-        else
-        {
-            conf.disk_access_mode = Config.DiskAccessMode.standard;
-            indexAccessMode = conf.disk_access_mode;
-            logger.info("Non-unix environment detected.  DiskAccessMode set to {}, indexAccessMode
{}", conf.disk_access_mode, indexAccessMode);
-        }
 
         /* Authentication and authorization backend, implementing IAuthenticator and IAuthorizer
*/
         if (conf.authenticator != null)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/574e2652/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index f646d87..999d6b6 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2536,6 +2536,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
                                      boolean fullRepair,
                                      String... columnFamilies)
     {
+        if (FBUtilities.isWindows() && parallelismDegree != RepairParallelism.PARALLEL)
         {
             logger.warn("Snapshot-based repair is not yet supported on Windows.  Reverting
to parallel repair.");
             parallelismDegree = RepairParallelism.PARALLEL;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/574e2652/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java b/src/java/org/apache/cassandra/utils/FBUtilities.java
index c41a6c0..8077df8 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -70,8 +70,8 @@ public class FBUtilities
     public static final BigInteger TWO = new BigInteger("2");
     private static final String DEFAULT_TRIGGER_DIR = "triggers";
 
+    private static final String OPERATING_SYSTEM = System.getProperty("os.name").toLowerCase();
     private static final boolean IS_WINDOWS = OPERATING_SYSTEM.contains("windows");
-
     private static final boolean HAS_PROCFS = !IS_WINDOWS && (new File(File.separator
+ "proc")).exists();
 
     private static volatile InetAddress localInetAddress;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/574e2652/src/java/org/apache/cassandra/utils/SigarLibrary.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/SigarLibrary.java b/src/java/org/apache/cassandra/utils/SigarLibrary.java
index bcfa58e..fb3d3ae 100644
--- a/src/java/org/apache/cassandra/utils/SigarLibrary.java
+++ b/src/java/org/apache/cassandra/utils/SigarLibrary.java
@@ -110,7 +110,7 @@ public class SigarLibrary
     private boolean hasAcceptableAddressSpace()
     {
         // Check is invalid on Windows
-        if (!FBUtilities.isUnix())
+        if (FBUtilities.isWindows())
             return true;
 
         try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/574e2652/test/pig/org/apache/pig/test/MiniCluster.java
----------------------------------------------------------------------
diff --git a/test/pig/org/apache/pig/test/MiniCluster.java b/test/pig/org/apache/pig/test/MiniCluster.java
index ad50f69..aa03861 100644
--- a/test/pig/org/apache/pig/test/MiniCluster.java
+++ b/test/pig/org/apache/pig/test/MiniCluster.java
@@ -50,7 +50,7 @@ public class MiniCluster extends MiniGenericCluster {
 
             // Builds and starts the mini dfs and mapreduce clusters
             Configuration config = new Configuration();
-            if (!FBUtilities.isUnix())
+            if (FBUtilities.isWindows())
                 config.set("fs.file.impl", WindowsLocalFileSystem.class.getName());
             m_dfs = new MiniDFSCluster(config, dataNodes, true, null);
             m_fileSys = m_dfs.getFileSystem();


Mime
View raw message