当前位置: 首页>>代码示例>>Java>>正文


Java DelegationTokenSecretManager.getTokenTrackingId方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager.getTokenTrackingId方法的典型用法代码示例。如果您正苦于以下问题:Java DelegationTokenSecretManager.getTokenTrackingId方法的具体用法?Java DelegationTokenSecretManager.getTokenTrackingId怎么用?Java DelegationTokenSecretManager.getTokenTrackingId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager的用法示例。


在下文中一共展示了DelegationTokenSecretManager.getTokenTrackingId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logAuditEvent

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
@Override
public void logAuditEvent(boolean succeeded, String userName,
    InetAddress addr, String cmd, String src, String dst,
    FileStatus status, UserGroupInformation ugi,
    DelegationTokenSecretManager dtSecretManager) {
  if (auditLog.isInfoEnabled()) {
    final StringBuilder sb = auditBuffer.get();
    sb.setLength(0);
    sb.append("allowed=").append(succeeded).append("\t");
    sb.append("ugi=").append(userName).append("\t");
    sb.append("ip=").append(addr).append("\t");
    sb.append("cmd=").append(cmd).append("\t");
    sb.append("src=").append(src).append("\t");
    sb.append("dst=").append(dst).append("\t");
    if (null == status) {
      sb.append("perm=null");
    } else {
      sb.append("perm=");
      sb.append(status.getOwner()).append(":");
      sb.append(status.getGroup()).append(":");
      sb.append(status.getPermission());
    }
    if (logTokenTrackingId) {
      sb.append("\t").append("trackingId=");
      String trackingId = null;
      if (ugi != null && dtSecretManager != null
          && ugi.getAuthenticationMethod() == AuthenticationMethod.TOKEN) {
        for (TokenIdentifier tid: ugi.getTokenIdentifiers()) {
          if (tid instanceof DelegationTokenIdentifier) {
            DelegationTokenIdentifier dtid =
                (DelegationTokenIdentifier)tid;
            trackingId = dtSecretManager.getTokenTrackingId(dtid);
            break;
          }
        }
      }
      sb.append(trackingId);
    }
    sb.append("\t").append("proto=");
    sb.append(NamenodeWebHdfsMethods.isWebHdfsInvocation() ? "webhdfs" : "rpc");
    logAuditMessage(sb.toString());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:44,代码来源:FSNamesystem.java

示例2: logAuditEvent

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
@Override
public void logAuditEvent(boolean succeeded, String userName,
    InetAddress addr, String cmd, String src, String dst,
    FileStatus status, CallerContext callerContext, UserGroupInformation ugi,
    DelegationTokenSecretManager dtSecretManager) {

  if (auditLog.isDebugEnabled() ||
      (auditLog.isInfoEnabled() && !debugCmdSet.contains(cmd))) {
    final StringBuilder sb = STRING_BUILDER.get();
    sb.setLength(0);
    sb.append("allowed=").append(succeeded).append("\t");
    sb.append("ugi=").append(userName).append("\t");
    sb.append("ip=").append(addr).append("\t");
    sb.append("cmd=").append(cmd).append("\t");
    sb.append("src=").append(src).append("\t");
    sb.append("dst=").append(dst).append("\t");
    if (null == status) {
      sb.append("perm=null");
    } else {
      sb.append("perm=");
      sb.append(status.getOwner()).append(":");
      sb.append(status.getGroup()).append(":");
      sb.append(status.getPermission());
    }
    if (logTokenTrackingId) {
      sb.append("\t").append("trackingId=");
      String trackingId = null;
      if (ugi != null && dtSecretManager != null
          && ugi.getAuthenticationMethod() == AuthenticationMethod.TOKEN) {
        for (TokenIdentifier tid: ugi.getTokenIdentifiers()) {
          if (tid instanceof DelegationTokenIdentifier) {
            DelegationTokenIdentifier dtid =
                (DelegationTokenIdentifier)tid;
            trackingId = dtSecretManager.getTokenTrackingId(dtid);
            break;
          }
        }
      }
      sb.append(trackingId);
    }
    sb.append("\t").append("proto=");
    sb.append(NamenodeWebHdfsMethods.isWebHdfsInvocation() ? "webhdfs" : "rpc");
    if (isCallerContextEnabled &&
        callerContext != null &&
        callerContext.isContextValid()) {
      sb.append("\t").append("callerContext=");
      if (callerContext.getContext().length() > callerContextMaxLen) {
        sb.append(callerContext.getContext().substring(0,
            callerContextMaxLen));
      } else {
        sb.append(callerContext.getContext());
      }
      if (callerContext.getSignature() != null &&
          callerContext.getSignature().length > 0 &&
          callerContext.getSignature().length <= callerSignatureMaxLen) {
        sb.append(":");
        sb.append(new String(callerContext.getSignature(),
            CallerContext.SIGNATURE_ENCODING));
      }
    }
    logAuditMessage(sb.toString());
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:64,代码来源:FSNamesystem.java

示例3: logAuditEvent

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
@Override
public void logAuditEvent(boolean succeeded, String userName,
    InetAddress addr, String cmd, String src, String dst,
    FileStatus status, UserGroupInformation ugi,
    DelegationTokenSecretManager dtSecretManager) {
  if (auditLog.isInfoEnabled()) {
    final StringBuilder sb = auditBuffer.get();
    sb.setLength(0);
    sb.append("allowed=").append(succeeded).append("\t");
    sb.append("ugi=").append(userName).append("\t");
    sb.append("ip=").append(addr).append("\t");
    sb.append("cmd=").append(cmd).append("\t");
    sb.append("src=").append(src).append("\t");
    sb.append("dst=").append(dst).append("\t");
    if (null == status) {
      sb.append("perm=null");
    } else {
      sb.append("perm=");
      sb.append(status.getOwner()).append(":");
      sb.append(status.getGroup()).append(":");
      sb.append(status.getPermission());
    }
    if (logTokenTrackingId) {
      sb.append("\t").append("trackingId=");
      String trackingId = null;
      if (ugi != null && dtSecretManager != null
          && ugi.getAuthenticationMethod() == AuthenticationMethod.TOKEN) {
        for (TokenIdentifier tid: ugi.getTokenIdentifiers()) {
          if (tid instanceof DelegationTokenIdentifier) {
            DelegationTokenIdentifier dtid =
                (DelegationTokenIdentifier)tid;
            trackingId = dtSecretManager.getTokenTrackingId(dtid);
            break;
          }
        }
      }
      sb.append(trackingId);
    }
    auditLog.info(sb);
  }
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:42,代码来源:FSNamesystem.java

示例4: logAuditEvent

import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager; //导入方法依赖的package包/类
@Override
public void logAuditEvent(boolean succeeded, String userName,
    InetAddress addr, String cmd, String src, String dst,
    FileStatus status, UserGroupInformation ugi,
    DelegationTokenSecretManager dtSecretManager) {
  if (auditLog.isInfoEnabled()) {
    final StringBuilder sb = auditBuffer.get();
    sb.setLength(0);
    sb.append("allowed=").append(succeeded).append("\t");
    sb.append("ugi=").append(userName).append("\t");
    sb.append("ip=").append(addr).append("\t");
    sb.append("cmd=").append(cmd).append("\t");
    sb.append("src=").append(src).append("\t");
    sb.append("dst=").append(dst).append("\t");
    if (null == status) {
      sb.append("perm=null");
    } else {
      sb.append("perm=");
      sb.append(status.getOwner()).append(":");
      sb.append(status.getGroup()).append(":");
      sb.append(status.getPermission());
    }
    if (logTokenTrackingId) {
      sb.append("\t").append("trackingId=");
      String trackingId = null;
      if (ugi != null && dtSecretManager != null
          && ugi.getAuthenticationMethod() == AuthenticationMethod.TOKEN) {
        for (TokenIdentifier tid: ugi.getTokenIdentifiers()) {
          if (tid instanceof DelegationTokenIdentifier) {
            DelegationTokenIdentifier dtid =
                (DelegationTokenIdentifier)tid;
            trackingId = dtSecretManager.getTokenTrackingId(dtid);
            break;
          }
        }
      }
      sb.append(trackingId);
    }
    logAuditMessage(sb.toString());
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:42,代码来源:FSNamesystem.java


注:本文中的org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager.getTokenTrackingId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。