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


Java DelegationKey.getKeyId方法代码示例

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


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

示例1: storeRMDTMasterKeyState

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
public synchronized void storeRMDTMasterKeyState(DelegationKey delegationKey)
    throws Exception {
  Set<DelegationKey> rmDTMasterKeyState =
      state.rmSecretManagerState.getMasterKeyState();

  if (rmDTMasterKeyState.contains(delegationKey)) {
    IOException e = new IOException("RMDTMasterKey with keyID: "
            + delegationKey.getKeyId() + " is already stored");
    LOG.info("Error storing info for RMDTMasterKey with keyID: "
        + delegationKey.getKeyId(), e);
    throw e;
  }
  state.getRMDTSecretManagerState().getMasterKeyState().add(delegationKey);
  LOG.info("Store RMDT master key with key id: " + delegationKey.getKeyId()
      + ". Currently rmDTMasterKeyState size: " + rmDTMasterKeyState.size());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:MemoryRMStateStore.java

示例2: storeTokenMasterKey

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
public void storeTokenMasterKey(DelegationKey key) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing master key " + key.getKeyId());
  }

  Path keyPath = new Path(tokenKeysStatePath,
      TOKEN_MASTER_KEY_FILE_PREFIX + key.getKeyId());
  if (fs.exists(keyPath)) {
    throw new IOException(keyPath + " already exists");
  }

  ByteArrayOutputStream memStream = new ByteArrayOutputStream();
  DataOutputStream dataStream = new DataOutputStream(memStream);
  try {
    key.write(dataStream);
    dataStream.close();
    dataStream = null;
  } finally {
    IOUtils.cleanup(LOG, dataStream);
  }

  createNewFile(keyPath, memStream.toByteArray());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:HistoryServerFileSystemStateStoreService.java

示例3: removeTokenMasterKey

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
public void removeTokenMasterKey(DelegationKey key)
    throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Removing master key " + key.getKeyId());
  }

  Path keyPath = new Path(tokenKeysStatePath,
      TOKEN_MASTER_KEY_FILE_PREFIX + key.getKeyId());
  deleteFile(keyPath);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:HistoryServerFileSystemStateStoreService.java

示例4: getRMDTMasterKeyNodeKey

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
private String getRMDTMasterKeyNodeKey(DelegationKey masterKey) {
  return RM_DT_MASTER_KEY_KEY_PREFIX + masterKey.getKeyId();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:LeveldbRMStateStore.java

示例5: getTokenMasterKeyDatabaseKey

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
private String getTokenMasterKeyDatabaseKey(DelegationKey masterKey) {
  return TOKEN_MASTER_KEY_KEY_PREFIX + masterKey.getKeyId();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:HistoryServerLeveldbStateStoreService.java


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