-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Correct v2 listing of more than 1000 objects #580
Conversation
functional/FunctionalTest.java
Outdated
*/ | ||
public static void listObject_test5() throws Exception { | ||
int i; | ||
int totalObjsNr = 1050; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objCount
or totalObjects
is better
functional/FunctionalTest.java
Outdated
String filename = createFile(1); | ||
client.putObject(bucketName, filename, filename); | ||
Files.delete(Paths.get(filename)); | ||
filenames[i] = filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do below optimization
String baseFilename = createFile(1);
for (...) {
objectNames[i] = baseFilename + "-" + i;
client.putObject(bucketName, objectNames[i], filename);
}
Files.delete(Path.get(baseFilename));
functional/FunctionalTest.java
Outdated
@@ -668,10 +668,41 @@ public static void listObject_test4() throws Exception { | |||
} | |||
|
|||
/** | |||
* Test: listObjects(bucketName, final String prefix, final boolean recursive, final boolean useVersion1). | |||
* Test: listObjects(bucketName, final String prefix, final boolean recursive). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could indicate the test behavior by prefixing Test: recursive:
functional/FunctionalTest.java
Outdated
*/ | ||
public static void listObject_test5() throws Exception { | ||
int i; | ||
int totalObjsNr = 1050; | ||
|
||
System.out.println("Test: listObjects(final String bucketName, final String prefix, final boolean recursive)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could indicate the test behavior by prefixing Test: recursive:
functional/FunctionalTest.java
Outdated
|
||
// Check the number of uploaded objects | ||
if (i != totalObjsNr) { | ||
throw new Exception("[FAILED] Test: listObject_test5(), number of items found: " + i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could indicate expected
in the error message "[FAILED] Test: listObject_test5(), expected object count: " + objCount + ", got: " + i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could have better commit log by
fix: list object v2 does not work for more than 1000 entries
All your comments are addressed @balamurugana, except the commit message, your suggestion was long (>50 chars) so I tried a shorter one. |
Some stylecheck failures. |
Fixing style done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All your comments are addressed @balamurugana, except the commit message, your suggestion was long (>50 chars) so I tried a shorter one.
I would suggest you to prefix fix:
in the commit message. Thats the convention followed.
Rest of things are good to go
Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix listing objects (infinite loop) when there is more than 1000 objets in the server.
There is a typo here objets
should be objects
Fix listing objects (infinite loop) when there is more than 1000 objects in the server.
Fix listing objects (infinite loop) when there is more than
1000 objects in the server.
Fixes #578