forked from minio/minio-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AdminClient: add getDataUsageInfo API (minio#1382)
Signed-off-by: Lukas Raska <[email protected]>
- Loading branch information
1 parent
b84d7a1
commit 3a87a2a
Showing
9 changed files
with
488 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
adminapi/src/main/java/io/minio/admin/messages/AllTierStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2022 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
/** | ||
* Collection of per-tier stats across all configured remote tiers | ||
* | ||
* @see <a | ||
* href="https://github.com/minio/minio/blob/master/cmd/data-usage-cache.go#L63">data-usage-cache.go</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AllTierStats { | ||
@JsonProperty("Tiers") | ||
private Map<String, TierStats> tiers; | ||
|
||
public Map<String, TierStats> tiers() { | ||
return Collections.unmodifiableMap(this.tiers); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
adminapi/src/main/java/io/minio/admin/messages/BucketTargetUsageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2022 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Represents bucket replica stats of the current object APi. | ||
* | ||
* @see <a | ||
* href="https://github.com/minio/minio/blob/master/cmd/data-usage-utils.go#L34">data-usage-utils.go</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class BucketTargetUsageInfo { | ||
@JsonProperty("objectsPendingReplicationTotalSize") | ||
private long objectsPendingReplicationTotalSize; | ||
|
||
@JsonProperty("objectsFailedReplicationTotalSize") | ||
private long objectsFailedReplicationTotalSize; | ||
|
||
@JsonProperty("objectsReplicatedTotalSize") | ||
private long objectsReplicatedTotalSize; | ||
|
||
@JsonProperty("objectReplicaTotalSize") | ||
private long objectReplicaTotalSize; | ||
|
||
@JsonProperty("objectsPendingReplicationCount") | ||
private long objectsPendingReplicationCount; | ||
|
||
@JsonProperty("objectsFailedReplicationCount") | ||
private long objectsFailedReplicationCount; | ||
|
||
public long objectsPendingReplicationTotalSize() { | ||
return objectsPendingReplicationTotalSize; | ||
} | ||
|
||
public long objectsFailedReplicationTotalSize() { | ||
return objectsFailedReplicationTotalSize; | ||
} | ||
|
||
public long objectsReplicatedTotalSize() { | ||
return objectsReplicatedTotalSize; | ||
} | ||
|
||
public long objectReplicaTotalSize() { | ||
return objectReplicaTotalSize; | ||
} | ||
|
||
public long objectsPendingReplicationCount() { | ||
return objectsPendingReplicationCount; | ||
} | ||
|
||
public long objectsFailedReplicationCount() { | ||
return objectsFailedReplicationCount; | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
adminapi/src/main/java/io/minio/admin/messages/BucketUsageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2022 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
/** | ||
* Represents bucket usage stats of the current object APi. | ||
* | ||
* @see <a | ||
* href="https://github.com/minio/minio/blob/master/cmd/data-usage-utils.go#L47">data-usage-utils.go</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class BucketUsageInfo { | ||
@JsonProperty("size") | ||
private long size; | ||
|
||
@JsonProperty("objectsPendingReplicationTotalSize") | ||
private long objectsPendingReplicationTotalSize; | ||
|
||
@JsonProperty("objectsFailedReplicationTotalSize") | ||
private long objectsFailedReplicationTotalSize; | ||
|
||
@JsonProperty("objectsReplicatedTotalSize") | ||
private long objectsReplicatedTotalSize; | ||
|
||
@JsonProperty("objectsPendingReplicationCount") | ||
private long objectsPendingReplicationCount; | ||
|
||
@JsonProperty("objectsFailedReplicationCount") | ||
private long objectsFailedReplicationCount; | ||
|
||
@JsonProperty("objectsCount") | ||
private long objectsCount; | ||
|
||
@JsonProperty("objectsSizesHistogram") | ||
private Map<String, Long> objectsSizesHistogram; | ||
|
||
@JsonProperty("versionsCount") | ||
private long versionsCount; | ||
|
||
@JsonProperty("objectReplicaTotalSize") | ||
private long objectReplicaTotalSize; | ||
|
||
@JsonProperty("objectsReplicationInfo") | ||
private Map<String, BucketTargetUsageInfo> objectsReplicationInfo; | ||
|
||
public long size() { | ||
return size; | ||
} | ||
|
||
public long objectsPendingReplicationTotalSize() { | ||
return objectsPendingReplicationTotalSize; | ||
} | ||
|
||
public long objectsFailedReplicationTotalSize() { | ||
return objectsFailedReplicationTotalSize; | ||
} | ||
|
||
public long objectsReplicatedTotalSize() { | ||
return objectsReplicatedTotalSize; | ||
} | ||
|
||
public long objectsPendingReplicationCount() { | ||
return objectsPendingReplicationCount; | ||
} | ||
|
||
public long objectsFailedReplicationCount() { | ||
return objectsFailedReplicationCount; | ||
} | ||
|
||
public long objectsCount() { | ||
return objectsCount; | ||
} | ||
|
||
public Map<String, Long> objectsSizesHistogram() { | ||
return Collections.unmodifiableMap(this.objectsSizesHistogram); | ||
} | ||
|
||
public long versionsCount() { | ||
return versionsCount; | ||
} | ||
|
||
public long objectReplicaTotalSize() { | ||
return objectReplicaTotalSize; | ||
} | ||
|
||
public Map<String, BucketTargetUsageInfo> objectsReplicationInfo() { | ||
return Collections.unmodifiableMap(this.objectsReplicationInfo); | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
adminapi/src/main/java/io/minio/admin/messages/DataUsageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2022 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.time.ZonedDateTime; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
/** | ||
* Represents data usage stats of the current object APi. | ||
* | ||
* @see <a | ||
* href="https://github.com/minio/minio/blob/master/cmd/data-usage-utils.go#L69">data-usage-utils.go</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class DataUsageInfo { | ||
|
||
@JsonProperty("lastUpdate") | ||
private ZonedDateTime lastUpdate; | ||
|
||
@JsonProperty("objectsCount") | ||
private long objectsCount; | ||
|
||
@JsonProperty("versionsCount") | ||
private long versionsCount; | ||
|
||
@JsonProperty("objectsTotalSize") | ||
private long objectsTotalSize; | ||
|
||
@JsonProperty("objectsReplicationInfo") | ||
private Map<String, BucketTargetUsageInfo> objectsReplicationInfo; | ||
|
||
@JsonProperty("bucketsCount") | ||
private long bucketsCount; | ||
|
||
@JsonProperty("bucketsUsageInfo") | ||
private Map<String, BucketUsageInfo> bucketsUsageInfo; | ||
|
||
@JsonProperty("bucketsSizes") | ||
private Map<String, Long> bucketsSizes; | ||
|
||
@JsonProperty("tierStats") | ||
private AllTierStats tierStats; | ||
|
||
public ZonedDateTime lastUpdate() { | ||
return lastUpdate; | ||
} | ||
|
||
public long objectsCount() { | ||
return objectsCount; | ||
} | ||
|
||
public long versionsCount() { | ||
return versionsCount; | ||
} | ||
|
||
public long objectsTotalSize() { | ||
return objectsTotalSize; | ||
} | ||
|
||
public Map<String, BucketTargetUsageInfo> objectsReplicationInfo() { | ||
return Collections.unmodifiableMap(this.objectsReplicationInfo); | ||
} | ||
|
||
public long bucketsCount() { | ||
return bucketsCount; | ||
} | ||
|
||
public Map<String, BucketUsageInfo> bucketsUsageInfo() { | ||
return Collections.unmodifiableMap(this.bucketsUsageInfo); | ||
} | ||
|
||
public Map<String, Long> bucketsSizes() { | ||
return bucketsSizes; | ||
} | ||
|
||
public AllTierStats tierStats() { | ||
return tierStats; | ||
} | ||
} |
Oops, something went wrong.