private void initSystemCredentials() {
   NodeHeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
   List<SystemCredentialsForAppsProto> list = p.getSystemCredentialsForAppsList();
   this.systemCredentials = new HashMap<ApplicationId, ByteBuffer>();
   for (SystemCredentialsForAppsProto c : list) {
     ApplicationId appId = convertFromProtoFormat(c.getAppId());
     ByteBuffer byteBuffer = ProtoUtils.convertFromProtoFormat(c.getCredentialsForApp());
     this.systemCredentials.put(appId, byteBuffer);
   }
 }
 private void addSystemCredentialsToProto() {
   maybeInitBuilder();
   builder.clearSystemCredentialsForApps();
   for (Map.Entry<ApplicationId, ByteBuffer> entry : systemCredentials.entrySet()) {
     builder.addSystemCredentialsForApps(
         SystemCredentialsForAppsProto.newBuilder()
             .setAppId(convertToProtoFormat(entry.getKey()))
             .setCredentialsForApp(ProtoUtils.convertToProtoFormat(entry.getValue().duplicate())));
   }
 }
コード例 #3
0
 private ExecutionType convertFromProtoFormat(ExecutionTypeProto executionType) {
   return ProtoUtils.convertFromProtoFormat(executionType);
 }
コード例 #4
0
 private ExecutionTypeProto convertToProtoFormat(ExecutionType executionType) {
   return ProtoUtils.convertToProtoFormat(executionType);
 }
コード例 #5
0
 private ContainerType convertFromProtoFormat(ContainerTypeProto containerType) {
   return ProtoUtils.convertFromProtoFormat(containerType);
 }