use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SetGetColumnIndexSizeTest method assertGetThroughput.
private static void assertGetThroughput(int expected) {
ToolResult tool = invokeNodetool("getcolumnindexsize");
tool.assertOnCleanExit();
assertThat(tool.getStdout()).contains("Current value for column_index_size: " + expected + " KiB");
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SetGetEntireSSTableStreamThroughputTest method assertSetInvalidThroughput.
private static void assertSetInvalidThroughput(String throughput, String expectedErrorMessage) {
ToolResult tool = throughput == null ? invokeNodetool("setstreamthroughput", "-e") : invokeNodetool("setstreamthroughput", "-e", throughput);
assertThat(tool.getExitCode()).isEqualTo(1);
assertThat(tool.getStdout()).contains(expectedErrorMessage);
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SetGetStreamThroughputTest method assertSetGetValidThroughput.
private static void assertSetGetValidThroughput(int throughput, double rateInBytes) {
ToolResult tool = invokeNodetool("setstreamthroughput", String.valueOf(throughput));
tool.assertOnCleanExit();
assertThat(tool.getStdout()).isEmpty();
assertGetThroughput(throughput);
assertThat(StreamRateLimiter.getRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.04));
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class NodeProbeTest method testCheckJobs.
/**
* Verify that nodetool -j/--jobs option warning is raised depending on the value of
* {@link org.apache.cassandra.config.Config#concurrent_compactors} in the target node, independently of where the
* tool is used.
*
* Before CASSANDRA-16104 the warning was based on the local value of {@code concurrent_compactors}, and not in the
* value used in the target node, which is got through JMX.
*/
@Test
public void testCheckJobs() {
int compactors = probe.getConcurrentCompactors();
int jobs = compactors + 1;
// Verify that trying to use more jobs than configured concurrent compactors prints a warning
ToolResult toolResult = ToolRunner.invokeNodetool("upgradesstables", "-j", String.valueOf(jobs));
toolResult.assertOnCleanExit();
assertThat(toolResult.getStdout()).contains(format("jobs (%d) is bigger than configured concurrent_compactors (%d) on the host, using at most %d threads", jobs, compactors, compactors));
// Increase the number of concurrent compactors and verify that the new number of concurrent compactors is seen
// by subsequent validations
assertToolResult(ToolRunner.invokeNodetool("setconcurrentcompactors", String.valueOf(jobs)));
assertToolResult(ToolRunner.invokeNodetool("upgradesstables", "-j", String.valueOf(jobs)));
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExpiredBlockersTest method testNoArgsPrintsHelp.
@Test
public void testNoArgsPrintsHelp() {
ToolResult tool = ToolRunner.invokeClass(SSTableExpiredBlockers.class);
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
assertEquals(1, tool.getExitCode());
assertNoUnexpectedThreadsStarted(null);
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
Aggregations