Skip to content
Merged
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 @@ -31,6 +31,7 @@
import org.apache.hadoop.hdds.scm.client.ScmClient;
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
import org.apache.hadoop.hdds.server.JsonUtils;
import org.apache.hadoop.ozone.shell.ListLimitOptions;
import picocli.CommandLine;

/**
Expand Down Expand Up @@ -77,6 +78,9 @@ public class ListInfoSubcommand extends ScmSubcommand {
defaultValue = "false")
private boolean json;

@CommandLine.Mixin
private ListLimitOptions listLimitOptions;

private List<Pipeline> pipelines;

@Override
Expand Down Expand Up @@ -115,6 +119,10 @@ public void execute(ScmClient scmClient) throws IOException {
.compareToIgnoreCase(nodeState) == 0);
}

if (!listLimitOptions.isAll()) {
allNodes = allNodes.limit(listLimitOptions.getLimit());
}

if (json) {
List<DatanodeWithAttributes> datanodeList = allNodes.collect(
Collectors.toList());
Expand Down
Loading