java类com.google.protobuf.Internal.EnumLite的实例源码

RpcConfig.java 文件源码 项目:QDrill 阅读 19 收藏 0 点赞 0 评论 0
public boolean checkSend(EnumLite send, Class<?> sendClass, Class<?> receiveClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking send classes for send RpcType %s.  Send Class is %s and Receive class is %s.", send, sendClass, receiveClass));
  }
  RpcMessageType<?,?,?> type = sendMap.get(send);
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc send type of %s.", name, send));
  }

  if (type.getSend() != sendClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to send an object of type %s.", name, type, sendClass.getCanonicalName()));
  }
  if (type.getRet() != receiveClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to setup an expected reception of an object of type %s.", name, type, receiveClass.getCanonicalName()));
  }

  return true;
}
RpcConfig.java 文件源码 项目:dremio-oss 阅读 25 收藏 0 点赞 0 评论 0
public boolean checkSend(EnumLite send, Class<?> sendClass, Class<?> receiveClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking send classes for send RpcType %s.  Send Class is %s and Receive class is %s.", send, sendClass, receiveClass));
  }
  RpcMessageType<?,?,?> type = sendMap.get(send);
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc send type of %s.", name, send));
  }

  if (type.getSend() != sendClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to send an object of type %s.", name, type, sendClass.getCanonicalName()));
  }
  if (type.getRet() != receiveClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to setup an expected reception of an object of type %s.", name, type, receiveClass.getCanonicalName()));
  }

  return true;
}
ProtocolBuilder.java 文件源码 项目:dremio-oss 阅读 41 收藏 0 点赞 0 评论 0
@SuppressWarnings("unchecked")
public SimpleProtocol(int protocolId, Map<Integer, ReceiveHandler<MessageLite, MessageLite>> handlers, BufferAllocator allocator, String name) {
  super();
  this.protocolId = protocolId;
  this.handlers = new ReceiveHandler[2048];
  this.defaultResponseInstances = new MessageLite[2048];
  this.defaultRequestInstances = new MessageLite[2048];
  RpcConfigBuilder builder = RpcConfig.newBuilder()
      .name(name)
      .timeout(0);
  for(Entry<Integer, ReceiveHandler<MessageLite, MessageLite>> e : handlers.entrySet()) {
    final int id = e.getKey();
    final ReceiveHandler<?,?> handler = e.getValue();
    final EnumLite num = new PseudoEnum(id);
    builder.add(num, (Class<? extends MessageLite>) handler.getDefaultRequest().getClass(), num, (Class<? extends MessageLite>) handler.getDefaultResponse().getClass());
    this.handlers[id] = e.getValue();
    this.defaultResponseInstances[id] = e.getValue().getDefaultResponse();
    this.defaultRequestInstances[id] = e.getValue().getDefaultRequest();
  }
  this.config = builder.build();
  this.allocator = allocator;
}
AbstractMessage.java 文件源码 项目:cfapi 阅读 39 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.isMapField()) {
      hash = (53 * hash) + hashMapField(value);
    } else if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:play-store-api 阅读 23 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.isMapField()) {
      hash = (53 * hash) + hashMapField(value);
    } else if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
ServerAuthenticationHandler.java 文件源码 项目:drill 阅读 22 收藏 0 点赞 0 评论 0
@Override
public <S extends ServerConnection<S>, T extends EnumLite>
void process(SaslResponseContext<S, T> context) throws Exception {
  final SaslMessage.Builder challenge = SaslMessage.newBuilder();
  final SaslServer saslServer = context.connection.getSaslServer();

  final byte[] challengeBytes = evaluateResponse(saslServer, context.saslResponse.getData().toByteArray());

  if (saslServer.isComplete()) {
    challenge.setStatus(SaslStatus.SASL_SUCCESS);
    if (challengeBytes != null) {
      challenge.setData(ByteString.copyFrom(challengeBytes));
    }

    handleSuccess(context, challenge, saslServer);
  } else {
    challenge.setStatus(SaslStatus.SASL_IN_PROGRESS)
        .setData(ByteString.copyFrom(challengeBytes));
    context.sender.send(new Response(context.saslResponseType, challenge.build()));
  }
}
RpcConfig.java 文件源码 项目:drill 阅读 21 收藏 0 点赞 0 评论 0
public boolean checkSend(EnumLite send, Class<?> sendClass, Class<?> receiveClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking send classes for send RpcType %s.  Send Class is %s and Receive class is %s.", send, sendClass, receiveClass));
  }
  RpcMessageType<?,?,?> type = sendMap.get(send);
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc send type of %s.", name, send));
  }

  if (type.getSend() != sendClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to send an object of type %s.", name, type, sendClass.getCanonicalName()));
  }
  if (type.getRet() != receiveClass) {
    throw new IllegalStateException(String.format("%s: The definition for send doesn't match implementation code.  The definition is %s however the current send is trying to setup an expected reception of an object of type %s.", name, type, receiveClass.getCanonicalName()));
  }

  return true;
}
AbstractMessage.java 文件源码 项目:bd-codes 阅读 29 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:protoc-gen-as3 阅读 25 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:dotalys-cli 阅读 24 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:protobuffer 阅读 30 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:protobuffer 阅读 26 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:GetThere 阅读 29 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:365browser 阅读 24 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:hpcourse 阅读 21 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:vsminecraft 阅读 28 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:nfc-smart-tag 阅读 25 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:Beam 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Get a hash code for given fields and values, using the given seed.
 */
@SuppressWarnings("unchecked")
protected static int hashFields (int hash, Map<FieldDescriptor, Object> map) {
    for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet ()) {
        FieldDescriptor field = entry.getKey ();
        Object value = entry.getValue ();
        hash = (37 * hash) + field.getNumber ();
        if (field.getType () != FieldDescriptor.Type.ENUM) {
            hash = (53 * hash) + value.hashCode ();
        } else if (field.isRepeated ()) {
            List<? extends EnumLite> list = (List<? extends EnumLite>) value;
            hash = (53 * hash) + Internal.hashEnumList (list);
        } else {
            hash = (53 * hash) + Internal.hashEnum ((EnumLite) value);
        }
    }
    return hash;
}
AbstractMessage.java 文件源码 项目:bazel 阅读 27 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.isMapField()) {
      hash = (53 * hash) + hashMapField(value);
    } else if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + Internal.hashEnumList(list);
    } else {
      hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:android-chromium 阅读 24 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:altidroid 阅读 24 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
AbstractMessage.java 文件源码 项目:cordova-android-chromium 阅读 24 收藏 0 点赞 0 评论 0
/** Get a hash code for given fields and values, using the given seed. */
@SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
    FieldDescriptor field = entry.getKey();
    Object value = entry.getValue();
    hash = (37 * hash) + field.getNumber();
    if (field.getType() != FieldDescriptor.Type.ENUM){
      hash = (53 * hash) + value.hashCode();
    } else if (field.isRepeated()) {
      List<? extends EnumLite> list = (List<? extends EnumLite>) value;
      hash = (53 * hash) + hashEnumList(list);
    } else {
      hash = (53 * hash) + hashEnum((EnumLite) value);
    }
  }
  return hash;
}
RpcConfig.java 文件源码 项目:QDrill 阅读 22 收藏 0 点赞 0 评论 0
private RpcConfig(String name, Map<EnumLite, RpcMessageType<?, ?, ?>> sendMap,
    Map<Integer, RpcMessageType<?, ?, ?>> receiveMap, int timeout) {
  this.name = name;
  this.timeout = timeout;
  this.sendMap = ImmutableMap.copyOf(sendMap);
  this.receiveMap = ImmutableMap.copyOf(receiveMap);
}
RpcConfig.java 文件源码 项目:QDrill 阅读 20 收藏 0 点赞 0 评论 0
public boolean checkResponseSend(EnumLite responseType, Class<?> responseClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking responce send of type %s with response class of %s.",  responseType, responseClass));
  }
  RpcMessageType<?,?,?> type = receiveMap.get(responseType.getNumber());
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc response of type %s.", name, responseType));
  }
  if (type.getRet() != responseClass) {
    throw new IllegalStateException(String.format("%s: The definition for the response doesn't match implementation code.  The definition is %s however the current response is trying to response with an object of type %s.", name, type, responseClass.getCanonicalName()));
  }

  return true;
}
ParseSupport.java 文件源码 项目:curiostack 阅读 26 收藏 0 点赞 0 评论 0
/**
 * Checks whether the oneof whose {@code oneofCase} has already been set. If so, an {@link
 * InvalidProtocolBufferException} is thrown.
 */
static void throwIfOneofAlreadyWritten(Object oneofCase, String fieldName)
    throws InvalidProtocolBufferException {
  if (((EnumLite) oneofCase).getNumber() != 0) {
    // TODO: Add the actual variableName of the offending field to the error message like
    // upstream, not
    // too hard but just a little boring for the expected return.
    throw new InvalidProtocolBufferException(
        "Cannot set field "
            + fieldName
            + " because another field "
            + oneofCase
            + " belonging to the same oneof has already been set.");
  }
}
RpcConfig.java 文件源码 项目:dremio-oss 阅读 18 收藏 0 点赞 0 评论 0
private RpcConfig(String name, Map<EnumLite, RpcMessageType<?, ?, ?>> sendMap,
    Map<Integer, RpcMessageType<?, ?, ?>> receiveMap, int timeout, Executor executor) {
  this.name = name;
  this.timeout = timeout;
  this.sendMap = ImmutableMap.copyOf(sendMap);
  this.receiveMap = ImmutableMap.copyOf(receiveMap);
  this.executor = executor;
}
RpcConfig.java 文件源码 项目:dremio-oss 阅读 22 收藏 0 点赞 0 评论 0
public boolean checkResponseSend(EnumLite responseType, Class<?> responseClass) {
  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug(String.format("Checking responce send of type %s with response class of %s.",  responseType, responseClass));
  }
  RpcMessageType<?,?,?> type = receiveMap.get(responseType.getNumber());
  if (type == null) {
    throw new IllegalStateException(String.format("%s: There is no defined RpcMessage type for a Rpc response of type %s.", name, responseType));
  }
  if (type.getRet() != responseClass) {
    throw new IllegalStateException(String.format("%s: The definition for the response doesn't match implementation code.  The definition is %s however the current response is trying to response with an object of type %s.", name, type, responseClass.getCanonicalName()));
  }

  return true;
}
ProxyConnection.java 文件源码 项目:dremio-oss 阅读 24 收藏 0 点赞 0 评论 0
public <SEND extends MessageLite, RECEIVE extends MessageLite> void send(
    RpcOutcomeListener<RECEIVE> outcomeListener,
    EnumLite rpcType,
    SEND protobufBody,
    Class<RECEIVE> clazz,
    ByteBuf... dataBodies) {
  assert rpcConfig.checkSend(rpcType, protobufBody.getClass(), clazz);
  connection.send(new ProxyListener<RECEIVE>(outcomeListener), RpcType.MESSAGE, msg(rpcType, protobufBody), FabricMessage.class, dataBodies);
}
ProxyConnection.java 文件源码 项目:dremio-oss 阅读 40 收藏 0 点赞 0 评论 0
public <SEND extends MessageLite, RECEIVE extends MessageLite> void sendUnsafe(
    RpcOutcomeListener<RECEIVE> outcomeListener,
    EnumLite rpcType,
    SEND protobufBody,
    Class<RECEIVE> clazz,
    ByteBuf... dataBodies) {
  assert rpcConfig.checkSend(rpcType, protobufBody.getClass(), clazz);
  connection.sendUnsafe(new ProxyListener<RECEIVE>(outcomeListener), RpcType.MESSAGE, msg(rpcType, protobufBody), FabricMessage.class, dataBodies);
}
ProxyConnection.java 文件源码 项目:dremio-oss 阅读 25 收藏 0 点赞 0 评论 0
private <SEND extends MessageLite> FabricMessage msg(EnumLite rpcType, SEND protobufBody){
  return FabricMessage.newBuilder()
      .setProtocolId(protocol.getProtocolId())
      .setInnerRpcType(rpcType.getNumber())
      .setMessage(protobufBody.toByteString())
      .build();
}


问题


面经


文章

微信
公众号

扫码关注公众号