You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2017/08/08 15:17:00 UTC

[07/10] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0

Merge branch cassandra-2.2 into cassandra-3.0


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

Branch: refs/heads/trunk
Commit: 1a70dede3a33a2e8bf107f44139580b4ace1c9ff
Parents: 3960260 270f690
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Aug 8 16:55:26 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Aug 8 17:08:19 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../cassandra/config/DatabaseDescriptor.java    |  28 ++-
 .../org/apache/cassandra/db/Directories.java    |   3 +-
 .../org/apache/cassandra/io/util/FileUtils.java | 181 +++++++++++++++++--
 4 files changed, 193 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a70dede/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 1525289,f712333..1f42c70
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,22 -1,5 +1,23 @@@
 -2.2.11
 - * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 +3.0.15
 + * Fix ColumnDefinition.cellValueType() for non-frozen collection and change SSTabledump to use type.toJSONString() (CASSANDRA-13573)
 + * Skip materialized view addition if the base table doesn't exist (CASSANDRA-13737)
 + * Drop table should remove corresponding entries in dropped_columns table (CASSANDRA-13730)
 + * Log warn message until legacy auth tables have been migrated (CASSANDRA-13371)
 + * Fix incorrect [2.1 <- 3.0] serialization of counter cells created in 2.0 (CASSANDRA-13691)
 + * Fix invalid writetime for null cells (CASSANDRA-13711)
 + * Fix ALTER TABLE statement to atomically propagate changes to the table and its MVs (CASSANDRA-12952)
 + * Fixed ambiguous output of nodetool tablestats command (CASSANDRA-13722)
 + * JMXEnabledThreadPoolExecutor with corePoolSize equal to maxPoolSize (Backport CASSANDRA-13329)
 + * Fix Digest mismatch Exception if hints file has UnknownColumnFamily (CASSANDRA-13696)
 + * Purge tombstones created by expired cells (CASSANDRA-13643)
 + * Make concat work with iterators that have different subsets of columns (CASSANDRA-13482)
 + * Set test.runners based on cores and memory size (CASSANDRA-13078)
 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557)
 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606)
 + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627)
 + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568)
 + Merged from 2.2:
++ * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067)
   * Fix queries with LIMIT and filtering on clustering columns (CASSANDRA-11223)
   * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
   * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a70dede/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a70dede/src/java/org/apache/cassandra/db/Directories.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/Directories.java
index 68aa6be,fa76b61..ae7700c
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@@ -523,26 -482,7 +523,25 @@@ public class Directorie
  
          public long getAvailableSpace()
          {
-             long availableSpace = location.getUsableSpace() - DatabaseDescriptor.getMinFreeSpacePerDriveInBytes();
 -            return FileUtils.getUsableSpace(location);
++            long availableSpace = FileUtils.getUsableSpace(location) - DatabaseDescriptor.getMinFreeSpacePerDriveInBytes();
 +            return availableSpace > 0 ? availableSpace : 0;
 +        }
 +
 +        @Override
 +        public boolean equals(Object o)
 +        {
 +            if (this == o) return true;
 +            if (o == null || getClass() != o.getClass()) return false;
 +
 +            DataDirectory that = (DataDirectory) o;
 +
 +            return location.equals(that.location);
- 
 +        }
 +
 +        @Override
 +        public int hashCode()
 +        {
 +            return location.hashCode();
          }
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a70dede/src/java/org/apache/cassandra/io/util/FileUtils.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/io/util/FileUtils.java
index 0bfbbb1,bf0fae5..80df67b
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@@ -20,17 -20,14 +20,19 @@@ package org.apache.cassandra.io.util
  import java.io.*;
  import java.nio.ByteBuffer;
  import java.nio.channels.FileChannel;
 +import java.nio.charset.Charset;
 +import java.nio.charset.StandardCharsets;
  import java.nio.file.*;
+ import java.nio.file.attribute.FileAttributeView;
+ import java.nio.file.attribute.FileStoreAttributeView;
  import java.text.DecimalFormat;
  import java.util.Arrays;
 +import java.util.Collections;
 +import java.util.List;
  import java.util.concurrent.atomic.AtomicReference;
 -
 -import sun.nio.ch.DirectBuffer;
 +import java.util.function.Consumer;
 +import java.util.function.Predicate;
 +import java.util.stream.StreamSupport;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
@@@ -49,13 -45,11 +51,13 @@@ import static org.apache.cassandra.util
  
  public final class FileUtils
  {
 +    public static final Charset CHARSET = StandardCharsets.UTF_8;
 +
      private static final Logger logger = LoggerFactory.getLogger(FileUtils.class);
-     private static final double KB = 1024d;
-     private static final double MB = 1024*1024d;
-     private static final double GB = 1024*1024*1024d;
-     private static final double TB = 1024*1024*1024*1024d;
+     public static final long ONE_KB = 1024;
+     public static final long ONE_MB = 1024 * ONE_KB;
+     public static final long ONE_GB = 1024 * ONE_MB;
+     public static final long ONE_TB = 1024 * ONE_GB;
  
      private static final DecimalFormat df = new DecimalFormat("#.##");
      private static final boolean canCleanDirectBuffers;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org