本文整理汇总了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());
}
示例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());
}
示例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);
}
示例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();
}
示例5: getTokenMasterKeyDatabaseKey
import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
private String getTokenMasterKeyDatabaseKey(DelegationKey masterKey) {
return TOKEN_MASTER_KEY_KEY_PREFIX + masterKey.getKeyId();
}