Example usage for org.apache.cassandra.repair.messages RepairOption PRIMARY_RANGE_KEY

List of usage examples for org.apache.cassandra.repair.messages RepairOption PRIMARY_RANGE_KEY

Introduction

In this page you can find the example usage for org.apache.cassandra.repair.messages RepairOption PRIMARY_RANGE_KEY.

Prototype

String PRIMARY_RANGE_KEY

To view the source code for org.apache.cassandra.repair.messages RepairOption PRIMARY_RANGE_KEY.

Click Source Link

Usage

From source file:com.mesosphere.dcos.cassandra.executor.tasks.Repair.java

License:Apache License

private void repairKeyspace(String keyspace, List<String> columnFamilies) throws Exception {
    LOGGER.info("Starting repair : keySpace = {}, columnFamilies = {}", keyspace, columnFamilies);

    Map<String, String> options = new HashMap<>();
    options.put(RepairOption.PRIMARY_RANGE_KEY, "true");
    options.put(RepairOption.COLUMNFAMILIES_KEY, String.join(",", columnFamilies));
    options.put(RepairOption.PARALLELISM_KEY, RepairParallelism.SEQUENTIAL.getName());
    options.put(RepairOption.INCREMENTAL_KEY, "true");

    String result = daemon.repair(keyspace, options);

    LOGGER.info("Repair output = {}", result);
    LOGGER.info("Completed repair : keySpace = {}, columnFamilies = {}", keyspace, columnFamilies);

    sendStatus(driver, Protos.TaskState.TASK_RUNNING,
            String.format("Completed repair : keySpace = %s, columnFamilies = %s", keyspace, columnFamilies));
}