HDDS-15481. Avoid re-encoding the URL safe token for each read chunk#10433
HDDS-15481. Avoid re-encoding the URL safe token for each read chunk#10433sodonnel wants to merge 1 commit into
Conversation
|
@sodonnel , this is a good catch! This problem was copied from BlockInputStream. How about we also fix BlockInputStream here? We should just change the token class from |
How far do you think we should go? Token is used all over the place - intellij just gives up searching for usages. The nicest fix would be to cache the encoded token inside the token object itself, but its a hadoop class, so we cannot easily change it just in Ozone. |
|
Just BlockInputStream/StreamBlockInputStream. I tried to change the code and the change seems not big. The reason to involve BlockInputStream here is that they have some shared code. |
What changes were proposed in this pull request?
This is a small performance improvement - the Token is re-encoded as a URL-safe base64 string on every call to readBlockImpl(), which will be called for each 1MB read.
We can cache the URL encoded value and on re-encode it if the token is refreshed.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15481
How was this patch tested?
Depends on existing tests.