private static Message orDefaultForType( @NullableDecl Message input, @NullableDecl Message other) { return (input != null) ? input : other.getDefaultInstanceForType(); }
private Message getReturnMessage(final Method method, final RpcWritable.Buffer buf) throws ServiceException { Message prototype = null; try { prototype = getReturnProtoType(method); } catch (Exception e) { throw new ServiceException(e); } Message returnMessage; try { returnMessage = buf.getValue(prototype.getDefaultInstanceForType()); if (LOG.isTraceEnabled()) { LOG.trace(Thread.currentThread().getId() + ": Response <- " + remoteId + ": " + method.getName() + " {" + TextFormat.shortDebugString(returnMessage) + "}"); } } catch (Throwable e) { throw new ServiceException(e); } return returnMessage; }
public static Message getResponse( org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, com.google.protobuf.Message responsePrototype) throws IOException { Message response; if (result.getValue().hasValue()) { Message.Builder builder = responsePrototype.newBuilderForType(); builder.mergeFrom(result.getValue().getValue().newInput()); response = builder.build(); } else { response = responsePrototype.getDefaultInstanceForType(); } if (LOG.isTraceEnabled()) { LOG.trace("Master Result is value=" + response); } return response; }
if (existingValue == existingValue.getDefaultInstanceForType()) { setField(field, entry.getValue()); } else {
private Message deserializeProto(ByteBuf buf, Message prototype) throws IOException { if (GrpcSerializationFormats.isProto(serializationFormat)) { if (!buf.isReadable()) { return prototype.getDefaultInstanceForType();
if (existingValue == existingValue.getDefaultInstanceForType()) { setField(field, entry.getValue()); } else {
actualFields.get(fieldDescriptor), expectedFields.get(fieldDescriptor), actual.getDefaultInstanceForType().getField(fieldDescriptor), shouldCompare == FieldScopeResult.EXCLUDED_NONRECURSIVELY, fieldDescriptor,
private boolean isDefaultTargeting(T splittingDimensionTargeting) { return splittingDimensionTargeting.equals( splittingDimensionTargeting.getDefaultInstanceForType()); }
public static Message getResponse( org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, com.google.protobuf.Message responsePrototype) throws IOException { Message response; if (result.getValue().hasValue()) { Message.Builder builder = responsePrototype.newBuilderForType(); builder.mergeFrom(result.getValue().getValue().newInput()); response = builder.build(); } else { response = responsePrototype.getDefaultInstanceForType(); } if (LOG.isTraceEnabled()) { LOG.trace("Master Result is value=" + response); } return response; }
private static Message orDefaultForType( @NullableDecl Message input, @NullableDecl Message other) { return (input != null) ? input : other.getDefaultInstanceForType(); }
private Message getReturnMessage(final Method method, final RpcWritable.Buffer buf) throws ServiceException { Message prototype = null; try { prototype = getReturnProtoType(method); } catch (Exception e) { throw new ServiceException(e); } Message returnMessage; try { returnMessage = buf.getValue(prototype.getDefaultInstanceForType()); if (LOG.isTraceEnabled()) { LOG.trace(Thread.currentThread().getId() + ": Response <- " + remoteId + ": " + method.getName() + " {" + TextFormat.shortDebugString(returnMessage) + "}"); } } catch (Throwable e) { throw new ServiceException(e); } return returnMessage; }
/** * Merges the field from another field. * * @param value the value to merge from * @return the builder */ public SingleFieldBuilder<MType, BType, IType> mergeFrom(final MType value) { if (builder == null && message == message.getDefaultInstanceForType()) { message = value; } else { getBuilder().mergeFrom(value); } onChanged(); return this; }
} else { @SuppressWarnings("unchecked") M ret = (M) msg.getDefaultInstanceForType(); return ret;
/** * Clears the value of the field. * * @return the builder */ @Override @SuppressWarnings("unchecked") public void clear() { message = (MType) (message != null ? message.getDefaultInstanceForType() : builder .getDefaultInstanceForType()); if (builder != null) { dispose(builder); builder = null; } onChanged(); }
public static Message getResponse( org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse result, com.google.protobuf.Message responsePrototype) throws IOException { Message response; if (result.getValue().hasValue()) { Message.Builder builder = responsePrototype.newBuilderForType(); builder.mergeFrom(result.getValue().getValue().newInput()); response = builder.build(); } else { response = responsePrototype.getDefaultInstanceForType(); } if (LOG.isTraceEnabled()) { LOG.trace("Master Result is value=" + response); } return response; }
if (existingValue == existingValue.getDefaultInstanceForType()) { setField(field, entry.getValue()); } else {
if (existingValue == existingValue.getDefaultInstanceForType()) { setField(field, entry.getValue()); } else {
private Message deserializeProto(ByteBuf buf, Message prototype) throws IOException { if (GrpcSerializationFormats.isProto(serializationFormat)) { if (!buf.isReadable()) { return prototype.getDefaultInstanceForType();
if (message == message.getDefaultInstanceForType()) { return null;
actualFields.get(fieldDescriptor), expectedFields.get(fieldDescriptor), actual.getDefaultInstanceForType().getField(fieldDescriptor), shouldIgnore.shouldIgnoreNonRecursive(), fieldDescriptor,