Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Provide information about Ozone's configured block size via Hadoop-compatible file system implementations by overriding getDefaultBlockSize() from FileSystem.

Ozone does not make new files visible until they are closed. This change allows Impala to query the actual configured block size and use this info during file write, instead of relying on the default block size, which can be overridden in config.

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

How was this patch tested?

Added unit test.

@adoroszlai adoroszlai self-assigned this Nov 24, 2020
@Override
public long getDefaultBlockSize() {
return (long) getConf().getStorageSize(
OZONE_SCM_BLOCK_SIZE, OZONE_SCM_BLOCK_SIZE_DEFAULT, StorageUnit.BYTES);
Copy link
Member

Choose a reason for hiding this comment

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

Is this block size used by client while writing? In create and createNonRecursive it tends to ignore the specified block size.
So, if it isn't correct, Isn't it same as not implementing it? FileSystem will anyway return some value, that can be tweaked as well by fs.local.block.size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In create and createNonRecursive it tends to ignore the specified block size.

Ozone also ignores it and uses uniform block size on server side (configurable via this OZONE_SCM_BLOCK_SIZE property).

can be tweaked as well by fs.local.block.size

You are right, we could achieve the same result by forcing this config to the same value as SCM block size. I think it's simpler and cleaner to override the method than to keep the config in sync.

@adoroszlai adoroszlai requested a review from arp7 November 24, 2020 21:03
Copy link
Contributor

@arp7 arp7 left a comment

Choose a reason for hiding this comment

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

+1

@arp7 arp7 merged commit f30aba7 into apache:master Dec 12, 2020
@adoroszlai adoroszlai deleted the HDDS-4503 branch December 12, 2020 21:15
@adoroszlai
Copy link
Contributor Author

Thanks @arp7 for reviewing and committing it. Thanks @ayushtkn for the review.

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