Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodetool: compact: add --offstrategy option #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/service/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,7 @@ public int upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, i
return status.statusCode;
}

public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
public void forceKeyspaceCompaction(boolean splitOutput, boolean offStrategy, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
{
for (ColumnFamilyStore cfStore : getValidColumnFamilies(true, false, keyspaceName, tableNames))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public interface StorageServiceMBean extends NotificationEmitter
/**
* Forces major compaction of a single keyspace
*/
public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException;
public void forceKeyspaceCompaction(boolean splitOutput, boolean offStrategy, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException;

@Deprecated
public int relocateSSTables(String keyspace, String ... cfnames) throws IOException, ExecutionException, InterruptedException;
Expand Down
4 changes: 2 additions & 2 deletions src/java/org/apache/cassandra/tools/NodeProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ public void forceUserDefinedCompaction(String datafiles) throws IOException, Exe
compactionProxy.forceUserDefinedCompaction(datafiles);
}

public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
public void forceKeyspaceCompaction(boolean splitOutput, boolean offStrategy, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
{
ssProxy.forceKeyspaceCompaction(splitOutput, keyspaceName, tableNames);
ssProxy.forceKeyspaceCompaction(splitOutput, offStrategy, keyspaceName, tableNames);
}

public void relocateSSTables(int jobs, String keyspace, String[] cfnames) throws IOException, ExecutionException, InterruptedException
Expand Down
4 changes: 3 additions & 1 deletion src/java/org/apache/cassandra/tools/nodetool/Compact.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class Compact extends NodeToolCmd
@Option(title = "end_token", name = {"-et", "--end-token"}, description = "Use -et to specify a token at which compaction range ends")
private String endToken = EMPTY;

@Option(title = "offstrategy", name = {"--offstrategy"}, description = "Use --offstrategy to trigger offstrategy compaction")
private boolean offStrategy = false;

@Override
public void execute(NodeProbe probe)
Expand Down Expand Up @@ -86,7 +88,7 @@ public void execute(NodeProbe probe)
}
else
{
probe.forceKeyspaceCompaction(splitOutput, keyspace, tableNames);
probe.forceKeyspaceCompaction(splitOutput, offStrategy, keyspace, tableNames);
}
} catch (Exception e)
{
Expand Down