Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.hadoop.hdds.scm.client;

import jakarta.annotation.Nullable;
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -496,34 +497,34 @@ List<HddsProtos.DatanodeDiskBalancerInfoProto> getDiskBalancerReport(
* @throws IOException
*/
List<HddsProtos.DatanodeDiskBalancerInfoProto> getDiskBalancerStatus(
Optional<List<String>> hosts,
Optional<HddsProtos.DiskBalancerRunningStatus> runningStatus)
@Nullable List<String> hosts,
@Nullable HddsProtos.DiskBalancerRunningStatus runningStatus)
throws IOException;

/**
* Start DiskBalancer.
*/
List<DatanodeAdminError> startDiskBalancer(
Optional<Double> threshold,
Optional<Long> bandwidthInMB,
Optional<Integer> parallelThread,
Optional<Boolean> stopAfterDiskEven,
Optional<List<String>> hosts) throws IOException;
@Nullable Double threshold,
@Nullable Long bandwidthInMB,
@Nullable Integer parallelThread,
@Nullable Boolean stopAfterDiskEven,
@Nullable List<String> hosts) throws IOException;

/**
* Stop DiskBalancer.
*/
List<DatanodeAdminError> stopDiskBalancer(Optional<List<String>> hosts)
List<DatanodeAdminError> stopDiskBalancer(@Nullable List<String> hosts)
throws IOException;


/**
* Update DiskBalancer Configuration.
*/
List<DatanodeAdminError> updateDiskBalancerConfiguration(
Optional<Double> threshold,
Optional<Long> bandwidth,
Optional<Integer> parallelThread,
Optional<Boolean> stopAfterDiskEven,
Optional<List<String>> hosts) throws IOException;
@Nullable Double threshold,
@Nullable Long bandwidth,
@Nullable Integer parallelThread,
@Nullable Boolean stopAfterDiskEven,
@Nullable List<String> hosts) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.hadoop.hdds.scm.protocol;

import jakarta.annotation.Nullable;
import java.io.Closeable;
import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -499,35 +500,35 @@ List<HddsProtos.DatanodeDiskBalancerInfoProto> getDiskBalancerReport(
* Get DiskBalancer status.
*/
List<HddsProtos.DatanodeDiskBalancerInfoProto> getDiskBalancerStatus(
Optional<List<String>> hosts,
Optional<HddsProtos.DiskBalancerRunningStatus> runningStatus,
@Nullable List<String> hosts,
@Nullable HddsProtos.DiskBalancerRunningStatus runningStatus,
int clientVersion) throws IOException;

/**
* Start DiskBalancer.
*/
List<DatanodeAdminError> startDiskBalancer(
Optional<Double> threshold,
Optional<Long> bandwidthInMB,
Optional<Integer> parallelThread,
Optional<Boolean> stopAfterDiskEven,
Optional<List<String>> hosts) throws IOException;
@Nullable Double threshold,
@Nullable Long bandwidthInMB,
@Nullable Integer parallelThread,
@Nullable Boolean stopAfterDiskEven,
@Nullable List<String> hosts) throws IOException;

/**
* Stop DiskBalancer.
*/
List<DatanodeAdminError> stopDiskBalancer(Optional<List<String>> hosts)
List<DatanodeAdminError> stopDiskBalancer(@Nullable List<String> hosts)
throws IOException;

/**
* Update DiskBalancer Configuration.
*/
List<DatanodeAdminError> updateDiskBalancerConfiguration(
Optional<Double> threshold,
Optional<Long> bandwidthInMB,
Optional<Integer> parallelThread,
Optional<Boolean> stopAfterDiskEven,
Optional<List<String>> hosts) throws IOException;
@Nullable Double threshold,
@Nullable Long bandwidthInMB,
@Nullable Integer parallelThread,
@Nullable Boolean stopAfterDiskEven,
@Nullable List<String> hosts) throws IOException;

/**
* Trigger a reconcile command to datanodes for the current container ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import jakarta.annotation.Nonnull;
import java.time.Duration;
import java.util.Optional;
import org.apache.hadoop.hdds.conf.Config;
import org.apache.hadoop.hdds.conf.ConfigGroup;
import org.apache.hadoop.hdds.conf.ConfigTag;
Expand Down Expand Up @@ -117,13 +116,22 @@ public final class DiskBalancerConfiguration {
description = "If true, the DiskBalancer will automatically stop once disks are balanced.")
private boolean stopAfterDiskEven = true;

public DiskBalancerConfiguration(Optional<Double> threshold,
Optional<Long> bandwidthInMB,
Optional<Integer> parallelThread, Optional<Boolean> stopAfterDiskEven) {
threshold.ifPresent(aDouble -> this.threshold = aDouble);
bandwidthInMB.ifPresent(aLong -> this.diskBandwidthInMB = aLong);
parallelThread.ifPresent(integer -> this.parallelThread = integer);
stopAfterDiskEven.ifPresent(bool -> this.stopAfterDiskEven = bool);
public DiskBalancerConfiguration(Double threshold,
Long bandwidthInMB,
Integer parallelThread,
Boolean stopAfterDiskEven) {
if (threshold != null) {
this.threshold = threshold;
}
if (bandwidthInMB != null) {
this.diskBandwidthInMB = bandwidthInMB;
}
if (parallelThread != null) {
this.parallelThread = parallelThread;
}
if (stopAfterDiskEven != null) {
this.stopAfterDiskEven = stopAfterDiskEven;
}
}

public DiskBalancerConfiguration() {
Expand Down

This file was deleted.

Loading