You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2023/12/17 08:26:00 UTC
[jira] [Created] (HDDS-9943) Share TokenRenewer implementation between OFS and O3FS
Attila Doroszlai created HDDS-9943:
--------------------------------------
Summary: Share TokenRenewer implementation between OFS and O3FS
Key: HDDS-9943
URL: https://issues.apache.org/jira/browse/HDDS-9943
Project: Apache Ozone
Issue Type: Improvement
Components: Ozone Filesystem
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai
Both O3FS and OFS define their own {{TokenRenewer}} implementation.
Hadoop finds implementations via {{ServiceLoader}}, and uses the first one that handles the kind of token being used:
{code:title=https://github.com/apache/hadoop/blob/7db9895000860605a66dd6403005b0c61a6ed744/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java#L454-L470}
private static ServiceLoader<TokenRenewer> renewers =
ServiceLoader.load(TokenRenewer.class);
private synchronized TokenRenewer getRenewer() throws IOException {
if (renewer != null) {
return renewer;
}
renewer = TRIVIAL_RENEWER;
synchronized (renewers) {
Iterator<TokenRenewer> it = renewers.iterator();
while (it.hasNext()) {
try {
TokenRenewer candidate = it.next();
if (candidate.handleKind(this.kind)) {
renewer = candidate;
return renewer;
}
{code}
The two implementations are the same (not FileSystem-specific), kind is the same for both, so we can remove the duplicate one.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org