}
@Override
public boolean isManaged(Token<?> token) throws IOException {
ByteArrayInputStream buf = new ByteArrayInputStream(token.getIdentifier());
DelegationTokenIdentifier id = new DelegationTokenIdentifier();
id.readFields(new DataInputStream(buf));
// AbstractDelegationToken converts given renewer to a short name, but
// AbstractDelegationTokenSecretManager does not, so we have to do it
String loginUser = UserGroupInformation.getLoginUser().getShortUserName();
return loginUser.equals(id.getRenewer().toString());
}