hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weiwei Yang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11679) Ozone: SCM CLI: Implement list container command
Date Fri, 26 May 2017 15:15:04 GMT

    [ https://issues.apache.org/jira/browse/HDFS-11679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16026391#comment-16026391

Weiwei Yang commented on HDFS-11679:

Hi [~yuanbo]

Thanks for the update, it looks pretty good. Some comments below


throw new IOException("-count should not be negative"); is it better to change to throw IllegalArgumentException
here? With error message "count must be greater than 0". I don't think we should allow count
is 0, that is not useful.

{{outputContainerPipeline}} seems to print info like

Container Name: container1
LeaderID: dn1
Datanodes: [dn1, dn2, dn3]
Container Name: container2
LeaderID: dn1
Datanodes: [dn1, dn2, dn3]

this is not an user friendly output. Can we improve this to be something like

1. container1: [dn1, dn2, dn3]
2. container2: [dn1, dn2, dn3]

I am looking forward to hear your ideas as well, how to print possible hundreds of containers
nice and clean :).


Please replace {{str.getBytes(ENCODING)}} with {{DFSUtil.string2Bytes}}.
The code logic in {{KeyRange}} is a bit complicated, I am trying to understand why we need
a Backward and Forward scan mode.  Can we always use the Forward mode, use following approach

# Argument check, if {{startKey}} or {{endKey}} is not valid, fails with an error message;
# If {{startKey}} is given, scan from the {{startKey}}, otherwise from first entry;
# Continue the scan until either meets {{endKey}} or the number of entries reaches the {{count}};

I feel this function would be a bit overlapped with the patch I am working on in HDFS-11779,
there I introduced a function

public List<Entry<byte[], byte[]>> getRangeKVs(@Nullable byte[] startKey,
      int count, LevelDBKeyFilter... filters)

Please take a look at that if this could reuse that. Lets consolidate with one common API
for rest of {{LIST}} operations to call.

Thanks a lot.

> Ozone: SCM CLI: Implement list container command
> ------------------------------------------------
>                 Key: HDFS-11679
>                 URL: https://issues.apache.org/jira/browse/HDFS-11679
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Weiwei Yang
>            Assignee: Yuanbo Liu
>              Labels: command-line
>         Attachments: HDFS-11679-HDFS-7240.001.patch, HDFS-11679-HDFS-7240.002.patch
> Implement the command to list containers
> {code}
> hdfs scm -container list -start <container name> [-count <100> | -end <name>]{code}
> Lists all containers known to SCM. The option -start allows the listing to start from
a specified container and -count controls the number of entries returned but it is mutually
exclusive with the -end option which returns keys from the -start to -end range.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message