tanvipenumudy commented on code in PR #5115: URL: https://github.com/apache/ozone/pull/5115#discussion_r1277152839
########## hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java: ########## @@ -0,0 +1,189 @@ +/** + * 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.om.helpers; + +import java.io.IOException; + +import org.apache.hadoop.hdds.client.ECReplicationConfig; +import org.apache.hadoop.hdds.client.ReplicationConfig; +import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.BasicKeyInfo; + +/** + * Lightweight OmKeyInfo class. + */ +public class BasicOmKeyInfo { + + private String volumeName; + private String bucketName; + private String keyName; + private long dataSize; + private long creationTime; + private long modificationTime; + private ReplicationConfig replicationConfig; + private boolean isFile; + + @SuppressWarnings("parameternumber") + public BasicOmKeyInfo(String volumeName, String bucketName, String keyName, + long dataSize, long creationTime, long modificationTime, + ReplicationConfig replicationConfig, boolean isFile) { + this.volumeName = volumeName; + this.bucketName = bucketName; + this.keyName = keyName; + this.dataSize = dataSize; + this.creationTime = creationTime; + this.modificationTime = modificationTime; + this.replicationConfig = replicationConfig; + this.isFile = isFile; + } + + public String getVolumeName() { + return volumeName; + } + + public String getBucketName() { + return bucketName; + } + + public String getKeyName() { + return keyName; + } + + public long getDataSize() { + return dataSize; + } + + public long getCreationTime() { + return creationTime; + } + + public long getModificationTime() { + return modificationTime; + } + + public ReplicationConfig getReplicationConfig() { + return replicationConfig; + } + + public boolean isFile() { + return isFile; + } + + /** + * Builder of BasicOmKeyInfo. + */ + public static class Builder { + private String volumeName; + private String bucketName; + private String keyName; + private long dataSize; + private long creationTime; + private long modificationTime; + private ReplicationConfig replicationConfig; + private boolean isFile; + + public Builder setVolumeName(String volumeName) { + this.volumeName = volumeName; + return this; + } + + public Builder setBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + public Builder setKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + public Builder setDataSize(long dataSize) { + this.dataSize = dataSize; + return this; + } + + public Builder setCreationTime(long creationTime) { + this.creationTime = creationTime; + return this; + } + + public Builder setModificationTime(long modificationTime) { + this.modificationTime = modificationTime; + return this; + } + + public Builder setReplicationConfig(ReplicationConfig replicationConfig) { + this.replicationConfig = replicationConfig; + return this; + } + + public Builder setIsFile(boolean isFile) { + this.isFile = isFile; + return this; + } + + public BasicOmKeyInfo build() { + return new BasicOmKeyInfo(volumeName, bucketName, keyName, dataSize, + creationTime, modificationTime, replicationConfig, isFile); + } + } + + public BasicKeyInfo getProtobuf() { Review Comment: Thank you @hemantk-12, I missed this. I made the required changes. -- 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]
