Skip to content

Conversation

@JyotinderSingh
Copy link
Contributor

@JyotinderSingh JyotinderSingh commented Apr 12, 2022

What changes were proposed in this pull request?

This task to modify the existing default bucket layout at the OM server and Ozone shell command to LEGACY.

OMConfigKeys.java#L283

ozone.default.bucket.layout = LEGACY

CreateBucketHandler.java#L64

  @Option(names = { "--layout", "-l" },
      description = "Allowed Bucket Layouts: ${COMPLETION-CANDIDATES}",
      defaultValue = "OBJECT_STORE")

Changing to LEGACY will make the cluster upgrades easier. An older version client can talk to the new OM server using LEGACY buckets.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6561

How was this patch tested?

Integration tests.

@rakeshadr
Copy link
Contributor

Please remove the test config that introduced to satisfy default OBS behavior at the OM server side.

OzoneConfigKeys.java


  public static final String OZONE_CLIENT_TEST_OFS_DEFAULT_BUCKET_LAYOUT =
      "ozone.client.test.ofs.default.bucket.layout";

       // Fetches the bucket layout to be used by OFS.
      this.defaultOFSBucketLayout = BucketLayout.fromString(
          conf.get(OzoneConfigKeys.OZONE_CLIENT_TEST_OFS_DEFAULT_BUCKET_LAYOUT,
              OzoneConfigKeys.OZONE_CLIENT_TEST_OFS_BUCKET_LAYOUT_DEFAULT));

@rakeshadr
Copy link
Contributor

@JyotinderSingh Adding one more point to the above, no need to persist LEGACY layout in the OM DB. Only persist OBS or FSO layouts. Please feel free to create a separate task if it requires more changes.

public class OmBucketInfoCodec implements Codec<OmBucketInfo> {

  @Override
  public byte[] toPersistedFormat(OmBucketInfo object) throws IOException {
    Preconditions
        .checkNotNull(object, "Null object can't be converted to byte array.");
    return object.getProtobuf().toByteArray();
  }

@JyotinderSingh
Copy link
Contributor Author

Please remove the test config that introduced to satisfy default OBS behavior at the OM server side.

OzoneConfigKeys.java


  public static final String OZONE_CLIENT_TEST_OFS_DEFAULT_BUCKET_LAYOUT =
      "ozone.client.test.ofs.default.bucket.layout";

       // Fetches the bucket layout to be used by OFS.
      this.defaultOFSBucketLayout = BucketLayout.fromString(
          conf.get(OzoneConfigKeys.OZONE_CLIENT_TEST_OFS_DEFAULT_BUCKET_LAYOUT,
              OzoneConfigKeys.OZONE_CLIENT_TEST_OFS_BUCKET_LAYOUT_DEFAULT));

Done

Copy link
Contributor

@rakeshadr rakeshadr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM, Thanks @JyotinderSingh for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants