mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.0' into trunk
This commit is contained in:
commit
8d2fdf3993
|
|
@ -62,6 +62,9 @@ Merged from 1.2:
|
|||
* cqlsh: add support for multiline comments (CASSANDRA-5798)
|
||||
* Handle CQL3 SELECT duplicate IN restrictions on clustering columns
|
||||
(CASSANDRA-5856)
|
||||
* Don't announce schema version until we've loaded the changes locally
|
||||
(CASSANDRA-5904)
|
||||
* Add -no-snapshot option to scrub (CASSANDRA-5891)
|
||||
Merged from 1.1:
|
||||
* Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
|
||||
|
||||
|
|
|
|||
|
|
@ -1039,9 +1039,11 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
|
|||
CompactionManager.instance.performCleanup(ColumnFamilyStore.this, renewer);
|
||||
}
|
||||
|
||||
public void scrub() throws ExecutionException, InterruptedException
|
||||
public void scrub(boolean disableSnapshot) throws ExecutionException, InterruptedException
|
||||
{
|
||||
snapshotWithoutFlush("pre-scrub-" + System.currentTimeMillis());
|
||||
// skip snapshot creation during scrub, SEE JIRA 5891
|
||||
if(!disableSnapshot)
|
||||
snapshotWithoutFlush("pre-scrub-" + System.currentTimeMillis());
|
||||
CompactionManager.instance.performScrub(ColumnFamilyStore.this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2075,10 +2075,10 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
|||
}
|
||||
}
|
||||
|
||||
public void scrub(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
public void scrub(boolean disableSnapshot, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
{
|
||||
for (ColumnFamilyStore cfStore : getValidColumnFamilies(false, false, keyspaceName, columnFamilies))
|
||||
cfStore.scrub();
|
||||
cfStore.scrub(disableSnapshot);
|
||||
}
|
||||
|
||||
public void upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
|
|
|
|||
|
|
@ -229,9 +229,9 @@ public interface StorageServiceMBean extends NotificationEmitter
|
|||
* Scrub (deserialize + reserialize at the latest version, skipping bad rows if any) the given keyspace.
|
||||
* If columnFamilies array is empty, all CFs are scrubbed.
|
||||
*
|
||||
* Scrubbed CFs will be snapshotted first.
|
||||
* Scrubbed CFs will be snapshotted first, if disableSnapshot is false
|
||||
*/
|
||||
public void scrub(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException;
|
||||
public void scrub(boolean disableSnapshot, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Rewrite all sstables to the latest version.
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public class NodeCmd
|
|||
private static final Pair<String, String> START_TOKEN_OPT = Pair.create("st", "start-token");
|
||||
private static final Pair<String, String> END_TOKEN_OPT = Pair.create("et", "end-token");
|
||||
private static final Pair<String, String> UPGRADE_ALL_SSTABLE_OPT = Pair.create("a", "include-all-sstables");
|
||||
private static final Pair<String, String> NO_SNAPSHOT = Pair.create("ns", "no-snapshot");
|
||||
|
||||
private static final String DEFAULT_HOST = "127.0.0.1";
|
||||
private static final int DEFAULT_PORT = 7199;
|
||||
|
|
@ -91,6 +92,7 @@ public class NodeCmd
|
|||
options.addOption(START_TOKEN_OPT, true, "token at which repair range starts");
|
||||
options.addOption(END_TOKEN_OPT, true, "token at which repair range ends");
|
||||
options.addOption(UPGRADE_ALL_SSTABLE_OPT, false, "includes sstables that are already on the most recent version during upgradesstables");
|
||||
options.addOption(NO_SNAPSHOT, false, "disables snapshot creation for scrub");
|
||||
}
|
||||
|
||||
public NodeCmd(NodeProbe probe)
|
||||
|
|
@ -1420,7 +1422,8 @@ public class NodeCmd
|
|||
catch (ExecutionException ee) { err(ee, "Error occurred during cleanup"); }
|
||||
break;
|
||||
case SCRUB :
|
||||
try { probe.scrub(keyspace, columnFamilies); }
|
||||
boolean disableSnapshot = cmd.hasOption(NO_SNAPSHOT.left);
|
||||
try { probe.scrub(disableSnapshot, keyspace, columnFamilies); }
|
||||
catch (ExecutionException ee) { err(ee, "Error occurred while scrubbing keyspace " + keyspace); }
|
||||
break;
|
||||
case UPGRADESSTABLES :
|
||||
|
|
|
|||
|
|
@ -188,9 +188,9 @@ public class NodeProbe
|
|||
ssProxy.forceKeyspaceCleanup(keyspaceName, columnFamilies);
|
||||
}
|
||||
|
||||
public void scrub(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
public void scrub(boolean disableSnapshot, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
{
|
||||
ssProxy.scrub(keyspaceName, columnFamilies);
|
||||
ssProxy.scrub(disableSnapshot, keyspaceName, columnFamilies);
|
||||
}
|
||||
|
||||
public void upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, String... columnFamilies) throws IOException, ExecutionException, InterruptedException
|
||||
|
|
|
|||
Loading…
Reference in New Issue