cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [5/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11
Date Fri, 03 Mar 2017 19:21:20 GMT
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.11
Commit: 92b7322bbf0b53203adcfb6c4479022f975d9785
Parents: a830cf5 e3968cf
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Fri Mar 3 11:17:17 2017 -0800
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Fri Mar 3 11:19:30 2017 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../org/apache/cassandra/utils/CLibrary.java    | 135 +++++++++++--------
 .../apache/cassandra/utils/CLibraryDarwin.java  | 131 ++++++++++++++++++
 .../apache/cassandra/utils/CLibraryLinux.java   | 131 ++++++++++++++++++
 .../apache/cassandra/utils/CLibraryWindows.java | 103 ++++++++++++++
 .../apache/cassandra/utils/CLibraryWrapper.java |  40 ++++++
 .../org/apache/cassandra/utils/HeapUtils.java   |   6 +-
 .../org/apache/cassandra/utils/UUIDGen.java     |   2 +-
 .../apache/cassandra/utils/CLibraryTest.java    |   8 ++
 9 files changed, 495 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/92b7322b/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 5de9ece,076b337..b91edb4
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,7 +1,18 @@@
 -3.0.12
 +3.11.0
 + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174)
 + * Obfuscate password in stress-graphs (CASSANDRA-12233)
 + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034)
 + * nodetool stopdaemon errors out (CASSANDRA-13030)
 + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954)
 + * Fix primary index calculation for SASI (CASSANDRA-12910)
 + * More fixes to the TokenAllocator (CASSANDRA-12990)
 + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983)
 + * Address message coalescing regression (CASSANDRA-12676)
 +Merged from 3.0:
+  * Improve testing on macOS by eliminating sigar logging (CASSANDRA-13233)
   * Cqlsh copy-from should error out when csv contains invalid data for collections (CASSANDRA-13071)
 - * Update c.yaml doc for offheap memtables (CASSANDRA-13179)
 + * Fix "multiple versions of ant detected..." when running ant test (CASSANDRA-13232)
 + * Coalescing strategy sleeps too much (CASSANDRA-13090)
   * Faster StreamingHistogram (CASSANDRA-13038)
   * Legacy deserializer can create unexpected boundary range tombstones (CASSANDRA-13237)
   * Remove unnecessary assertion from AntiCompactionTest (CASSANDRA-13070)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/92b7322b/src/java/org/apache/cassandra/utils/CLibrary.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/utils/CLibrary.java
index 937d662,71f4148..ae3ce63
--- a/src/java/org/apache/cassandra/utils/CLibrary.java
+++ b/src/java/org/apache/cassandra/utils/CLibrary.java
@@@ -29,10 -29,12 +29,13 @@@ import org.slf4j.Logger
  import org.slf4j.LoggerFactory;
  
  import com.sun.jna.LastErrorException;
- import com.sun.jna.Native;
- import com.sun.jna.Pointer;
 +import sun.nio.ch.FileChannelImpl;
  
+ import static org.apache.cassandra.utils.CLibrary.OSType.LINUX;
+ import static org.apache.cassandra.utils.CLibrary.OSType.MAC;
+ import static org.apache.cassandra.utils.CLibrary.OSType.WINDOWS;
+ import static org.apache.cassandra.utils.CLibrary.OSType.AIX;
+ 
  public final class CLibrary
  {
      private static final Logger logger = LoggerFactory.getLogger(CLibrary.class);
@@@ -55,45 -68,22 +69,28 @@@
      private static final int POSIX_FADV_DONTNEED   = 4; /* fadvise.h */
      private static final int POSIX_FADV_NOREUSE    = 5; /* fadvise.h */
  
-     static boolean jnaAvailable = true;
-     static boolean jnaLockable = false;
-     private static boolean fsyncUnavailable = false;
- 
-     private static final boolean OS_LINUX;
-     private static final boolean OS_AIX;
-     private static final boolean OS_MAC;
+     private static final CLibraryWrapper wrappedCLibrary;
+     private static boolean jnaLockable = false;
  
 +    private static final Field FILE_DESCRIPTOR_FD_FIELD;
 +    private static final Field FILE_CHANNEL_FD_FIELD;
 +
      static
      {
-         String os = System.getProperty("os.name").toLowerCase();
-         OS_LINUX = os.contains("linux");
-         OS_AIX = os.contains("aix");
-         OS_MAC = os.contains("mac");
- 
 +        FILE_DESCRIPTOR_FD_FIELD = FBUtilities.getProtectedField(FileDescriptor.class, "fd");
 +        FILE_CHANNEL_FD_FIELD = FBUtilities.getProtectedField(FileChannelImpl.class, "fd");
 +
-         try
-         {
-             Native.register("c");
-         }
-         catch (NoClassDefFoundError e)
+         // detect the OS type the JVM is running on and then set the CLibraryWrapper
+         // instance to a compatable implementation of CLibraryWrapper for that OS type
+         osType = getOsType();
+         switch (osType)
          {
-             logger.warn("JNA not found. Native methods will be disabled.");
-             jnaAvailable = false;
-         }
-         catch (UnsatisfiedLinkError e)
-         {
-             logger.warn("JNA link failure, one or more native method will be unavailable.");
-             logger.trace("JNA link failure details: {}", e.getMessage());
-         }
-         catch (NoSuchMethodError e)
-         {
-             logger.warn("Obsolete version of JNA present; unable to register C library.
Upgrade to JNA 3.2.7 or later");
-             jnaAvailable = false;
+             case MAC: wrappedCLibrary = new CLibraryDarwin(); break;
+             case WINDOWS: wrappedCLibrary = new CLibraryWindows(); break;
+             case LINUX:
+             case AIX:
+             case OTHER:
+             default: wrappedCLibrary = new CLibraryLinux();
          }
  
          if (System.getProperty("os.arch").toLowerCase().contains("ppc"))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/92b7322b/src/java/org/apache/cassandra/utils/HeapUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/92b7322b/src/java/org/apache/cassandra/utils/UUIDGen.java
----------------------------------------------------------------------


Mime
View raw message