jojochuang commented on code in PR #7394:
URL: https://github.com/apache/ozone/pull/7394#discussion_r1834835413
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/security/SecretKeyManagerService.java:
##########
@@ -158,7 +158,6 @@ public void stop() {
}
public static boolean isSecretKeyEnable(SecurityConfig conf) {
- return conf.isSecurityEnabled() &&
- (conf.isBlockTokenEnabled() || conf.isContainerTokenEnabled());
+ return conf.isSecurityEnabled();
Review Comment:
why is this changed?
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/OzoneTokenIdentifier.java:
##########
@@ -125,7 +136,13 @@ public OzoneTokenIdentifier fromUniqueSerializedKey(byte[]
rawData)
setStrToSign(WritableUtils.readString(in));
} else {
this.tokenType = Type.DELEGATION_TOKEN;
- setOmCertSerialId(WritableUtils.readString(in));
+ String value = WritableUtils.readString(in);
+ try {
+ UUID.fromString(value);
+ setSecretKeyId(value);
+ } catch (IllegalArgumentException e) {
+ setOmCertSerialId(value);
+ }
Review Comment:
using exception handling for this case is probably going to be expensive.
what about:
```suggestion
UUID.fromString(value);
if (this.omCertSerialId == null || this.secretKeyId == null) {
setSecretKeyId(value);
} else {
setOmCertSerialId(value);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]