• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MasterKey类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.yarn.server.api.records.MasterKey的典型用法代码示例。如果您正苦于以下问题:Java MasterKey类的具体用法?Java MasterKey怎么用?Java MasterKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MasterKey类属于org.apache.hadoop.yarn.server.api.records包,在下文中一共展示了MasterKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerNodeManager

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public RegisterNodeManagerResponse registerNodeManager(
    RegisterNodeManagerRequest request) throws YarnException,
    IOException {
  RegisterNodeManagerResponse response = recordFactory
      .newRecordInstance(RegisterNodeManagerResponse.class);
  MasterKey masterKey = new MasterKeyPBImpl();
  masterKey.setKeyId(123);
  masterKey.setBytes(ByteBuffer.wrap(new byte[] { new Integer(123)
    .byteValue() }));
  response.setContainerTokenMasterKey(masterKey);
  response.setNMTokenMasterKey(masterKey);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:MockNodeStatusUpdater.java


示例2: equals

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (!(obj instanceof MasterKey)) {
    return false;
  }
  MasterKey other = (MasterKey) obj;
  if (this.getKeyId() != other.getKeyId()) {
    return false;
  }
  if (!this.getBytes().equals(other.getBytes())) {
    return false;
  }
  return true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:MasterKeyPBImpl.java


示例3: newNodeHeartbeatResponse

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
public static NodeHeartbeatResponse newNodeHeartbeatResponse(int responseId,
    NodeAction action, List<ContainerId> containersToCleanUp,
    List<ApplicationId> applicationsToCleanUp,
    MasterKey containerTokenMasterKey, MasterKey nmTokenMasterKey,
    long nextHeartbeatInterval) {
  NodeHeartbeatResponse response = recordFactory
      .newRecordInstance(NodeHeartbeatResponse.class);
  response.setResponseId(responseId);
  response.setNodeAction(action);
  response.setContainerTokenMasterKey(containerTokenMasterKey);
  response.setNMTokenMasterKey(nmTokenMasterKey);
  response.setNextHeartBeatInterval(nextHeartbeatInterval);
  if(containersToCleanUp != null) {
    response.addAllContainersToCleanup(containersToCleanUp);
  }
  if(applicationsToCleanUp != null) {
    response.addAllApplicationsToCleanup(applicationsToCleanUp);
  }
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:YarnServerBuilderUtils.java


示例4: populateKeys

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
private void populateKeys(NodeHeartbeatRequest request,
    NodeHeartbeatResponse nodeHeartBeatResponse) {

  // Check if node's masterKey needs to be updated and if the currentKey has
  // roller over, send it across

  // ContainerTokenMasterKey

  MasterKey nextMasterKeyForNode =
      this.containerTokenSecretManager.getNextKey();
  if (nextMasterKeyForNode != null
      && (request.getLastKnownContainerTokenMasterKey().getKeyId()
          != nextMasterKeyForNode.getKeyId())) {
    nodeHeartBeatResponse.setContainerTokenMasterKey(nextMasterKeyForNode);
  }

  // NMTokenMasterKey

  nextMasterKeyForNode = this.nmTokenSecretManager.getNextKey();
  if (nextMasterKeyForNode != null
      && (request.getLastKnownNMTokenMasterKey().getKeyId() 
          != nextMasterKeyForNode.getKeyId())) {
    nodeHeartBeatResponse.setNMTokenMasterKey(nextMasterKeyForNode);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:ResourceTrackerService.java


示例5: recover

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
public void recover(RMState state) {
  if (state.getAMRMTokenSecretManagerState() != null) {
    // recover the current master key
    MasterKey currentKey =
        state.getAMRMTokenSecretManagerState().getCurrentMasterKey();
    this.currentMasterKey =
        new MasterKeyData(currentKey, createSecretKey(currentKey.getBytes()
          .array()));

    // recover the next master key if not null
    MasterKey nextKey =
        state.getAMRMTokenSecretManagerState().getNextMasterKey();
    if (nextKey != null) {
      this.nextMasterKey =
          new MasterKeyData(nextKey, createSecretKey(nextKey.getBytes()
            .array()));
      this.timer.schedule(new NextKeyActivator(), this.activationDelay);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:AMRMTokenSecretManager.java


示例6: newNodeHeartbeatResponse

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
public static NodeHeartbeatResponse newNodeHeartbeatResponse(int responseId,
    NodeAction action, List<ContainerId> containersToCleanUp,
    List<ApplicationId> applicationsToCleanUp,List<NodeContainerUpdate> listNodeContainerUpdate,
    MasterKey containerTokenMasterKey, MasterKey nmTokenMasterKey,
    long nextHeartbeatInterval) {
  NodeHeartbeatResponse response = recordFactory
      .newRecordInstance(NodeHeartbeatResponse.class);
  response.setResponseId(responseId);
  response.setNodeAction(action);
  response.setContainerTokenMasterKey(containerTokenMasterKey);
  response.setNMTokenMasterKey(nmTokenMasterKey);
  response.setNextHeartBeatInterval(nextHeartbeatInterval);
  
  if(containersToCleanUp != null) {
    response.addAllContainersToCleanup(containersToCleanUp);
  }
  if(applicationsToCleanUp != null) {
    response.addAllApplicationsToCleanup(applicationsToCleanUp);
  }
  if(listNodeContainerUpdate != null){
    response.addNodeContainersToUpdate(listNodeContainerUpdate);	
  }
  return response;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:25,代码来源:YarnServerBuilderUtils.java


示例7: MasterKeyData

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
public MasterKeyData(int serialNo, SecretKey secretKey) {
  this.masterKeyRecord = Records.newRecord(MasterKey.class);
  this.masterKeyRecord.setKeyId(serialNo);
  this.generatedSecretKey = secretKey;
  this.masterKeyRecord.setBytes(ByteBuffer.wrap(generatedSecretKey
    .getEncoded()));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:MasterKeyData.java


示例8: getCurrentKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Private
public MasterKey getCurrentKey() {
  this.readLock.lock();
  try {
    return this.currentMasterKey.getMasterKey();
  } finally {
    this.readLock.unlock();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:BaseNMTokenSecretManager.java


示例9: getCurrentKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Private
public MasterKey getCurrentKey() {
  this.readLock.lock();
  try {
  return this.currentMasterKey.getMasterKey();
  } finally {
    this.readLock.unlock();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:BaseContainerTokenSecretManager.java


示例10: newInstance

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
public static NodeHeartbeatRequest newInstance(NodeStatus nodeStatus,
    MasterKey lastKnownContainerTokenMasterKey,
    MasterKey lastKnownNMTokenMasterKey) {
  NodeHeartbeatRequest nodeHeartbeatRequest =
      Records.newRecord(NodeHeartbeatRequest.class);
  nodeHeartbeatRequest.setNodeStatus(nodeStatus);
  nodeHeartbeatRequest
      .setLastKnownContainerTokenMasterKey(lastKnownContainerTokenMasterKey);
  nodeHeartbeatRequest
      .setLastKnownNMTokenMasterKey(lastKnownNMTokenMasterKey);
  return nodeHeartbeatRequest;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NodeHeartbeatRequest.java


示例11: getLastKnownContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public MasterKey getLastKnownContainerTokenMasterKey() {
  NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
  if (this.lastKnownContainerTokenMasterKey != null) {
    return this.lastKnownContainerTokenMasterKey;
  }
  if (!p.hasLastKnownContainerTokenMasterKey()) {
    return null;
  }
  this.lastKnownContainerTokenMasterKey =
      convertFromProtoFormat(p.getLastKnownContainerTokenMasterKey());
  return this.lastKnownContainerTokenMasterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:NodeHeartbeatRequestPBImpl.java


示例12: setLastKnownContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public void setLastKnownContainerTokenMasterKey(MasterKey masterKey) {
  maybeInitBuilder();
  if (masterKey == null) 
    builder.clearLastKnownContainerTokenMasterKey();
  this.lastKnownContainerTokenMasterKey = masterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:NodeHeartbeatRequestPBImpl.java


示例13: getLastKnownNMTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public MasterKey getLastKnownNMTokenMasterKey() {
  NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
  if (this.lastKnownNMTokenMasterKey != null) {
    return this.lastKnownNMTokenMasterKey;
  }
  if (!p.hasLastKnownNmTokenMasterKey()) {
    return null;
  }
  this.lastKnownNMTokenMasterKey =
      convertFromProtoFormat(p.getLastKnownNmTokenMasterKey());
  return this.lastKnownNMTokenMasterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:NodeHeartbeatRequestPBImpl.java


示例14: setLastKnownNMTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public void setLastKnownNMTokenMasterKey(MasterKey masterKey) {
  maybeInitBuilder();
  if (masterKey == null) 
    builder.clearLastKnownNmTokenMasterKey();
  this.lastKnownNMTokenMasterKey = masterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:NodeHeartbeatRequestPBImpl.java


示例15: getContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public MasterKey getContainerTokenMasterKey() {
  RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
  if (this.containerTokenMasterKey != null) {
    return this.containerTokenMasterKey;
  }
  if (!p.hasContainerTokenMasterKey()) {
    return null;
  }
  this.containerTokenMasterKey =
      convertFromProtoFormat(p.getContainerTokenMasterKey());
  return this.containerTokenMasterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:RegisterNodeManagerResponsePBImpl.java


示例16: setContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public void setContainerTokenMasterKey(MasterKey masterKey) {
  maybeInitBuilder();
  if (masterKey == null)
    builder.clearContainerTokenMasterKey();
  this.containerTokenMasterKey = masterKey;
  rebuild = true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RegisterNodeManagerResponsePBImpl.java


示例17: getNMTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public MasterKey getNMTokenMasterKey() {
  RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
  if (this.nmTokenMasterKey != null) {
    return this.nmTokenMasterKey;
  }
  if (!p.hasNmTokenMasterKey()) {
    return null;
  }
  this.nmTokenMasterKey =
      convertFromProtoFormat(p.getNmTokenMasterKey());
  return this.nmTokenMasterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:RegisterNodeManagerResponsePBImpl.java


示例18: setNMTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public void setNMTokenMasterKey(MasterKey masterKey) {
  maybeInitBuilder();
  if (masterKey == null)
    builder.clearNmTokenMasterKey();
  this.nmTokenMasterKey = masterKey;
  rebuild = true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RegisterNodeManagerResponsePBImpl.java


示例19: getContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public MasterKey getContainerTokenMasterKey() {
  NodeHeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
  if (this.containerTokenMasterKey != null) {
    return this.containerTokenMasterKey;
  }
  if (!p.hasContainerTokenMasterKey()) {
    return null;
  }
  this.containerTokenMasterKey =
      convertFromProtoFormat(p.getContainerTokenMasterKey());
  return this.containerTokenMasterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:NodeHeartbeatResponsePBImpl.java


示例20: setContainerTokenMasterKey

import org.apache.hadoop.yarn.server.api.records.MasterKey; //导入依赖的package包/类
@Override
public void setContainerTokenMasterKey(MasterKey masterKey) {
  maybeInitBuilder();
  if (masterKey == null)
    builder.clearContainerTokenMasterKey();
  this.containerTokenMasterKey = masterKey;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:NodeHeartbeatResponsePBImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransportRequest类代码示例发布时间:2022-05-22
下一篇:
Java GetLinkTargetResponseProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap