|
@@ -90,12 +90,19 @@ public class ListKeyHandler extends Handler {
|
|
startKey);
|
|
startKey);
|
|
List<KeyInfo> keyInfos = new ArrayList<>();
|
|
List<KeyInfo> keyInfos = new ArrayList<>();
|
|
|
|
|
|
|
|
+ int maxKeyLimit = maxKeys;
|
|
while (maxKeys > 0 && keyIterator.hasNext()) {
|
|
while (maxKeys > 0 && keyIterator.hasNext()) {
|
|
KeyInfo key = OzoneClientUtils.asKeyInfo(keyIterator.next());
|
|
KeyInfo key = OzoneClientUtils.asKeyInfo(keyIterator.next());
|
|
keyInfos.add(key);
|
|
keyInfos.add(key);
|
|
maxKeys -= 1;
|
|
maxKeys -= 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // More keys were returned notify about max length
|
|
|
|
+ if (keyIterator.hasNext()) {
|
|
|
|
+ System.out.println("Listing first " + maxKeyLimit + " entries of the " +
|
|
|
|
+ "result. Use --length (-l) to override max returned keys.");
|
|
|
|
+ }
|
|
|
|
+
|
|
if (isVerbose()) {
|
|
if (isVerbose()) {
|
|
System.out.printf("Found : %d keys for bucket %s in volume : %s ",
|
|
System.out.printf("Found : %d keys for bucket %s in volume : %s ",
|
|
keyInfos.size(), bucketName, volumeName);
|
|
keyInfos.size(), bucketName, volumeName);
|