smengcl commented on a change in pull request #2417: URL: https://github.com/apache/ozone/pull/2417#discussion_r677679368
########## File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DUResponse.java ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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 org.apache.hadoop.ozone.recon.api.types; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * HTTP Response wrapped for Disk Usage requests. + */ +public class DUResponse { + /** Path status. */ + @JsonProperty("status") + private ResponseStatus status; + + /** The number of subpaths under the request path. */ + @JsonProperty("count") + private int count; + + /** Encapsulates a DU instance for a subpath. */ + @JsonProperty("duData") + private List<DiskUsage> duData; + + public DUResponse() { + this.status = ResponseStatus.OK; + } + + public ResponseStatus getStatus() { + return this.status; + } + + public void setStatus(ResponseStatus status) { + this.status = status; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public List<DiskUsage> getDuData() { + return duData; + } + + public void setDuData(List<DiskUsage> duData) { + this.duData = duData; + } + + /** + * DU info for a path (path name, data size). + */ + public static class DiskUsage { + /** The subpath name. */ + @JsonProperty("subpath") Review comment: Let's just call this field "path". ```suggestion @JsonProperty("path") ``` Renaming this json property only should suffice for now, along with unit tests that checks this field from json, if any. You can leave the rest of the variable names subpath unchanged as they are hidden implementation details. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
