private static Object parametersToObject(Procedure<?> proc) { try { ProcedureProtos.Procedure protoProc = ProcedureUtil.convertToProtoProcedure(proc); List<Object> parameters = protoProc.getStateMessageList().stream() .map((any) -> { try { return ProtobufMessageConverter.toJavaObject(any); } catch (InvalidProtocolBufferException e) { return e.toString(); } }).collect(Collectors.toList()); return parameters; } catch (IOException e) { return e.toString(); } }
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.BackupProtos.ServerTimestamp parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.BackupProtos.ServerTimestamp) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
@Override public <M extends Message> M deserialize(Class<M> clazz) throws IOException { if (deserializeIndex >= builder.getStateMessageCount()) { throw new IOException("Invalid state message index: " + deserializeIndex); } try { Any packedMessage = builder.getStateMessage(deserializeIndex++); return packedMessage.unpack(clazz); } catch (InvalidProtocolBufferException e) { throw e.unwrapIOException(); } } }
private SnapshotDataManifest readDataManifest() throws IOException { FSDataInputStream in = null; try { in = workingDirFs.open(new Path(workingDir, DATA_MANIFEST_NAME)); CodedInputStream cin = CodedInputStream.newInstance(in); cin.setSizeLimit(manifestSizeLimit); return SnapshotDataManifest.parseFrom(cin); } catch (FileNotFoundException e) { return null; } catch (InvalidProtocolBufferException e) { throw new CorruptedSnapshotException("unable to parse data manifest " + e.getMessage(), e); } finally { if (in != null) in.close(); } }
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
@SuppressWarnings("unchecked") @Override public <M extends Message> M deserialize(Class<M> clazz) throws IOException { Parser<M> parser = (Parser<M>) Internal.getDefaultInstance(clazz).getParserForType(); try { return parser.parseDelimitedFrom(inputStream); } catch (InvalidProtocolBufferException e) { throw e.unwrapIOException(); } } }
} catch (InvalidProtocolBufferException e) { throw new CorruptedSnapshotException("unable to parse region manifest " + e.getMessage(), e); } finally { tpool.shutdown();
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.HFileProtos.FileInfoProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.HFileProtos.FileInfoProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
public static String toLockJson(List<LockServiceProtos.LockedResource> lockedResourceProtos) { JsonArray lockedResourceJsons = new JsonArray(lockedResourceProtos.size()); for (LockServiceProtos.LockedResource lockedResourceProto : lockedResourceProtos) { try { JsonElement lockedResourceJson = ProtobufMessageConverter.toJsonElement(lockedResourceProto); lockedResourceJsons.add(lockedResourceJson); } catch (InvalidProtocolBufferException e) { lockedResourceJsons.add(e.toString()); } } return lockedResourceJsons.toString(); }
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.HFileProtos.FileTrailerProto parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.HFileProtos.FileTrailerProto) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
/** * Helper to convert the protobuf Procedure to JSON String * @return Convert the current Protocol Buffers Procedure to JSON String */ public static String toProcedureJson(List<ProcedureProtos.Procedure> procProtos) { JsonArray procJsons = new JsonArray(procProtos.size()); for (ProcedureProtos.Procedure procProto : procProtos) { try { JsonElement procJson = ProtobufMessageConverter.toJsonElement(procProto); procJsons.add(procJson); } catch (InvalidProtocolBufferException e) { procJsons.add(e.toString()); } } return procJsons.toString(); }
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionInTransition parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.RegionInTransition) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.StoreSequenceId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos.StoreSequenceId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();
public Builder mergeFrom( org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream input, org.apache.hbase.thirdparty.com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build();