cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [2/2] cassandra git commit: Merge branch 'cassandra-2.2' into trunk
Date Tue, 26 May 2015 19:23:33 GMT
Merge branch 'cassandra-2.2' into trunk


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

Branch: refs/heads/trunk
Commit: 3123e88e540b88767f1a2a62d4f649920b9af82c
Parents: e4da2e2 91187b5
Author: Tyler Hobbs <tylerlhobbs@gmail.com>
Authored: Tue May 26 14:23:21 2015 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Tue May 26 14:23:21 2015 -0500

----------------------------------------------------------------------
 build.xml                                       |   6 +
 .../db/commitlog/CompressedSegment.java         |   3 +-
 .../db/commitlog/MemoryMappedSegment.java       |   3 +-
 .../io/sstable/format/big/BigTableWriter.java   |   3 +-
 .../cassandra/io/util/SequentialWriter.java     |   5 +-
 .../org/apache/cassandra/utils/SyncUtil.java    | 165 +++++++++++++++++++
 test/unit/org/apache/cassandra/Util.java        |  15 ++
 .../cassandra/db/ColumnFamilyMetricTest.java    |   8 +-
 .../CompressedRandomAccessReaderTest.java       |   6 +-
 .../io/sstable/SSTableRewriterTest.java         |   3 +-
 .../io/util/BufferedRandomAccessFileTest.java   |  14 +-
 .../org/apache/cassandra/schema/DefsTest.java   |  16 +-
 12 files changed, 222 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3123e88e/build.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3123e88e/test/unit/org/apache/cassandra/Util.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/Util.java
index c2205c4,08cc093..b8f33d3
--- a/test/unit/org/apache/cassandra/Util.java
+++ b/test/unit/org/apache/cassandra/Util.java
@@@ -28,7 -28,8 +28,8 @@@ import java.nio.channels.FileChannel
  import java.util.*;
  import java.util.concurrent.Callable;
  import java.util.concurrent.Future;
++import java.util.function.Supplier;
  
 -import com.google.common.base.Supplier;
  import com.google.common.collect.ImmutableMap;
  import com.google.common.collect.ImmutableSet;
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3123e88e/test/unit/org/apache/cassandra/db/ColumnFamilyMetricTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/ColumnFamilyMetricTest.java
index 45ed56e,1337564..b644264
--- a/test/unit/org/apache/cassandra/db/ColumnFamilyMetricTest.java
+++ b/test/unit/org/apache/cassandra/db/ColumnFamilyMetricTest.java
@@@ -19,6 -19,6 +19,7 @@@ package org.apache.cassandra.db
  
  import java.nio.ByteBuffer;
  import java.util.Collection;
++import java.util.function.Supplier;
  
  import org.junit.BeforeClass;
  import org.junit.Test;
@@@ -78,8 -80,26 +79,8 @@@ public class ColumnFamilyMetricTes
          store.truncateBlocking();
  
          // after truncate, size metrics should be down to 0
-         assertEquals(0, store.metric.liveDiskSpaceUsed.getCount());
-         assertEquals(0, store.metric.totalDiskSpaceUsed.getCount());
 -        Util.spinAssertEquals(
 -                0L,
 -                new Supplier<Object>()
 -                {
 -                    public Long get()
 -                    {
 -                        return store.metric.liveDiskSpaceUsed.getCount();
 -                    }
 -                },
 -                30);
 -        Util.spinAssertEquals(
 -                0L,
 -                new Supplier<Object>()
 -                {
 -                    public Long get()
 -                    {
 -                        return store.metric.totalDiskSpaceUsed.getCount();
 -                    }
 -                },
 -                30);
++        Util.spinAssertEquals(0L, () -> store.metric.liveDiskSpaceUsed.getCount(), 30);
++        Util.spinAssertEquals(0L, () -> store.metric.totalDiskSpaceUsed.getCount(), 30);
  
          store.enableAutoCompaction();
      }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3123e88e/test/unit/org/apache/cassandra/schema/DefsTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/schema/DefsTest.java
index 0fb9353,302878a..1e28575
--- a/test/unit/org/apache/cassandra/schema/DefsTest.java
+++ b/test/unit/org/apache/cassandra/schema/DefsTest.java
@@@ -20,6 -20,6 +20,7 @@@ package org.apache.cassandra.schema
  
  import java.io.File;
  import java.nio.ByteBuffer;
++import java.util.function.Supplier;
  
  import org.apache.cassandra.OrderedJUnit4ClassRunner;
  import org.apache.cassandra.SchemaLoader;
@@@ -256,11 -258,19 +257,16 @@@ public class DefsTes
          Assert.assertFalse("This mutation should have failed since the CF no longer exists.",
success);
  
          // verify that the files are gone.
-         for (File file : store.directories.sstableLister().listFiles())
-         {
-             if (file.getPath().endsWith("Data.db") && !new File(file.getPath().replace("Data.db",
"Compacted")).exists())
-                 throw new AssertionError("undeleted file " + file);
-         }
 -        Supplier<Object> lambda = new Supplier<Object>() {
 -            @Override
 -            public Boolean get() {
 -                for (File file : store.directories.sstableLister().listFiles())
 -                {
 -                    if (file.getPath().endsWith("Data.db") && !new File(file.getPath().replace("Data.db",
"Compacted")).exists())
 -                        return false;
 -                }
 -                return true;
++        Supplier<Object> lambda = () -> {
++            for (File file : store.directories.sstableLister().listFiles())
++            {
++                if (file.getPath().endsWith("Data.db") && !new File(file.getPath().replace("Data.db",
"Compacted")).exists())
++                    return false;
+             }
++            return true;
+         };
+         Util.spinAssertEquals(true, lambda, 30);
+ 
      }
  
      @Test


Mime
View raw message