Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 701B1200CDE for ; Tue, 8 Aug 2017 17:16:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6E9691676B8; Tue, 8 Aug 2017 15:16:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 999DE1676BE for ; Tue, 8 Aug 2017 17:16:57 +0200 (CEST) Received: (qmail 71731 invoked by uid 500); 8 Aug 2017 15:16:55 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 71380 invoked by uid 99); 8 Aug 2017 15:16:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 15:16:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9C9ACF69A3; Tue, 8 Aug 2017 15:16:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: blerer@apache.org To: commits@cassandra.apache.org Date: Tue, 08 Aug 2017 15:16:59 -0000 Message-Id: <80bb393564024911b47e7d9dfa0b666c@git.apache.org> In-Reply-To: <2ce6a765f4834c89a0b492603ff84954@git.apache.org> References: <2ce6a765f4834c89a0b492603ff84954@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/10] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0 archived-at: Tue, 08 Aug 2017 15:16:58 -0000 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/cassandra-3.0 Commit: 1a70dede3a33a2e8bf107f44139580b4ace1c9ff Parents: 3960260 270f690 Author: Benjamin Lerer Authored: Tue Aug 8 16:55:26 2017 +0200 Committer: Benjamin Lerer 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