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


Java DelegationKey.write方法代码示例

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


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

示例1: storeRMDTMasterKeyState

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
protected void storeRMDTMasterKeyState(DelegationKey masterKey)
    throws IOException {
  String dbKey = getRMDTMasterKeyNodeKey(masterKey);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing token master key to " + dbKey);
  }
  ByteArrayOutputStream os = new ByteArrayOutputStream();
  DataOutputStream out = new DataOutputStream(os);
  try {
    masterKey.write(out);
  } finally {
    out.close();
  }
  try {
    db.put(bytes(dbKey), os.toByteArray());
  } catch (DBException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:LeveldbRMStateStore.java

示例2: storeRMDTMasterKeyState

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
protected synchronized void storeRMDTMasterKeyState(
    DelegationKey delegationKey) throws Exception {
  String nodeCreatePath =
      getNodePath(dtMasterKeysRootPath, DELEGATION_KEY_PREFIX
          + delegationKey.getKeyId());
  ByteArrayOutputStream os = new ByteArrayOutputStream();
  DataOutputStream fsOut = new DataOutputStream(os);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing RMDelegationKey_" + delegationKey.getKeyId());
  }
  delegationKey.write(fsOut);
  try {
    createWithRetries(nodeCreatePath, os.toByteArray(), zkAcl,
        CreateMode.PERSISTENT);
  } finally {
    os.close();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:ZKRMStateStore.java

示例3: storeTokenMasterKey

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

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

  String dbKey = getTokenMasterKeyDatabaseKey(masterKey);
  try {
    db.put(bytes(dbKey), memStream.toByteArray());
  } catch (DBException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:HistoryServerLeveldbStateStoreService.java

示例4: 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

示例5: storeRMDTMasterKeyState

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
protected synchronized void storeRMDTMasterKeyState(
    DelegationKey delegationKey) throws Exception {
  String nodeCreatePath =
      getNodePath(dtMasterKeysRootPath, DELEGATION_KEY_PREFIX
          + delegationKey.getKeyId());
  ByteArrayOutputStream os = new ByteArrayOutputStream();
  DataOutputStream fsOut = new DataOutputStream(os);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing RMDelegationKey_" + delegationKey.getKeyId());
  }
  delegationKey.write(fsOut);
  try {
    safeCreate(nodeCreatePath, os.toByteArray(), zkAcl,
        CreateMode.PERSISTENT);
  } finally {
    os.close();
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:ZKRMStateStore.java

示例6: storeRMDTMasterKeyState

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
@Override
public synchronized void storeRMDTMasterKeyState(DelegationKey masterKey)
    throws Exception {
  Path nodeCreatePath = getNodePath(rmDTSecretManagerRoot,
        DELEGATION_KEY_PREFIX + masterKey.getKeyId());
  ByteArrayOutputStream os = new ByteArrayOutputStream();
  try (DataOutputStream fsOut = new DataOutputStream(os)) {
    LOG.info("Storing RMDelegationKey_" + masterKey.getKeyId());
    masterKey.write(fsOut);
    writeFileWithRetries(nodeCreatePath, os.toByteArray(), true);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:FileSystemRMStateStore.java

示例7: buildTokenMasterKeyData

import org.apache.hadoop.security.token.delegation.DelegationKey; //导入方法依赖的package包/类
private static byte[] buildTokenMasterKeyData(DelegationKey key)
    throws IOException {
  ByteArrayOutputStream memStream = new ByteArrayOutputStream();
  DataOutputStream dataStream = new DataOutputStream(memStream);
  try {
    key.write(dataStream);
    dataStream.close();
  } finally {
    IOUtils.cleanup(LOG, dataStream);
  }
  return memStream.toByteArray();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:LeveldbTimelineStateStore.java


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