cassandra git commit: Don't include tmp files in offline relevel
Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 2e6492a18 -> 67038a32e Don't include tmp files in offline relevel Patch by marcuse; reviewed by carlyeks for CASSANDRA-9088 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67038a32 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67038a32 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67038a32 Branch: refs/heads/cassandra-2.0 Commit: 67038a32e118c6a8a0a9de50c8c099b85ccd7b07 Parents: 2e6492a Author: Marcus Eriksson Authored: Wed Apr 1 17:28:50 2015 +0200 Committer: Marcus Eriksson Committed: Fri Apr 3 20:53:23 2015 +0200 -- CHANGES.txt | 1 + .../cassandra/tools/SSTableOfflineRelevel.java | 16 +--- 2 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c569de5..28f79f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.15: + * Don't include tmp files when doing offline relevel (CASSANDRA-9088) * Use the proper CAS WriteType when finishing a previous round during Paxos preparation (CASSANDRA-8672) * Avoid race in cancelling compactions (CASSANDRA-9070) http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java -- diff --git a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java index 3fb2f7a..6293faa 100644 --- a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java +++ b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java @@ -28,6 +28,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.google.common.base.Throwables; + import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.Schema; import org.apache.cassandra.db.DecoratedKey; @@ -93,12 +95,20 @@ public class SSTableOfflineRelevel Keyspace.openWithoutSSTables(keyspace); Directories directories = Directories.create(keyspace, columnfamily); Set sstables = new HashSet<>(); -for (Map.Entry> sstable : directories.sstableLister().list().entrySet()) +for (Map.Entry> sstable : directories.sstableLister().skipTemporary(true).list().entrySet()) { if (sstable.getKey() != null) { -SSTableReader reader = SSTableReader.open(sstable.getKey()); -sstables.add(reader); +try +{ +SSTableReader reader = SSTableReader.open(sstable.getKey()); +sstables.add(reader); +} +catch (Throwable t) +{ +out.println("Couldn't open sstable: "+sstable.getKey().filenameFor(Component.DATA)); +Throwables.propagate(t); +} } } if (sstables.isEmpty())
[1/2] cassandra git commit: Don't include tmp files in offline relevel
Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 9449a7016 -> e4072cf09 Don't include tmp files in offline relevel Patch by marcuse; reviewed by carlyeks for CASSANDRA-9088 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67038a32 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67038a32 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67038a32 Branch: refs/heads/cassandra-2.1 Commit: 67038a32e118c6a8a0a9de50c8c099b85ccd7b07 Parents: 2e6492a Author: Marcus Eriksson Authored: Wed Apr 1 17:28:50 2015 +0200 Committer: Marcus Eriksson Committed: Fri Apr 3 20:53:23 2015 +0200 -- CHANGES.txt | 1 + .../cassandra/tools/SSTableOfflineRelevel.java | 16 +--- 2 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c569de5..28f79f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.15: + * Don't include tmp files when doing offline relevel (CASSANDRA-9088) * Use the proper CAS WriteType when finishing a previous round during Paxos preparation (CASSANDRA-8672) * Avoid race in cancelling compactions (CASSANDRA-9070) http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java -- diff --git a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java index 3fb2f7a..6293faa 100644 --- a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java +++ b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java @@ -28,6 +28,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.google.common.base.Throwables; + import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.Schema; import org.apache.cassandra.db.DecoratedKey; @@ -93,12 +95,20 @@ public class SSTableOfflineRelevel Keyspace.openWithoutSSTables(keyspace); Directories directories = Directories.create(keyspace, columnfamily); Set sstables = new HashSet<>(); -for (Map.Entry> sstable : directories.sstableLister().list().entrySet()) +for (Map.Entry> sstable : directories.sstableLister().skipTemporary(true).list().entrySet()) { if (sstable.getKey() != null) { -SSTableReader reader = SSTableReader.open(sstable.getKey()); -sstables.add(reader); +try +{ +SSTableReader reader = SSTableReader.open(sstable.getKey()); +sstables.add(reader); +} +catch (Throwable t) +{ +out.println("Couldn't open sstable: "+sstable.getKey().filenameFor(Component.DATA)); +Throwables.propagate(t); +} } } if (sstables.isEmpty())
[1/3] cassandra git commit: Don't include tmp files in offline relevel
Repository: cassandra Updated Branches: refs/heads/trunk 7d68cedec -> 2341e945b Don't include tmp files in offline relevel Patch by marcuse; reviewed by carlyeks for CASSANDRA-9088 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67038a32 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67038a32 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67038a32 Branch: refs/heads/trunk Commit: 67038a32e118c6a8a0a9de50c8c099b85ccd7b07 Parents: 2e6492a Author: Marcus Eriksson Authored: Wed Apr 1 17:28:50 2015 +0200 Committer: Marcus Eriksson Committed: Fri Apr 3 20:53:23 2015 +0200 -- CHANGES.txt | 1 + .../cassandra/tools/SSTableOfflineRelevel.java | 16 +--- 2 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c569de5..28f79f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.15: + * Don't include tmp files when doing offline relevel (CASSANDRA-9088) * Use the proper CAS WriteType when finishing a previous round during Paxos preparation (CASSANDRA-8672) * Avoid race in cancelling compactions (CASSANDRA-9070) http://git-wip-us.apache.org/repos/asf/cassandra/blob/67038a32/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java -- diff --git a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java index 3fb2f7a..6293faa 100644 --- a/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java +++ b/src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java @@ -28,6 +28,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.google.common.base.Throwables; + import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.Schema; import org.apache.cassandra.db.DecoratedKey; @@ -93,12 +95,20 @@ public class SSTableOfflineRelevel Keyspace.openWithoutSSTables(keyspace); Directories directories = Directories.create(keyspace, columnfamily); Set sstables = new HashSet<>(); -for (Map.Entry> sstable : directories.sstableLister().list().entrySet()) +for (Map.Entry> sstable : directories.sstableLister().skipTemporary(true).list().entrySet()) { if (sstable.getKey() != null) { -SSTableReader reader = SSTableReader.open(sstable.getKey()); -sstables.add(reader); +try +{ +SSTableReader reader = SSTableReader.open(sstable.getKey()); +sstables.add(reader); +} +catch (Throwable t) +{ +out.println("Couldn't open sstable: "+sstable.getKey().filenameFor(Component.DATA)); +Throwables.propagate(t); +} } } if (sstables.isEmpty())