Skip to content

Commit f5864e0

Browse files
Merge branch 'master' into add-executor-service-to-builder
2 parents 71d5ace + 51940f6 commit f5864e0

File tree

11 files changed

+229
-17
lines changed

11 files changed

+229
-17
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ Java 1.8 or above.
1212
<dependency>
1313
<groupId>io.minio</groupId>
1414
<artifactId>minio</artifactId>
15-
<version>8.5.14</version>
15+
<version>8.5.15</version>
1616
</dependency>
1717
```
1818

1919
## Gradle usage
2020
```
2121
dependencies {
22-
implementation("io.minio:minio:8.5.14")
22+
implementation("io.minio:minio:8.5.15")
2323
}
2424
```
2525

2626
## JAR download
27-
The latest JAR can be downloaded from [here](https://repo1.maven.org/maven2/io/minio/minio/8.5.14/)
27+
The latest JAR can be downloaded from [here](https://repo1.maven.org/maven2/io/minio/minio/8.5.15/)
2828

2929
## Quick Start Example - File Uploader
3030
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
@@ -92,12 +92,12 @@ public class FileUploader {
9292

9393
#### Compile FileUploader
9494
```sh
95-
$ javac -cp minio-8.5.14-all.jar FileUploader.java
95+
$ javac -cp minio-8.5.15-all.jar FileUploader.java
9696
```
9797

9898
#### Run FileUploader
9999
```sh
100-
$ java -cp minio-8.5.14-all.jar:. FileUploader
100+
$ java -cp minio-8.5.15-all.jar:. FileUploader
101101
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
102102

103103
$ mc ls play/asiatrip/

adminapi/src/main/java/io/minio/admin/messages/info/DiskMetrics.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package io.minio.admin.messages.info;
1919

20+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2021
import com.fasterxml.jackson.annotation.JsonProperty;
2122
import java.util.Collections;
2223
import java.util.Map;
@@ -27,6 +28,7 @@
2728
* @see <a href=
2829
* "https://github.com/minio/madmin-go/blob/main/info-commands.go#L395">info-commands.go</a>
2930
*/
31+
@JsonIgnoreProperties(ignoreUnknown = true)
3032
public class DiskMetrics {
3133
@JsonProperty("lastMinute")
3234
private Map<String, TimedAction> lastMinute;
@@ -40,6 +42,18 @@ public class DiskMetrics {
4042
@JsonProperty("totalErrorsTimeout")
4143
private Integer totalErrorsTimeout;
4244

45+
@JsonProperty("totalTokens")
46+
private Long totalTokens;
47+
48+
@JsonProperty("totalWaiting")
49+
private Long totalWaiting;
50+
51+
@JsonProperty("totalWrites")
52+
private Long totalWrites;
53+
54+
@JsonProperty("totalDeletes")
55+
private Long totalDeletes;
56+
4357
public Integer totalErrorsAvailability() {
4458
return totalErrorsAvailability;
4559
}
@@ -55,4 +69,20 @@ public Map<String, TimedAction> lastMinute() {
5569
public Map<String, String> apiCalls() {
5670
return Collections.unmodifiableMap(apiCalls);
5771
}
72+
73+
public Long totalTokens() {
74+
return totalTokens;
75+
}
76+
77+
public Long totalWaiting() {
78+
return totalWaiting;
79+
}
80+
81+
public Long totalWrites() {
82+
return totalWrites;
83+
}
84+
85+
public Long totalDeletes() {
86+
return totalDeletes;
87+
}
5888
}

api/src/main/java/io/minio/MinioAsyncClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ public CompletableFuture<ObjectWriteResponse> copyObject(CopyObjectArgs args)
536536
args.region(),
537537
args.object(),
538538
result.etag(),
539-
response.header("x-amz-version-id"));
539+
response.header("x-amz-version-id"),
540+
result);
540541
} catch (XmlParserException e) {
541542
throw new CompletionException(e);
542543
} finally {

api/src/main/java/io/minio/ObjectWriteResponse.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,68 @@
1616

1717
package io.minio;
1818

19+
import io.minio.messages.CompleteMultipartUploadOutput;
20+
import io.minio.messages.CopyObjectResult;
1921
import okhttp3.Headers;
2022

2123
/** Response class of any APIs doing object creation. */
2224
public class ObjectWriteResponse extends GenericResponse {
2325
private String etag;
2426
private String versionId;
27+
private String checksumCRC32;
28+
private String checksumCRC32C;
29+
private String checksumSHA1;
30+
private String checksumSHA256;
2531

2632
public ObjectWriteResponse(
2733
Headers headers, String bucket, String region, String object, String etag, String versionId) {
2834
super(headers, bucket, region, object);
2935
this.etag = etag;
3036
this.versionId = versionId;
37+
if (headers != null) {
38+
this.checksumCRC32 = headers.get("x-amz-checksum-crc32");
39+
this.checksumCRC32C = headers.get("x-amz-checksum-crc32c");
40+
this.checksumSHA1 = headers.get("x-amz-checksum-sha1");
41+
this.checksumSHA256 = headers.get("x-amz-checksum-sha256");
42+
}
43+
}
44+
45+
public ObjectWriteResponse(
46+
Headers headers,
47+
String bucket,
48+
String region,
49+
String object,
50+
String etag,
51+
String versionId,
52+
CopyObjectResult result) {
53+
super(headers, bucket, region, object);
54+
this.etag = etag;
55+
this.versionId = versionId;
56+
if (result != null) {
57+
this.checksumCRC32 = result.checksumCRC32();
58+
this.checksumCRC32C = result.checksumCRC32C();
59+
this.checksumSHA1 = result.checksumSHA1();
60+
this.checksumSHA256 = result.checksumSHA256();
61+
}
62+
}
63+
64+
public ObjectWriteResponse(
65+
Headers headers,
66+
String bucket,
67+
String region,
68+
String object,
69+
String etag,
70+
String versionId,
71+
CompleteMultipartUploadOutput result) {
72+
super(headers, bucket, region, object);
73+
this.etag = etag;
74+
this.versionId = versionId;
75+
if (result != null) {
76+
this.checksumCRC32 = result.checksumCRC32();
77+
this.checksumCRC32C = result.checksumCRC32C();
78+
this.checksumSHA1 = result.checksumSHA1();
79+
this.checksumSHA256 = result.checksumSHA256();
80+
}
3181
}
3282

3383
public String etag() {
@@ -37,4 +87,20 @@ public String etag() {
3787
public String versionId() {
3888
return versionId;
3989
}
90+
91+
public String checksumCRC32() {
92+
return checksumCRC32;
93+
}
94+
95+
public String checksumCRC32C() {
96+
return checksumCRC32C;
97+
}
98+
99+
public String checksumSHA1() {
100+
return checksumSHA1;
101+
}
102+
103+
public String checksumSHA256() {
104+
return checksumSHA256;
105+
}
40106
}

api/src/main/java/io/minio/S3Base.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,14 @@ public void onFailure(final Call call, IOException e) {
634634

635635
@Override
636636
public void onResponse(Call call, final Response response) throws IOException {
637+
try {
638+
onResponse(response);
639+
} catch (Exception e) {
640+
completableFuture.completeExceptionally(e);
641+
}
642+
}
643+
644+
private void onResponse(final Response response) throws IOException {
637645
String trace =
638646
response.protocol().toString().toUpperCase(Locale.US)
639647
+ " "
@@ -1867,7 +1875,7 @@ protected CompletableFuture<StatObjectResponse> statObjectAsync(StatObjectArgs a
18671875
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
18681876
* @throws XmlParserException thrown to indicate XML parsing error.
18691877
*/
1870-
protected CompletableFuture<AbortMultipartUploadResponse> abortMultipartUploadAsync(
1878+
public CompletableFuture<AbortMultipartUploadResponse> abortMultipartUploadAsync(
18711879
String bucketName,
18721880
String region,
18731881
String objectName,
@@ -1975,7 +1983,7 @@ protected AbortMultipartUploadResponse abortMultipartUpload(
19751983
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
19761984
* @throws XmlParserException thrown to indicate XML parsing error.
19771985
*/
1978-
protected CompletableFuture<ObjectWriteResponse> completeMultipartUploadAsync(
1986+
public CompletableFuture<ObjectWriteResponse> completeMultipartUploadAsync(
19791987
String bucketName,
19801988
String region,
19811989
String objectName,
@@ -2035,7 +2043,8 @@ protected CompletableFuture<ObjectWriteResponse> completeMultipartUploadAsync(
20352043
result.location(),
20362044
result.object(),
20372045
result.etag(),
2038-
response.header("x-amz-version-id"));
2046+
response.header("x-amz-version-id"),
2047+
result);
20392048
} catch (XmlParserException e) {
20402049
// As this CompleteMultipartUpload REST call succeeded, just log it.
20412050
Logger.getLogger(S3Base.class.getName())
@@ -2126,7 +2135,7 @@ protected ObjectWriteResponse completeMultipartUpload(
21262135
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
21272136
* @throws XmlParserException thrown to indicate XML parsing error.
21282137
*/
2129-
protected CompletableFuture<CreateMultipartUploadResponse> createMultipartUploadAsync(
2138+
public CompletableFuture<CreateMultipartUploadResponse> createMultipartUploadAsync(
21302139
String bucketName,
21312140
String region,
21322141
String objectName,
@@ -3190,7 +3199,7 @@ protected ObjectWriteResponse putObject(
31903199
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
31913200
* @throws XmlParserException thrown to indicate XML parsing error.
31923201
*/
3193-
protected CompletableFuture<ListMultipartUploadsResponse> listMultipartUploadsAsync(
3202+
public CompletableFuture<ListMultipartUploadsResponse> listMultipartUploadsAsync(
31943203
String bucketName,
31953204
String region,
31963205
String delimiter,
@@ -3339,7 +3348,7 @@ protected ListMultipartUploadsResponse listMultipartUploads(
33393348
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
33403349
* @throws XmlParserException thrown to indicate XML parsing error.
33413350
*/
3342-
protected CompletableFuture<ListPartsResponse> listPartsAsync(
3351+
public CompletableFuture<ListPartsResponse> listPartsAsync(
33433352
String bucketName,
33443353
String region,
33453354
String objectName,
@@ -3475,7 +3484,7 @@ protected ListPartsResponse listParts(
34753484
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
34763485
* @throws XmlParserException thrown to indicate XML parsing error.
34773486
*/
3478-
protected CompletableFuture<UploadPartResponse> uploadPartAsync(
3487+
public CompletableFuture<UploadPartResponse> uploadPartAsync(
34793488
String bucketName,
34803489
String region,
34813490
String objectName,
@@ -3549,7 +3558,7 @@ protected CompletableFuture<UploadPartResponse> uploadPartAsync(
35493558
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
35503559
* @throws XmlParserException thrown to indicate XML parsing error.
35513560
*/
3552-
protected CompletableFuture<UploadPartResponse> uploadPartAsync(
3561+
public CompletableFuture<UploadPartResponse> uploadPartAsync(
35533562
String bucketName,
35543563
String region,
35553564
String objectName,
@@ -3752,7 +3761,7 @@ protected UploadPartCopyResponse uploadPartCopy(
37523761
* @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library.
37533762
* @throws XmlParserException thrown to indicate XML parsing error.
37543763
*/
3755-
protected CompletableFuture<UploadPartCopyResponse> uploadPartCopyAsync(
3764+
public CompletableFuture<UploadPartCopyResponse> uploadPartCopyAsync(
37563765
String bucketName,
37573766
String region,
37583767
String objectName,

api/src/main/java/io/minio/messages/AndOperator.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ public class AndOperator {
3131
@Convert(PrefixConverter.class)
3232
private String prefix;
3333

34+
@Element(name = "ObjectSizeLessThan", required = false)
35+
private Integer objectSizeLessThan;
36+
37+
@Element(name = "ObjectSizeGreaterThan", required = false)
38+
private Integer objectSizeGreaterThan;
39+
3440
@ElementMap(
3541
attribute = false,
3642
entry = "Tag",
@@ -67,10 +73,37 @@ public AndOperator(
6773
this.tags = (tags != null) ? Collections.unmodifiableMap(tags) : null;
6874
}
6975

76+
public AndOperator(
77+
@Nullable @Element(name = "Prefix", required = false) String prefix,
78+
@Nullable
79+
@ElementMap(
80+
attribute = false,
81+
entry = "Tag",
82+
inline = true,
83+
key = "Key",
84+
value = "Value",
85+
required = false)
86+
Map<String, String> tags,
87+
@Nullable @Element(name = "ObjectSizeLessThan", required = false) Integer objectSizeLessThan,
88+
@Nullable @Element(name = "ObjectSizeGreaterThan", required = false)
89+
Integer objectSizeGreaterThan) {
90+
this(prefix, tags);
91+
this.objectSizeLessThan = objectSizeLessThan;
92+
this.objectSizeGreaterThan = objectSizeGreaterThan;
93+
}
94+
7095
public String prefix() {
7196
return this.prefix;
7297
}
7398

99+
public Integer objectSizeLessThan() {
100+
return this.objectSizeLessThan;
101+
}
102+
103+
public Integer objectSizeGreaterThan() {
104+
return this.objectSizeGreaterThan;
105+
}
106+
74107
public Map<String, String> tags() {
75108
return this.tags;
76109
}

api/src/main/java/io/minio/messages/CopyObjectResult.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ public class CopyObjectResult {
3535
@Element(name = "LastModified")
3636
private ResponseDate lastModified;
3737

38+
@Element(name = "ChecksumCRC32", required = false)
39+
private String checksumCRC32;
40+
41+
@Element(name = "ChecksumCRC32C", required = false)
42+
private String checksumCRC32C;
43+
44+
@Element(name = "ChecksumSHA1", required = false)
45+
private String checksumSHA1;
46+
47+
@Element(name = "ChecksumSHA256", required = false)
48+
private String checksumSHA256;
49+
3850
public CopyObjectResult() {}
3951

4052
/** Returns ETag of the object. */
@@ -46,4 +58,20 @@ public String etag() {
4658
public ZonedDateTime lastModified() {
4759
return lastModified.zonedDateTime();
4860
}
61+
62+
public String checksumCRC32() {
63+
return checksumCRC32;
64+
}
65+
66+
public String checksumCRC32C() {
67+
return checksumCRC32C;
68+
}
69+
70+
public String checksumSHA1() {
71+
return checksumSHA1;
72+
}
73+
74+
public String checksumSHA256() {
75+
return checksumSHA256;
76+
}
4977
}

0 commit comments

Comments
 (0)