public List<KeyRange> getLocalKeyPartition() throws BackendException { ensureKeyspaceExists(keySpaceName); @SuppressWarnings("rawtypes") Collection<Range<Token>> ranges = StorageService.instance.getPrimaryRanges(keySpaceName); List<KeyRange> keyRanges = new ArrayList<KeyRange>(ranges.size()); for (@SuppressWarnings("rawtypes") Range<Token> range : ranges) { keyRanges.add(CassandraHelper.transformRange(range)); } return keyRanges; }
public int forceRepairAsync(String keyspace, boolean isSequential, boolean isLocal, boolean primaryRange, boolean fullRepair, String... columnFamilies) { Collection<Range<Token>> ranges; if (primaryRange) { ranges = isLocal ? getPrimaryRangesWithinDC(keyspace) : getPrimaryRanges(keyspace); } else { ranges = getLocalRanges(keyspace); } return forceRepairAsync(keyspace, isSequential, isLocal, ranges, fullRepair, columnFamilies); }
public int forceRepairAsync(String keyspace, int parallelismDegree, Collection<String> dataCenters, Collection<String> hosts, boolean primaryRange, boolean fullRepair, String... columnFamilies) { if (parallelismDegree < 0 || parallelismDegree > RepairParallelism.values().length - 1) { throw new IllegalArgumentException("Invalid parallelism degree specified: " + parallelismDegree); } Collection<Range<Token>> ranges; if (primaryRange) { // when repairing only primary range, neither dataCenters nor hosts can be set if (dataCenters == null && hosts == null) ranges = getPrimaryRanges(keyspace); // except dataCenters only contain local DC (i.e. -local) else if (dataCenters != null && dataCenters.size() == 1 && dataCenters.contains(DatabaseDescriptor.getLocalDataCenter())) ranges = getPrimaryRangesWithinDC(keyspace); else throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster."); } else { ranges = getLocalRanges(keyspace); } return forceRepairAsync(keyspace, RepairParallelism.values()[parallelismDegree], dataCenters, hosts, ranges, fullRepair, columnFamilies); }
public List<KeyRange> getLocalKeyPartition() throws BackendException { ensureKeyspaceExists(keySpaceName); @SuppressWarnings("rawtypes") Collection<Range<Token>> ranges = StorageService.instance.getPrimaryRanges(keySpaceName); List<KeyRange> keyRanges = new ArrayList<KeyRange>(ranges.size()); for (@SuppressWarnings("rawtypes") Range<Token> range : ranges) { keyRanges.add(CassandraHelper.transformRange(range)); } return keyRanges; }
public int repairAsync(String keyspace, Map<String, String> repairSpec) { RepairOption option = RepairOption.parse(repairSpec, tokenMetadata.partitioner); // if ranges are not specified if (option.getRanges().isEmpty()) { if (option.isPrimaryRange()) { // when repairing only primary range, neither dataCenters nor hosts can be set if (option.getDataCenters().isEmpty() && option.getHosts().isEmpty()) option.getRanges().addAll(getPrimaryRanges(keyspace)); // except dataCenters only contain local DC (i.e. -local) else if (option.isInLocalDCOnly()) option.getRanges().addAll(getPrimaryRangesWithinDC(keyspace)); else throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster."); } else { option.getRanges().addAll(getLocalRanges(keyspace)); } } return forceRepairAsync(keyspace, option, false); }
public int repairAsync(String keyspace, Map<String, String> repairSpec) { RepairOption option = RepairOption.parse(repairSpec, tokenMetadata.partitioner); // if ranges are not specified if (option.getRanges().isEmpty()) { if (option.isPrimaryRange()) { // when repairing only primary range, neither dataCenters nor hosts can be set if (option.getDataCenters().isEmpty() && option.getHosts().isEmpty()) option.getRanges().addAll(getPrimaryRanges(keyspace)); // except dataCenters only contain local DC (i.e. -local) else if (option.isInLocalDCOnly()) option.getRanges().addAll(getPrimaryRangesWithinDC(keyspace)); else throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster."); } else { option.getRanges().addAll(getLocalRanges(keyspace)); } } return forceRepairAsync(keyspace, option, false); }
public int repairAsync(String keyspace, Map<String, String> repairSpec) { RepairOption option = RepairOption.parse(repairSpec, tokenMetadata.partitioner); // if ranges are not specified if (option.getRanges().isEmpty()) { if (option.isPrimaryRange()) { // when repairing only primary range, neither dataCenters nor hosts can be set if (option.getDataCenters().isEmpty() && option.getHosts().isEmpty()) option.getRanges().addAll(getPrimaryRanges(keyspace)); // except dataCenters only contain local DC (i.e. -local) else if (option.isInLocalDCOnly()) option.getRanges().addAll(getPrimaryRangesWithinDC(keyspace)); else throw new IllegalArgumentException("You need to run primary range repair on all nodes in the cluster."); } else { option.getRanges().addAll(getLocalRanges(keyspace)); } } return forceRepairAsync(keyspace, option, false); }
options.getRanges().addAll(getPrimaryRanges(keyspace));
options.getRanges().addAll(getPrimaryRanges(keyspace));
options.getRanges().addAll(getPrimaryRanges(keyspace));