Skip to content

Conversation

@elek
Copy link
Member

@elek elek commented Nov 2, 2020

What changes were proposed in this pull request?

In HDDS-4185 we agreed to introduce a new configuration for the Ozone client to adjust the behavior of incremental byte buffer.

When I started to add it I realized the code is already very complex as all the required configuration values are propagated manually to the Key/Block/ChunkOutputstream as induvidual constructor parameters.

In this patch I simplify the structure with using only one POJO with configuration annotations.

What is the link to the Apache JIRA

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

How was this patch tested?

With full CI on my fork.

@elek elek changed the title Hdds 4417 HDDS-4417. Simplify Ozone client code with configuration object Nov 2, 2020
@bshashikant
Copy link
Contributor

bshashikant commented Nov 11, 2020

@elek , can u check the failed checks. The changes in general look good to me. Will look into it in more detail.

@elek
Copy link
Member Author

elek commented Nov 11, 2020

@elek , can u check the failed checks. The changes in general look good to me. Will look into it in more detail.

Thanks to check it. Yes, I am fixing the failures. It was green on my fork, so must be some silly mistake.

@bshashikant bshashikant merged commit fdbd5da into apache:master Nov 12, 2020
@bshashikant
Copy link
Contributor

Thanks @elek for the contribution.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @elek for this refactoring. I noticed a few issues, can they be addressed in an addendum?

public OzoneClientConfig() {
}

private void validate() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently validate() is unused. I think it should have @PostConstruct annotation.

Comment on lines +99 to +101
if (getToken() != null) {
UserGroupInformation.getCurrentUser().addToken(getToken());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This was removed on master in HDDS-4285. I don't think it should have been restored in the merge.

verifyVolumeName(volumeName);
verifyBucketName(bucketName);
if(checkKeyNameEnabled) {
if (clientConfig.isStreamBufferFlushDelay()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is not the same as previously.

Comment on lines +89 to +102
OzoneClientConfig config = new OzoneClientConfig();
config.setChecksumType(ChecksumType.NONE);
conf.setFromObject(config);

conf.setTimeDuration(HDDS_SCM_WATCHER_TIMEOUT, 1000, TimeUnit.MILLISECONDS);
conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 3, TimeUnit.SECONDS);
conf.set(OzoneConfigKeys.OZONE_CLIENT_CHECKSUM_TYPE, "NONE");
conf.setQuietMode(false);
conf.setStorageSize(OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE, 4,
StorageUnit.MB);
conf.setBoolean(OZONE_CLIENT_STREAM_BUFFER_FLUSH_DELAY, false);

OzoneClientConfig clientConfig = conf.getObject(OzoneClientConfig.class);
clientConfig.setStreamBufferFlushDelay(false);
conf.setFromObject(clientConfig);

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: two blocks of OzoneClientConfig can be merged:

    OzoneClientConfig clientConfig = conf.getObject(OzoneClientConfig.class);
    clientConfig.setChecksumType(ChecksumType.NONE);
    clientConfig.setStreamBufferFlushDelay(false);
    conf.setFromObject(clientConfig);

@BeforeClass
public static void init() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf.setFromObject(new OzoneClientConfig());
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: aren't defaults set automatically without this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's supposed to be set. I was confused by the other pattern used elsewhere:

  1. create OzoneConfig
  2. set custom properties by setter
  3. Here we need to export OzoneClientConfig
  4. modify tags
  5. reset OzoneClientConfig to OzoneConfig

@elek
Copy link
Member Author

elek commented Nov 13, 2020

Thanks the suggestions @adoroszlai Will create a new PR with the same HDDS-4417 tag shortly.

@adoroszlai
Copy link
Contributor

Will create a new PR with the same HDDS-4417 tag shortly.

Done: #1581

@elek
Copy link
Member Author

elek commented Nov 13, 2020

Done: #1581

Oh, missed it. Thanks for the fixes.

@adoroszlai
Copy link
Contributor

Done: #1581

Oh, missed it. Thanks for the fixes.

It's not yet in, needs review.

errose28 added a commit to errose28/ozone that referenced this pull request Nov 18, 2020
* master: (53 commits)
  HDDS-4458. Fix Max Transaction ID value in OM. (apache#1585)
  HDDS-4442. Disable the location information of audit logger to reduce overhead (apache#1567)
  HDDS-4441. Add metrics for ACL related operations.(Addendum for HA). (apache#1584)
  HDDS-4081. Create ZH translation of StorageContainerManager.md in doc. (apache#1558)
  HDDS-4080. Create ZH translation of OzoneManager.md in doc. (apache#1541)
  HDDS-4079. Create ZH translation of Containers.md in doc. (apache#1539)
  HDDS-4184. Add Features menu for Chinese document. (apache#1547)
  HDDS-4235. Ozone client FS path validation is not present in OFS. (apache#1582)
  HDDS-4338. Fix the issue that SCM web UI banner shows "HDFS SCM". (apache#1583)
  HDDS-4337. Implement RocksDB options cache for new datanode DB utilities. (apache#1544)
  HDDS-4083. Create ZH translation of Recon.md in doc (apache#1575)
  HDDS-4453. Replicate closed container for random selected datanodes. (apache#1574)
  HDDS-4408: terminate Datanode when Datanode State Machine Thread got uncaught exception. (apache#1533)
  HDDS-4443. Recon: Using Mysql database throws exception and fails startup (apache#1570)
  HDDS-4315. Use Epoch to generate unique ObjectIDs (apache#1480)
  HDDS-4455. Fix typo in README.md doc (apache#1578)
  HDDS-4441. Add metrics for ACL related operations. (apache#1571)
  HDDS-4437. Avoid unnecessary builder conversion in setting volume Quota/Owner request (apache#1564)
  HDDS-4417. Simplify Ozone client code with configuration object (apache#1542)
  HDDS-4363. Add metric to track the number of RocksDB open/close operations. (apache#1530)
  ...
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.

3 participants