Skip to content
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

Java Docs Update #730

Merged
merged 1 commit into from
Jan 5, 2019
Merged

Java Docs Update #730

merged 1 commit into from
Jan 5, 2019

Conversation

sinhaashish
Copy link
Contributor

API.md is updated with methods present in http://minio.github.io/minio-java/

* DeleteError error = errorResult.get();
* System.out.println("Failed to remove '" + error.objectName() + "'. Error:" + error.message());
* } }</pre>
*
* @param bucketName Bucket name.
* @param objectNames List of Object names in the bucket.
*/
public Iterable<Result<DeleteError>> removeObject(final String bucketName, final Iterable<String> objectNames) {
public Iterable<Result<DeleteError>> removeObjects(final String bucketName, final Iterable<String> objectNames) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it agreed to change the name? If so, its a breaking change and you would need to bump up major version.

Copy link
Contributor Author

@sinhaashish sinhaashish Nov 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it agreed to change the name?
Checked with @kannappanr @deekoder before changing the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the public method name is changed. Made the changed in minio-java . Please tell what can break because of this? I can retrofit it in the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently available http://minio.github.io/minio-java/io/minio/MinioClient.html#removeObject-java.lang.String-java.lang.Iterable- is removed and new method removeObjects() is available to do that same in next release. Already developed code of users using http://minio.github.io/minio-java/io/minio/MinioClient.html#removeObject-java.lang.String-java.lang.Iterable- will get an error for next release. This needs to be notified indirectly by bumping up major version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did discuss the impact of this breaking change with AB. I think we just have to call it out as a BREAKING CHANGE when we do a release with this PR.

@@ -3413,7 +3413,7 @@ private String putObject(String bucketName, String objectName, int length,
*/
private void putObject(String bucketName, String objectName, Long size, Object data,
Map<String, String> headerMap, ServerSideEncryption sse)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
throws InvalidBucketNameException, NoSuchAlgorithmException, IOException,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't UnsufficentDataException going to be thrown any more for all the above methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException was redundant in the signature, It was coming twice. So removed the extra one.

@sinhaashish sinhaashish force-pushed the DocsUpdate branch 2 times, most recently from cce7b64 to 877e42b Compare November 19, 2018 05:34
@krisis krisis added the blocked label Nov 19, 2018
| | ``ErrorResponseException`` : upon unsuccessful execution. |
| | ``InternalException`` : upon internal library error. |
| | ``InvalidArgumentException`` : upon invalid value is passed to a method. |
| | ``InsufficientDataException`` : Thrown to indicate that reading given InputStream gets EOFException before reading given length. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is removed up at the top.
Do we still throw this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is still there in the method signature. I was just that InsufficientDataException was defined twice in the method signature. I removed one just to remove the redundancy.

| | ``ErrorResponseException`` : upon unsuccessful execution. |
| | ``InternalException`` : upon internal library error. |
| | ``InvalidArgumentException`` : upon invalid value is passed to a method. |
| | ``InsufficientDataException`` : Thrown to indicate that reading given InputStream gets EOFException before reading given length. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is removed up at the top.
Do we still throw this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is still there in the method signature. I was just that InsufficientDataException was defined twice in the method signature. I removed one just to remove the redundancy.

| | ``org.xmlpull.v1.XmlPullParserException`` : upon parsing response XML. |
| | ``ErrorResponseException`` : upon unsuccessful execution. |
| | ``InternalException`` : upon internal library error. |

| | ``InvalidArgumentException`` : upon invalid value is passed to a method. |
| | ``InsufficientDataException`` : Thrown to indicate that reading given InputStream gets EOFException before reading given length. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is removed up at the top.
Do we still throw this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InsufficientDataException is still there in the method signature. I was just that InsufficientDataException was defined twice in the method signature. I removed one just to remove the redundancy.

* DeleteError error = errorResult.get();
* System.out.println("Failed to remove '" + error.objectName() + "'. Error:" + error.message());
* } }</pre>
*
* @param bucketName Bucket name.
* @param objectNames List of Object names in the bucket.
*/
public Iterable<Result<DeleteError>> removeObject(final String bucketName, final Iterable<String> objectNames) {
public Iterable<Result<DeleteError>> removeObjects(final String bucketName, final Iterable<String> objectNames) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other SDKs, Go, JavaScript, Python, .NET, have 2 methods to remove objects:

  • removeObject() for single object removal
  • removeObjects() for multiple object removal

I think we need to stick with that approach for consistency purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is under discussion . @deekoder can you please confirm on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, no matter which way we choose to go about renaming the method, Bala's point about breaking compatibility is going to be still valid.

docs/API.md Show resolved Hide resolved
@nitisht
Copy link
Contributor

nitisht commented Nov 27, 2018

I understand it is discussed with @abperiasamy now. @sinhaashish can you update on the conclusion

@sinhaashish
Copy link
Contributor Author

sinhaashish commented Nov 28, 2018

I understand it is discussed with @abperiasamy now. @sinhaashish can you update on the conclusion

Results:

  1. We will be going with removeObjects.
  2. The already present methods Filter filter() and public void filter(Filter filter) will be present but with a depreacted tag which will be removed in 6 months.
  3. Addition of getFilter() and getFilter() methods
    Will update the PR as per the discussion.

@sinhaashish sinhaashish force-pushed the DocsUpdate branch 2 times, most recently from 4fded8f to 3e01a79 Compare November 29, 2018 09:46
@sinhaashish sinhaashish force-pushed the DocsUpdate branch 4 times, most recently from 5f84e4e to b38cde7 Compare December 6, 2018 04:37
@sinhaashish
Copy link
Contributor Author

@balamurugana @ebozduman PTAL

@sinhaashish sinhaashish force-pushed the DocsUpdate branch 2 times, most recently from f39f98f to cae5a76 Compare December 7, 2018 07:43
@sinhaashish sinhaashish force-pushed the DocsUpdate branch 2 times, most recently from 1b9cd51 to fa8c0ae Compare December 8, 2018 01:45
ebozduman
ebozduman previously approved these changes Dec 12, 2018
Copy link
Contributor

@ebozduman ebozduman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sinhaashish sinhaashish force-pushed the DocsUpdate branch 5 times, most recently from de86d0b to ff7ea89 Compare January 4, 2019 09:16
Java Docs been updated with adding the relevant exceptions, removing the
deprecated code.
@kannappanr
Copy link
Contributor

ping @balamurugana @ebozduman Can you please review again?

Copy link
Contributor

@ebozduman ebozduman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nitisht nitisht merged commit 700f700 into minio:master Jan 5, 2019
@sinhaashish sinhaashish deleted the DocsUpdate branch January 23, 2019 10:35
@kannappanr kannappanr mentioned this pull request Jan 30, 2019
@yashchavan2001
Copy link

  1. MinioClient minioClient = new MinioClient("https://play.minio.io:9000",9000, "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",true);
    2.boolean isExist = minioClient.bucketExists("asiatrip");

In java, There is error when I call line 2nd->
02-28 14:16:31.811 2766-2766/com.example.minio E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.minio, PID: 2766
java.lang.NoClassDefFoundError: com.google.common.escape.Escaper$1
at com.google.common.escape.Escaper.(Escaper.java:85)
at com.google.common.escape.UnicodeEscaper.(UnicodeEscaper.java:59)
at com.google.common.net.PercentEscaper.(PercentEscaper.java:85)
at com.google.common.net.UrlEscapers.(UrlEscapers.java:78)
at com.google.common.net.UrlEscapers.urlPathSegmentEscaper(UrlEscapers.java:111)
at io.minio.S3Escaper.(S3Escaper.java:24)
at io.minio.S3Escaper.encode(S3Escaper.java:30)
at io.minio.MinioClient.createRequest(MinioClient.java:893)
at io.minio.MinioClient.executeReq(MinioClient.java:1075)
at io.minio.MinioClient.execute(MinioClient.java:1056)
at io.minio.MinioClient.updateRegionCache(MinioClient.java:1213)
at io.minio.MinioClient.getRegion(MinioClient.java:1258)
at io.minio.MinioClient.executeHead(MinioClient.java:1306)
at io.minio.MinioClient.bucketExists(MinioClient.java:3280)
at com.example.minio.MinioObject.uploadObject(MinioObject.java:27)
at com.example.minio.MainActivity.onActivityResult(MainActivity.java:151)
at android.app.Activity.dispatchActivityResult(Activity.java:6556)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3814)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3861)
at android.app.ActivityThread.access$1500(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1463)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5619)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)

@nitisht
Copy link
Contributor

nitisht commented Feb 28, 2019

@yashchavan2001 please create a new issue with details like SDK version etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants