File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
hbase-server/src/main/java/org/apache/hadoop/hbase/security Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 1- /**
1+ /*
22 * Licensed to the Apache Software Foundation (ASF) under one
33 * or more contributor license agreements. See the NOTICE file
44 * distributed with this work for additional information
2121import java .io .DataInputStream ;
2222import java .io .IOException ;
2323import java .util .Map ;
24- import java .util .Optional ;
25-
2624import javax .security .sasl .Sasl ;
2725import javax .security .sasl .SaslException ;
2826import javax .security .sasl .SaslServer ;
29-
3027import org .apache .hadoop .hbase .security .provider .AttemptingUserProvidingSaslServer ;
3128import org .apache .hadoop .hbase .security .provider .SaslServerAuthenticationProvider ;
32- import org .apache .hadoop .security .UserGroupInformation ;
3329import org .apache .hadoop .security .token .SecretManager ;
3430import org .apache .hadoop .security .token .SecretManager .InvalidToken ;
3531import org .apache .hadoop .security .token .TokenIdentifier ;
@@ -66,11 +62,9 @@ public void dispose() {
6662 }
6763
6864 public String getAttemptingUser () {
69- Optional <UserGroupInformation > optionalUser = serverWithProvider .getAttemptingUser ();
70- if (optionalUser .isPresent ()) {
71- optionalUser .get ().toString ();
72- }
73- return "Unknown" ;
65+ return serverWithProvider .getAttemptingUser ()
66+ .map (Object ::toString )
67+ .orElse ("Unknown" );
7468 }
7569
7670 public byte [] wrap (byte [] buf , int off , int len ) throws SaslException {
You can’t perform that action at this time.
0 commit comments