@ SuppressWarnings ( "OptionalGetWithoutIsPresent" ) public Token < DelegationTokenIdentifier > getBoundOrNewDT ( String renewer ) throws IOException { logger . atFine ( ) . log ( "Delegation token requested" ) ; if ( isBoundToDT ( ) ) { // the FS was created on startup with a token, so return it. logger . atFine ( ) . log ( "Returning current token" ) ; return getBoundDT ( ) ; } // not bound to a token, so create a new one. // issued DTs are not cached so that long-lived filesystems can // reliably issue session/role tokens. return tokenBinding . createDelegationToken ( renewer ) ; }
Get any bound DT or create a new one .