You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "prashantpogde (via GitHub)" <gi...@apache.org> on 2023/07/25 00:28:24 UTC

[GitHub] [ozone] prashantpogde commented on a diff in pull request #5108: HDDS-9072. Set isFile when creating OmKeyInfo for createFile code path

prashantpogde commented on code in PR #5108:
URL: https://github.com/apache/ozone/pull/5108#discussion_r1272877617


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -686,30 +686,33 @@ protected OmKeyInfo prepareFileInfo(
    * @return OmKeyInfo
    */
   @SuppressWarnings("parameterNumber")
-  protected OmKeyInfo createFileInfo(@Nonnull KeyArgs keyArgs,
+  protected OmKeyInfo createFileInfo(
+      @Nonnull KeyArgs keyArgs,
       @Nonnull List<OmKeyLocationInfo> locations,
       @Nonnull ReplicationConfig replicationConfig,
       long size,
       @Nullable FileEncryptionInfo encInfo,
       @Nonnull PrefixManager prefixManager,
       @Nullable OmBucketInfo omBucketInfo,
       OMFileRequest.OMPathInfoWithFSO omPathInfo,
-      long transactionLogIndex, long objectID) {
+      long transactionLogIndex, long objectID
+  ) {
     OmKeyInfo.Builder builder = new OmKeyInfo.Builder();
     builder.setVolumeName(keyArgs.getVolumeName())
-            .setBucketName(keyArgs.getBucketName())
-            .setKeyName(keyArgs.getKeyName())
-            .setOmKeyLocationInfos(Collections.singletonList(
-                    new OmKeyLocationInfoGroup(0, locations)))
-            .setCreationTime(keyArgs.getModificationTime())
-            .setModificationTime(keyArgs.getModificationTime())
-            .setDataSize(size)
-            .setReplicationConfig(replicationConfig)
-            .setFileEncryptionInfo(encInfo)
-            .setAcls(getAclsForKey(keyArgs, omBucketInfo, prefixManager))
-            .addAllMetadata(KeyValueUtil.getFromProtobuf(
-                    keyArgs.getMetadataList()))
-            .setUpdateID(transactionLogIndex);
+        .setBucketName(keyArgs.getBucketName())
+        .setKeyName(keyArgs.getKeyName())
+        .setOmKeyLocationInfos(Collections.singletonList(
+            new OmKeyLocationInfoGroup(0, locations)))
+        .setCreationTime(keyArgs.getModificationTime())
+        .setModificationTime(keyArgs.getModificationTime())
+        .setDataSize(size)
+        .setReplicationConfig(replicationConfig)
+        .setFileEncryptionInfo(encInfo)
+        .setAcls(getAclsForKey(keyArgs, omBucketInfo, prefixManager))
+        .addAllMetadata(KeyValueUtil.getFromProtobuf(
+            keyArgs.getMetadataList()))
+        .setUpdateID(transactionLogIndex)
+        .setFile(true);

Review Comment:
   yup, looks good.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org