/// <exception cref="System.IO.IOException"/> private TokenAspect.TokenManagementDelegator GetInstance <_T0>(Org.Apache.Hadoop.Security.Token.Token <_T0> token, Configuration conf) where _T0 : TokenIdentifier { URI uri; string scheme = GetSchemeByKind(token.GetKind()); if (HAUtil.IsTokenForLogicalUri(token)) { uri = HAUtil.GetServiceUriFromToken(scheme, token); } else { IPEndPoint address = SecurityUtil.GetTokenServiceAddr(token); uri = URI.Create(scheme + "://" + NetUtils.GetHostPortString(address)); } return((TokenAspect.TokenManagementDelegator)FileSystem.Get(uri, conf)); }