diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java index e38b345a36..e597ae4679 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java @@ -12,39 +12,151 @@ import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.ArrayList; +import java.util.Arrays; import javababushka.client.RedisClient; +import org.apache.commons.lang3.tuple.MutablePair; +import org.apache.commons.lang3.tuple.Pair; +import redis_request.RedisRequestOuterClass.Command; +import redis_request.RedisRequestOuterClass.Command.ArgsArray; +import redis_request.RedisRequestOuterClass.RedisRequest; +import redis_request.RedisRequestOuterClass.RequestType; +import redis_request.RedisRequestOuterClass.Routes; +import redis_request.RedisRequestOuterClass.SimpleRoutes; +import response.ResponseOuterClass.Response; public class BenchmarkingApp { /* - def _varint_encoder(): - """Return an encoder for a basic varint value (does not include tag).""" + @classmethod + def _decode_varint_32(cls, buffer, pos): + decoder_func = cls._varint_decoder((1 << 32) - 1, int) + return decoder_func(buffer, pos) + + @staticmethod + def _varint_decoder(mask, result_type): + """Return an encoder for a basic varint value (does not include tag). - local_int2byte = struct.Struct(">B").pack + Decoded values will be bitwise-anded with the given mask before being + returned, e.g. to limit them to 32 bits. The returned decoder does not + take the usual "end" parameter -- the caller is expected to do bounds checking + after the fact (often the caller can defer such checking until later). The + decoder returns a (value, new_pos) pair. + """ - def encode_varint(write, value, unused_deterministic=None): - bits = value & 0x7F - value >>= 7 - while value: - write(local_int2byte(0x80 | bits)) - bits = value & 0x7F - value >>= 7 - return write(local_int2byte(bits)) + def decode_varint(buffer, pos): + result = 0 + shift = 0 + while 1: + b = buffer[pos] + result |= (b & 0x7F) << shift + pos += 1 + if not (b & 0x80): + result &= mask + result = result_type(result) + return (result, pos) + shift += 7 + if shift >= 64: + raise message.DecodeError("Too many bytes when decoding varint.") - return encode_varint + return decode_varint @classmethod - def _varint_bytes(cls, value: int) -> bytes: - """Encode the given integer as a varint and return the bytes. - TODO: Improve performance - """ - - pieces: List[bytes] = [] - func = cls._varint_encoder() - func(pieces.append, value, True) - return b"".join(pieces) + def decode_delimited( + cls, + read_bytes: bytearray, + read_bytes_view: memoryview, + offset: int, + message_class: Type[message.Message], + ) -> Tuple[message.Message, int]: + try: + msg_len, new_pos = cls._decode_varint_32(read_bytes_view, offset) + except IndexError: + # Didn't read enough bytes to decode the varint + raise PartialMessageException( + "Didn't read enough bytes to decode the varint" + ) + required_read_size = new_pos + msg_len + if required_read_size > len(read_bytes): + # Recieved only partial response + raise PartialMessageException("Recieved only a partial response") + offset = new_pos + msg_buf = read_bytes_view[offset : offset + msg_len] + offset += msg_len + message = message_class() + message.ParseFromString(msg_buf) + return (message, offset) + + async def _reader_loop(self) -> None: + # Socket reader loop + remaining_read_bytes = bytearray() + while True: + read_bytes = await self._reader.read(DEFAULT_READ_BYTES_SIZE) + if len(read_bytes) == 0: + self.close("The server closed the connection") + raise Exception("read 0 bytes") + read_bytes = remaining_read_bytes + bytearray(read_bytes) + read_bytes_view = memoryview(read_bytes) + offset = 0 + while offset <= len(read_bytes): + try: + response, offset = ProtobufCodec.decode_delimited( + read_bytes, read_bytes_view, offset, Response + ) + except PartialMessageException: + # Recieved only partial response, break the inner loop + remaining_read_bytes = read_bytes[offset:] + break + response = cast(Response, response) + res_future = self._available_futures.get(response.callback_idx) + if not res_future or response.HasField("closing_error"): + err_msg = ( + response.closing_error + if response.HasField("closing_error") + else f"Client Error - closing due to unknown error. callback index: {response.callback_idx}" + ) + self.close(err_msg) + + else: + if response.HasField("request_error"): + res_future.set_exception(Exception(response.request_error)) + elif response.HasField("resp_pointer"): + res_future.set_result(value_from_pointer(response.resp_pointer)) + elif response.HasField("constant_response"): + res_future.set_result(OK) + else: + res_future.set_result(None) */ + // Left is length of message, right is position + private static Pair decodeVarint(byte[] buffer, int pos) throws Exception { + long mask = ((long) 1 << 32) - 1; + int shift = 0; + long result = 0; + while (true) { + byte b = buffer[pos]; + result |= (b & 0x7F) << shift; + pos += 1; + if ((b & 0x80) == 0) { + result &= mask; + // result = (int) result; + return new MutablePair<>(result, pos); + } + shift += 7; + if (shift >= 64) { + throw new Exception("Too many bytes when decoding varint."); + } + } + } + + private static Response decodeMessage(byte[] buffer) throws Exception { + Pair pair = decodeVarint(buffer, 0); + int startIdx = (int) pair.getRight(); + byte[] responseBytes = + Arrays.copyOfRange(buffer, startIdx, startIdx + (int) (long) pair.getLeft()); + Response response = Response.parseFrom(responseBytes); + return response; + } + private static Byte[] varintBytes(int value) { ArrayList output = new ArrayList(); int bits = value & 0x7F; @@ -59,7 +171,7 @@ private static Byte[] varintBytes(int value) { return output.toArray(arr); } - private static String readSocketMessage(SocketChannel channel) throws IOException { + private static byte[] readSocketMessage(SocketChannel channel) throws IOException { ByteBuffer buffer = ByteBuffer.allocate(1024); int bytesRead = channel.read(buffer); if (bytesRead < 0) return null; @@ -67,9 +179,26 @@ private static String readSocketMessage(SocketChannel channel) throws IOExceptio byte[] bytes = new byte[bytesRead]; buffer.flip(); buffer.get(bytes); - String message = new String(bytes); - return message; + return bytes; + } + + /* + private static sendMessage() { + Byte[] varint = varintBytes(request.toByteArray().length); + + System.out.println("Request: \n" + request.toString()); + ByteBuffer buffer = ByteBuffer.allocate(1024); + buffer.clear(); + for (Byte b : varint) { + buffer.put(b); + } + buffer.put(request.toByteArray()); + buffer.flip(); + while (buffer.hasRemaining()) { + channel.write(buffer); + } } + */ // main application entrypoint public static void main(String[] args) throws InterruptedException { @@ -118,24 +247,68 @@ public static void main(String[] args) throws InterruptedException { } buffer.put(request.toByteArray()); buffer.flip(); - // System.out.println("Buffer: \n" + StandardCharsets.UTF_8.decode(buffer).toString()); while (buffer.hasRemaining()) { channel.write(buffer); } timeout = 0; - String response = ""; - while (response == "" && timeout < maxTimeout) { + byte[] responseBuffer = null; + while (responseBuffer == null && timeout < maxTimeout) { timeout++; - System.out.println("iteration"); - response = readSocketMessage(channel); + responseBuffer = readSocketMessage(channel); Thread.sleep(250); } - if (response == null) { - System.out.println("WARNING: response null"); + try { + Response response = decodeMessage(responseBuffer); + System.out.println(response); + } catch (Exception e) { + e.printStackTrace(); + } + + RedisRequest pingRequest = + RedisRequest.newBuilder() + .setCallbackIdx(0) + .setSingleCommand( + Command.newBuilder() + .setRequestType(RequestType.Ping) + .setArgsArray(ArgsArray.newBuilder())) + .setRoute(Routes.newBuilder().setSimpleRoutes(SimpleRoutes.AllNodes)) + .build(); + + Byte[] varint2 = varintBytes(pingRequest.toByteArray().length); + + System.out.println("Request: \n" + pingRequest.toString()); + ByteBuffer pingBuffer = ByteBuffer.allocate(1024); + pingBuffer.clear(); + for (Byte b : varint2) { + pingBuffer.put(b); + } + pingBuffer.put(pingRequest.toByteArray()); + pingBuffer.flip(); + while (pingBuffer.hasRemaining()) { + channel.write(pingBuffer); + } + + System.out.println("Before read from socket"); + timeout = 0; + byte[] pingResponseBuffer = null; + while (pingResponseBuffer == null && timeout < maxTimeout) { + timeout++; + pingResponseBuffer = readSocketMessage(channel); + Thread.sleep(250); + } + System.out.println("After read from socket"); + + try { + Response pingResponse = decodeMessage(pingResponseBuffer); + System.out.println(pingResponse); + Object o = RedisClient.valueFromPointer(pingResponse.getRespPointer()); + + System.out.println(o); + } catch (Exception e) { + e.printStackTrace(); } - System.out.println("Response: " + response); } catch (IOException e) { e.printStackTrace(); diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java index bb2e164c6d..4f267de6e5 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java @@ -3,6 +3,8 @@ public class RedisClient { public static native void startSocketListenerExternal(RedisClient callback); + public static native Object valueFromPointer(long pointer); + static { System.loadLibrary("javababushka"); } diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/RedisRequestOuterClass.java b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisRequestOuterClass.java new file mode 100644 index 0000000000..3b5022e1bb --- /dev/null +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisRequestOuterClass.java @@ -0,0 +1,6972 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: redis_request.proto + +package redis_request; + +public final class RedisRequestOuterClass { + private RedisRequestOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** Protobuf enum {@code redis_request.SimpleRoutes} */ + public enum SimpleRoutes implements com.google.protobuf.ProtocolMessageEnum { + /** AllNodes = 0; */ + AllNodes(0), + /** AllPrimaries = 1; */ + AllPrimaries(1), + /** Random = 2; */ + Random(2), + UNRECOGNIZED(-1), + ; + + /** AllNodes = 0; */ + public static final int AllNodes_VALUE = 0; + + /** AllPrimaries = 1; */ + public static final int AllPrimaries_VALUE = 1; + + /** Random = 2; */ + public static final int Random_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SimpleRoutes valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SimpleRoutes forNumber(int value) { + switch (value) { + case 0: + return AllNodes; + case 1: + return AllPrimaries; + case 2: + return Random; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SimpleRoutes findValueByNumber(int number) { + return SimpleRoutes.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final SimpleRoutes[] VALUES = values(); + + public static SimpleRoutes valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SimpleRoutes(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:redis_request.SimpleRoutes) + } + + /** Protobuf enum {@code redis_request.SlotTypes} */ + public enum SlotTypes implements com.google.protobuf.ProtocolMessageEnum { + /** Primary = 0; */ + Primary(0), + /** Replica = 1; */ + Replica(1), + UNRECOGNIZED(-1), + ; + + /** Primary = 0; */ + public static final int Primary_VALUE = 0; + + /** Replica = 1; */ + public static final int Replica_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SlotTypes valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SlotTypes forNumber(int value) { + switch (value) { + case 0: + return Primary; + case 1: + return Replica; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SlotTypes findValueByNumber(int number) { + return SlotTypes.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.getDescriptor().getEnumTypes().get(1); + } + + private static final SlotTypes[] VALUES = values(); + + public static SlotTypes valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SlotTypes(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:redis_request.SlotTypes) + } + + /** Protobuf enum {@code redis_request.RequestType} */ + public enum RequestType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * / Invalid request type
+     * 
+ * + * InvalidRequest = 0; + */ + InvalidRequest(0), + /** + * + * + *
+     * / An unknown command, where all arguments are defined by the user.
+     * 
+ * + * CustomCommand = 1; + */ + CustomCommand(1), + /** + * + * + *
+     * / Type of a get string request.
+     * 
+ * + * GetString = 2; + */ + GetString(2), + /** + * + * + *
+     * / Type of a set string request.
+     * 
+ * + * SetString = 3; + */ + SetString(3), + /** Ping = 4; */ + Ping(4), + /** Info = 5; */ + Info(5), + /** Del = 6; */ + Del(6), + /** Select = 7; */ + Select(7), + /** ConfigGet = 8; */ + ConfigGet(8), + /** ConfigSet = 9; */ + ConfigSet(9), + /** ConfigResetStat = 10; */ + ConfigResetStat(10), + /** ConfigRewrite = 11; */ + ConfigRewrite(11), + /** ClientGetName = 12; */ + ClientGetName(12), + /** ClientGetRedir = 13; */ + ClientGetRedir(13), + /** ClientId = 14; */ + ClientId(14), + /** ClientInfo = 15; */ + ClientInfo(15), + /** ClientKill = 16; */ + ClientKill(16), + /** ClientList = 17; */ + ClientList(17), + /** ClientNoEvict = 18; */ + ClientNoEvict(18), + /** ClientNoTouch = 19; */ + ClientNoTouch(19), + /** ClientPause = 20; */ + ClientPause(20), + /** ClientReply = 21; */ + ClientReply(21), + /** ClientSetInfo = 22; */ + ClientSetInfo(22), + /** ClientSetName = 23; */ + ClientSetName(23), + /** ClientUnblock = 24; */ + ClientUnblock(24), + /** ClientUnpause = 25; */ + ClientUnpause(25), + /** Expire = 26; */ + Expire(26), + /** HashSet = 27; */ + HashSet(27), + /** HashGet = 28; */ + HashGet(28), + /** HashDel = 29; */ + HashDel(29), + /** HashExists = 30; */ + HashExists(30), + /** MGet = 31; */ + MGet(31), + /** MSet = 32; */ + MSet(32), + /** Incr = 33; */ + Incr(33), + /** IncrBy = 34; */ + IncrBy(34), + /** Decr = 35; */ + Decr(35), + /** IncrByFloat = 36; */ + IncrByFloat(36), + /** DecrBy = 37; */ + DecrBy(37), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * / Invalid request type
+     * 
+ * + * InvalidRequest = 0; + */ + public static final int InvalidRequest_VALUE = 0; + + /** + * + * + *
+     * / An unknown command, where all arguments are defined by the user.
+     * 
+ * + * CustomCommand = 1; + */ + public static final int CustomCommand_VALUE = 1; + + /** + * + * + *
+     * / Type of a get string request.
+     * 
+ * + * GetString = 2; + */ + public static final int GetString_VALUE = 2; + + /** + * + * + *
+     * / Type of a set string request.
+     * 
+ * + * SetString = 3; + */ + public static final int SetString_VALUE = 3; + + /** Ping = 4; */ + public static final int Ping_VALUE = 4; + + /** Info = 5; */ + public static final int Info_VALUE = 5; + + /** Del = 6; */ + public static final int Del_VALUE = 6; + + /** Select = 7; */ + public static final int Select_VALUE = 7; + + /** ConfigGet = 8; */ + public static final int ConfigGet_VALUE = 8; + + /** ConfigSet = 9; */ + public static final int ConfigSet_VALUE = 9; + + /** ConfigResetStat = 10; */ + public static final int ConfigResetStat_VALUE = 10; + + /** ConfigRewrite = 11; */ + public static final int ConfigRewrite_VALUE = 11; + + /** ClientGetName = 12; */ + public static final int ClientGetName_VALUE = 12; + + /** ClientGetRedir = 13; */ + public static final int ClientGetRedir_VALUE = 13; + + /** ClientId = 14; */ + public static final int ClientId_VALUE = 14; + + /** ClientInfo = 15; */ + public static final int ClientInfo_VALUE = 15; + + /** ClientKill = 16; */ + public static final int ClientKill_VALUE = 16; + + /** ClientList = 17; */ + public static final int ClientList_VALUE = 17; + + /** ClientNoEvict = 18; */ + public static final int ClientNoEvict_VALUE = 18; + + /** ClientNoTouch = 19; */ + public static final int ClientNoTouch_VALUE = 19; + + /** ClientPause = 20; */ + public static final int ClientPause_VALUE = 20; + + /** ClientReply = 21; */ + public static final int ClientReply_VALUE = 21; + + /** ClientSetInfo = 22; */ + public static final int ClientSetInfo_VALUE = 22; + + /** ClientSetName = 23; */ + public static final int ClientSetName_VALUE = 23; + + /** ClientUnblock = 24; */ + public static final int ClientUnblock_VALUE = 24; + + /** ClientUnpause = 25; */ + public static final int ClientUnpause_VALUE = 25; + + /** Expire = 26; */ + public static final int Expire_VALUE = 26; + + /** HashSet = 27; */ + public static final int HashSet_VALUE = 27; + + /** HashGet = 28; */ + public static final int HashGet_VALUE = 28; + + /** HashDel = 29; */ + public static final int HashDel_VALUE = 29; + + /** HashExists = 30; */ + public static final int HashExists_VALUE = 30; + + /** MGet = 31; */ + public static final int MGet_VALUE = 31; + + /** MSet = 32; */ + public static final int MSet_VALUE = 32; + + /** Incr = 33; */ + public static final int Incr_VALUE = 33; + + /** IncrBy = 34; */ + public static final int IncrBy_VALUE = 34; + + /** Decr = 35; */ + public static final int Decr_VALUE = 35; + + /** IncrByFloat = 36; */ + public static final int IncrByFloat_VALUE = 36; + + /** DecrBy = 37; */ + public static final int DecrBy_VALUE = 37; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequestType forNumber(int value) { + switch (value) { + case 0: + return InvalidRequest; + case 1: + return CustomCommand; + case 2: + return GetString; + case 3: + return SetString; + case 4: + return Ping; + case 5: + return Info; + case 6: + return Del; + case 7: + return Select; + case 8: + return ConfigGet; + case 9: + return ConfigSet; + case 10: + return ConfigResetStat; + case 11: + return ConfigRewrite; + case 12: + return ClientGetName; + case 13: + return ClientGetRedir; + case 14: + return ClientId; + case 15: + return ClientInfo; + case 16: + return ClientKill; + case 17: + return ClientList; + case 18: + return ClientNoEvict; + case 19: + return ClientNoTouch; + case 20: + return ClientPause; + case 21: + return ClientReply; + case 22: + return ClientSetInfo; + case 23: + return ClientSetName; + case 24: + return ClientUnblock; + case 25: + return ClientUnpause; + case 26: + return Expire; + case 27: + return HashSet; + case 28: + return HashGet; + case 29: + return HashDel; + case 30: + return HashExists; + case 31: + return MGet; + case 32: + return MSet; + case 33: + return Incr; + case 34: + return IncrBy; + case 35: + return Decr; + case 36: + return IncrByFloat; + case 37: + return DecrBy; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequestType findValueByNumber(int number) { + return RequestType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.getDescriptor().getEnumTypes().get(2); + } + + private static final RequestType[] VALUES = values(); + + public static RequestType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RequestType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:redis_request.RequestType) + } + + public interface SlotIdRouteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.SlotIdRoute) + com.google.protobuf.MessageOrBuilder { + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + int getSlotTypeValue(); + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + redis_request.RedisRequestOuterClass.SlotTypes getSlotType(); + + /** + * int32 slot_id = 2; + * + * @return The slotId. + */ + int getSlotId(); + } + + /** Protobuf type {@code redis_request.SlotIdRoute} */ + public static final class SlotIdRoute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.SlotIdRoute) + SlotIdRouteOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SlotIdRoute.newBuilder() to construct. + private SlotIdRoute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlotIdRoute() { + slotType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlotIdRoute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotIdRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotIdRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.SlotIdRoute.class, + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder.class); + } + + public static final int SLOT_TYPE_FIELD_NUMBER = 1; + private int slotType_ = 0; + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + @java.lang.Override + public int getSlotTypeValue() { + return slotType_; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotTypes getSlotType() { + redis_request.RedisRequestOuterClass.SlotTypes result = + redis_request.RedisRequestOuterClass.SlotTypes.forNumber(slotType_); + return result == null ? redis_request.RedisRequestOuterClass.SlotTypes.UNRECOGNIZED : result; + } + + public static final int SLOT_ID_FIELD_NUMBER = 2; + private int slotId_ = 0; + + /** + * int32 slot_id = 2; + * + * @return The slotId. + */ + @java.lang.Override + public int getSlotId() { + return slotId_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (slotType_ != redis_request.RedisRequestOuterClass.SlotTypes.Primary.getNumber()) { + output.writeEnum(1, slotType_); + } + if (slotId_ != 0) { + output.writeInt32(2, slotId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (slotType_ != redis_request.RedisRequestOuterClass.SlotTypes.Primary.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, slotType_); + } + if (slotId_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, slotId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.SlotIdRoute)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.SlotIdRoute other = + (redis_request.RedisRequestOuterClass.SlotIdRoute) obj; + + if (slotType_ != other.slotType_) return false; + if (getSlotId() != other.getSlotId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SLOT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + slotType_; + hash = (37 * hash) + SLOT_ID_FIELD_NUMBER; + hash = (53 * hash) + getSlotId(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.SlotIdRoute prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.SlotIdRoute} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.SlotIdRoute) + redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotIdRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotIdRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.SlotIdRoute.class, + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.SlotIdRoute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + slotType_ = 0; + slotId_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotIdRoute_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute build() { + redis_request.RedisRequestOuterClass.SlotIdRoute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute buildPartial() { + redis_request.RedisRequestOuterClass.SlotIdRoute result = + new redis_request.RedisRequestOuterClass.SlotIdRoute(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.SlotIdRoute result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.slotType_ = slotType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.slotId_ = slotId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.SlotIdRoute) { + return mergeFrom((redis_request.RedisRequestOuterClass.SlotIdRoute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.SlotIdRoute other) { + if (other == redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance()) + return this; + if (other.slotType_ != 0) { + setSlotTypeValue(other.getSlotTypeValue()); + } + if (other.getSlotId() != 0) { + setSlotId(other.getSlotId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + slotType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + slotId_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int slotType_ = 0; + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + @java.lang.Override + public int getSlotTypeValue() { + return slotType_; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @param value The enum numeric value on the wire for slotType to set. + * @return This builder for chaining. + */ + public Builder setSlotTypeValue(int value) { + slotType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotTypes getSlotType() { + redis_request.RedisRequestOuterClass.SlotTypes result = + redis_request.RedisRequestOuterClass.SlotTypes.forNumber(slotType_); + return result == null + ? redis_request.RedisRequestOuterClass.SlotTypes.UNRECOGNIZED + : result; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @param value The slotType to set. + * @return This builder for chaining. + */ + public Builder setSlotType(redis_request.RedisRequestOuterClass.SlotTypes value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + slotType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSlotType() { + bitField0_ = (bitField0_ & ~0x00000001); + slotType_ = 0; + onChanged(); + return this; + } + + private int slotId_; + + /** + * int32 slot_id = 2; + * + * @return The slotId. + */ + @java.lang.Override + public int getSlotId() { + return slotId_; + } + + /** + * int32 slot_id = 2; + * + * @param value The slotId to set. + * @return This builder for chaining. + */ + public Builder setSlotId(int value) { + + slotId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * int32 slot_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearSlotId() { + bitField0_ = (bitField0_ & ~0x00000002); + slotId_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.SlotIdRoute) + } + + // @@protoc_insertion_point(class_scope:redis_request.SlotIdRoute) + private static final redis_request.RedisRequestOuterClass.SlotIdRoute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.SlotIdRoute(); + } + + public static redis_request.RedisRequestOuterClass.SlotIdRoute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlotIdRoute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SlotKeyRouteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.SlotKeyRoute) + com.google.protobuf.MessageOrBuilder { + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + int getSlotTypeValue(); + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + redis_request.RedisRequestOuterClass.SlotTypes getSlotType(); + + /** + * string slot_key = 2; + * + * @return The slotKey. + */ + java.lang.String getSlotKey(); + + /** + * string slot_key = 2; + * + * @return The bytes for slotKey. + */ + com.google.protobuf.ByteString getSlotKeyBytes(); + } + + /** Protobuf type {@code redis_request.SlotKeyRoute} */ + public static final class SlotKeyRoute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.SlotKeyRoute) + SlotKeyRouteOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SlotKeyRoute.newBuilder() to construct. + private SlotKeyRoute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlotKeyRoute() { + slotType_ = 0; + slotKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlotKeyRoute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotKeyRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotKeyRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.SlotKeyRoute.class, + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder.class); + } + + public static final int SLOT_TYPE_FIELD_NUMBER = 1; + private int slotType_ = 0; + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + @java.lang.Override + public int getSlotTypeValue() { + return slotType_; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotTypes getSlotType() { + redis_request.RedisRequestOuterClass.SlotTypes result = + redis_request.RedisRequestOuterClass.SlotTypes.forNumber(slotType_); + return result == null ? redis_request.RedisRequestOuterClass.SlotTypes.UNRECOGNIZED : result; + } + + public static final int SLOT_KEY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object slotKey_ = ""; + + /** + * string slot_key = 2; + * + * @return The slotKey. + */ + @java.lang.Override + public java.lang.String getSlotKey() { + java.lang.Object ref = slotKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + slotKey_ = s; + return s; + } + } + + /** + * string slot_key = 2; + * + * @return The bytes for slotKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSlotKeyBytes() { + java.lang.Object ref = slotKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + slotKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (slotType_ != redis_request.RedisRequestOuterClass.SlotTypes.Primary.getNumber()) { + output.writeEnum(1, slotType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(slotKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, slotKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (slotType_ != redis_request.RedisRequestOuterClass.SlotTypes.Primary.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, slotType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(slotKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, slotKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.SlotKeyRoute)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.SlotKeyRoute other = + (redis_request.RedisRequestOuterClass.SlotKeyRoute) obj; + + if (slotType_ != other.slotType_) return false; + if (!getSlotKey().equals(other.getSlotKey())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SLOT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + slotType_; + hash = (37 * hash) + SLOT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSlotKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.SlotKeyRoute prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.SlotKeyRoute} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.SlotKeyRoute) + redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotKeyRoute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotKeyRoute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.SlotKeyRoute.class, + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.SlotKeyRoute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + slotType_ = 0; + slotKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_SlotKeyRoute_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute build() { + redis_request.RedisRequestOuterClass.SlotKeyRoute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute buildPartial() { + redis_request.RedisRequestOuterClass.SlotKeyRoute result = + new redis_request.RedisRequestOuterClass.SlotKeyRoute(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.SlotKeyRoute result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.slotType_ = slotType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.slotKey_ = slotKey_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.SlotKeyRoute) { + return mergeFrom((redis_request.RedisRequestOuterClass.SlotKeyRoute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.SlotKeyRoute other) { + if (other == redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance()) + return this; + if (other.slotType_ != 0) { + setSlotTypeValue(other.getSlotTypeValue()); + } + if (!other.getSlotKey().isEmpty()) { + slotKey_ = other.slotKey_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + slotType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + slotKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int slotType_ = 0; + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The enum numeric value on the wire for slotType. + */ + @java.lang.Override + public int getSlotTypeValue() { + return slotType_; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @param value The enum numeric value on the wire for slotType to set. + * @return This builder for chaining. + */ + public Builder setSlotTypeValue(int value) { + slotType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return The slotType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotTypes getSlotType() { + redis_request.RedisRequestOuterClass.SlotTypes result = + redis_request.RedisRequestOuterClass.SlotTypes.forNumber(slotType_); + return result == null + ? redis_request.RedisRequestOuterClass.SlotTypes.UNRECOGNIZED + : result; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @param value The slotType to set. + * @return This builder for chaining. + */ + public Builder setSlotType(redis_request.RedisRequestOuterClass.SlotTypes value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + slotType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .redis_request.SlotTypes slot_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSlotType() { + bitField0_ = (bitField0_ & ~0x00000001); + slotType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object slotKey_ = ""; + + /** + * string slot_key = 2; + * + * @return The slotKey. + */ + public java.lang.String getSlotKey() { + java.lang.Object ref = slotKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + slotKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string slot_key = 2; + * + * @return The bytes for slotKey. + */ + public com.google.protobuf.ByteString getSlotKeyBytes() { + java.lang.Object ref = slotKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + slotKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string slot_key = 2; + * + * @param value The slotKey to set. + * @return This builder for chaining. + */ + public Builder setSlotKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + slotKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string slot_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearSlotKey() { + slotKey_ = getDefaultInstance().getSlotKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string slot_key = 2; + * + * @param value The bytes for slotKey to set. + * @return This builder for chaining. + */ + public Builder setSlotKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + slotKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.SlotKeyRoute) + } + + // @@protoc_insertion_point(class_scope:redis_request.SlotKeyRoute) + private static final redis_request.RedisRequestOuterClass.SlotKeyRoute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.SlotKeyRoute(); + } + + public static redis_request.RedisRequestOuterClass.SlotKeyRoute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlotKeyRoute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RoutesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.Routes) + com.google.protobuf.MessageOrBuilder { + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return Whether the simpleRoutes field is set. + */ + boolean hasSimpleRoutes(); + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The enum numeric value on the wire for simpleRoutes. + */ + int getSimpleRoutesValue(); + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The simpleRoutes. + */ + redis_request.RedisRequestOuterClass.SimpleRoutes getSimpleRoutes(); + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return Whether the slotKeyRoute field is set. + */ + boolean hasSlotKeyRoute(); + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return The slotKeyRoute. + */ + redis_request.RedisRequestOuterClass.SlotKeyRoute getSlotKeyRoute(); + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder getSlotKeyRouteOrBuilder(); + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return Whether the slotIdRoute field is set. + */ + boolean hasSlotIdRoute(); + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return The slotIdRoute. + */ + redis_request.RedisRequestOuterClass.SlotIdRoute getSlotIdRoute(); + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder getSlotIdRouteOrBuilder(); + + redis_request.RedisRequestOuterClass.Routes.ValueCase getValueCase(); + } + + /** Protobuf type {@code redis_request.Routes} */ + public static final class Routes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.Routes) + RoutesOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Routes.newBuilder() to construct. + private Routes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Routes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Routes(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.internal_static_redis_request_Routes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Routes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Routes.class, + redis_request.RedisRequestOuterClass.Routes.Builder.class); + } + + private int valueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SIMPLE_ROUTES(1), + SLOT_KEY_ROUTE(2), + SLOT_ID_ROUTE(3), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: + return SIMPLE_ROUTES; + case 2: + return SLOT_KEY_ROUTE; + case 3: + return SLOT_ID_ROUTE; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int SIMPLE_ROUTES_FIELD_NUMBER = 1; + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return Whether the simpleRoutes field is set. + */ + public boolean hasSimpleRoutes() { + return valueCase_ == 1; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The enum numeric value on the wire for simpleRoutes. + */ + public int getSimpleRoutesValue() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The simpleRoutes. + */ + public redis_request.RedisRequestOuterClass.SimpleRoutes getSimpleRoutes() { + if (valueCase_ == 1) { + redis_request.RedisRequestOuterClass.SimpleRoutes result = + redis_request.RedisRequestOuterClass.SimpleRoutes.forNumber((java.lang.Integer) value_); + return result == null + ? redis_request.RedisRequestOuterClass.SimpleRoutes.UNRECOGNIZED + : result; + } + return redis_request.RedisRequestOuterClass.SimpleRoutes.AllNodes; + } + + public static final int SLOT_KEY_ROUTE_FIELD_NUMBER = 2; + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return Whether the slotKeyRoute field is set. + */ + @java.lang.Override + public boolean hasSlotKeyRoute() { + return valueCase_ == 2; + } + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return The slotKeyRoute. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute getSlotKeyRoute() { + if (valueCase_ == 2) { + return (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder getSlotKeyRouteOrBuilder() { + if (valueCase_ == 2) { + return (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + + public static final int SLOT_ID_ROUTE_FIELD_NUMBER = 3; + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return Whether the slotIdRoute field is set. + */ + @java.lang.Override + public boolean hasSlotIdRoute() { + return valueCase_ == 3; + } + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return The slotIdRoute. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute getSlotIdRoute() { + if (valueCase_ == 3) { + return (redis_request.RedisRequestOuterClass.SlotIdRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder getSlotIdRouteOrBuilder() { + if (valueCase_ == 3) { + return (redis_request.RedisRequestOuterClass.SlotIdRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (valueCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + output.writeMessage(2, (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_); + } + if (valueCase_ == 3) { + output.writeMessage(3, (redis_request.RedisRequestOuterClass.SlotIdRoute) value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(1, ((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_); + } + if (valueCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (redis_request.RedisRequestOuterClass.SlotIdRoute) value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.Routes)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.Routes other = + (redis_request.RedisRequestOuterClass.Routes) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (getSimpleRoutesValue() != other.getSimpleRoutesValue()) return false; + break; + case 2: + if (!getSlotKeyRoute().equals(other.getSlotKeyRoute())) return false; + break; + case 3: + if (!getSlotIdRoute().equals(other.getSlotIdRoute())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + SIMPLE_ROUTES_FIELD_NUMBER; + hash = (53 * hash) + getSimpleRoutesValue(); + break; + case 2: + hash = (37 * hash) + SLOT_KEY_ROUTE_FIELD_NUMBER; + hash = (53 * hash) + getSlotKeyRoute().hashCode(); + break; + case 3: + hash = (37 * hash) + SLOT_ID_ROUTE_FIELD_NUMBER; + hash = (53 * hash) + getSlotIdRoute().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Routes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Routes parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Routes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.Routes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.Routes} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.Routes) + redis_request.RedisRequestOuterClass.RoutesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.internal_static_redis_request_Routes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Routes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Routes.class, + redis_request.RedisRequestOuterClass.Routes.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.Routes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (slotKeyRouteBuilder_ != null) { + slotKeyRouteBuilder_.clear(); + } + if (slotIdRouteBuilder_ != null) { + slotIdRouteBuilder_.clear(); + } + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass.internal_static_redis_request_Routes_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Routes getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.Routes.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Routes build() { + redis_request.RedisRequestOuterClass.Routes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Routes buildPartial() { + redis_request.RedisRequestOuterClass.Routes result = + new redis_request.RedisRequestOuterClass.Routes(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.Routes result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(redis_request.RedisRequestOuterClass.Routes result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + if (valueCase_ == 2 && slotKeyRouteBuilder_ != null) { + result.value_ = slotKeyRouteBuilder_.build(); + } + if (valueCase_ == 3 && slotIdRouteBuilder_ != null) { + result.value_ = slotIdRouteBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.Routes) { + return mergeFrom((redis_request.RedisRequestOuterClass.Routes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.Routes other) { + if (other == redis_request.RedisRequestOuterClass.Routes.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case SIMPLE_ROUTES: + { + setSimpleRoutesValue(other.getSimpleRoutesValue()); + break; + } + case SLOT_KEY_ROUTE: + { + mergeSlotKeyRoute(other.getSlotKeyRoute()); + break; + } + case SLOT_ID_ROUTE: + { + mergeSlotIdRoute(other.getSlotIdRoute()); + break; + } + case VALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + valueCase_ = 1; + value_ = rawValue; + break; + } // case 8 + case 18: + { + input.readMessage(getSlotKeyRouteFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getSlotIdRouteFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return Whether the simpleRoutes field is set. + */ + @java.lang.Override + public boolean hasSimpleRoutes() { + return valueCase_ == 1; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The enum numeric value on the wire for simpleRoutes. + */ + @java.lang.Override + public int getSimpleRoutesValue() { + if (valueCase_ == 1) { + return ((java.lang.Integer) value_).intValue(); + } + return 0; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @param value The enum numeric value on the wire for simpleRoutes to set. + * @return This builder for chaining. + */ + public Builder setSimpleRoutesValue(int value) { + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return The simpleRoutes. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SimpleRoutes getSimpleRoutes() { + if (valueCase_ == 1) { + redis_request.RedisRequestOuterClass.SimpleRoutes result = + redis_request.RedisRequestOuterClass.SimpleRoutes.forNumber( + (java.lang.Integer) value_); + return result == null + ? redis_request.RedisRequestOuterClass.SimpleRoutes.UNRECOGNIZED + : result; + } + return redis_request.RedisRequestOuterClass.SimpleRoutes.AllNodes; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @param value The simpleRoutes to set. + * @return This builder for chaining. + */ + public Builder setSimpleRoutes(redis_request.RedisRequestOuterClass.SimpleRoutes value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 1; + value_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .redis_request.SimpleRoutes simple_routes = 1; + * + * @return This builder for chaining. + */ + public Builder clearSimpleRoutes() { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotKeyRoute, + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder, + redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder> + slotKeyRouteBuilder_; + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return Whether the slotKeyRoute field is set. + */ + @java.lang.Override + public boolean hasSlotKeyRoute() { + return valueCase_ == 2; + } + + /** + * .redis_request.SlotKeyRoute slot_key_route = 2; + * + * @return The slotKeyRoute. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRoute getSlotKeyRoute() { + if (slotKeyRouteBuilder_ == null) { + if (valueCase_ == 2) { + return (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } else { + if (valueCase_ == 2) { + return slotKeyRouteBuilder_.getMessage(); + } + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + public Builder setSlotKeyRoute(redis_request.RedisRequestOuterClass.SlotKeyRoute value) { + if (slotKeyRouteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + slotKeyRouteBuilder_.setMessage(value); + } + valueCase_ = 2; + return this; + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + public Builder setSlotKeyRoute( + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder builderForValue) { + if (slotKeyRouteBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + slotKeyRouteBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 2; + return this; + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + public Builder mergeSlotKeyRoute(redis_request.RedisRequestOuterClass.SlotKeyRoute value) { + if (slotKeyRouteBuilder_ == null) { + if (valueCase_ == 2 + && value_ != redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance()) { + value_ = + redis_request.RedisRequestOuterClass.SlotKeyRoute.newBuilder( + (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 2) { + slotKeyRouteBuilder_.mergeFrom(value); + } else { + slotKeyRouteBuilder_.setMessage(value); + } + } + valueCase_ = 2; + return this; + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + public Builder clearSlotKeyRoute() { + if (slotKeyRouteBuilder_ == null) { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + } + slotKeyRouteBuilder_.clear(); + } + return this; + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + public redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder getSlotKeyRouteBuilder() { + return getSlotKeyRouteFieldBuilder().getBuilder(); + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder getSlotKeyRouteOrBuilder() { + if ((valueCase_ == 2) && (slotKeyRouteBuilder_ != null)) { + return slotKeyRouteBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 2) { + return (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + } + + /** .redis_request.SlotKeyRoute slot_key_route = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotKeyRoute, + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder, + redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder> + getSlotKeyRouteFieldBuilder() { + if (slotKeyRouteBuilder_ == null) { + if (!(valueCase_ == 2)) { + value_ = redis_request.RedisRequestOuterClass.SlotKeyRoute.getDefaultInstance(); + } + slotKeyRouteBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotKeyRoute, + redis_request.RedisRequestOuterClass.SlotKeyRoute.Builder, + redis_request.RedisRequestOuterClass.SlotKeyRouteOrBuilder>( + (redis_request.RedisRequestOuterClass.SlotKeyRoute) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 2; + onChanged(); + return slotKeyRouteBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotIdRoute, + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder, + redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder> + slotIdRouteBuilder_; + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return Whether the slotIdRoute field is set. + */ + @java.lang.Override + public boolean hasSlotIdRoute() { + return valueCase_ == 3; + } + + /** + * .redis_request.SlotIdRoute slot_id_route = 3; + * + * @return The slotIdRoute. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRoute getSlotIdRoute() { + if (slotIdRouteBuilder_ == null) { + if (valueCase_ == 3) { + return (redis_request.RedisRequestOuterClass.SlotIdRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } else { + if (valueCase_ == 3) { + return slotIdRouteBuilder_.getMessage(); + } + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + public Builder setSlotIdRoute(redis_request.RedisRequestOuterClass.SlotIdRoute value) { + if (slotIdRouteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + slotIdRouteBuilder_.setMessage(value); + } + valueCase_ = 3; + return this; + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + public Builder setSlotIdRoute( + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder builderForValue) { + if (slotIdRouteBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + slotIdRouteBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 3; + return this; + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + public Builder mergeSlotIdRoute(redis_request.RedisRequestOuterClass.SlotIdRoute value) { + if (slotIdRouteBuilder_ == null) { + if (valueCase_ == 3 + && value_ != redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance()) { + value_ = + redis_request.RedisRequestOuterClass.SlotIdRoute.newBuilder( + (redis_request.RedisRequestOuterClass.SlotIdRoute) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 3) { + slotIdRouteBuilder_.mergeFrom(value); + } else { + slotIdRouteBuilder_.setMessage(value); + } + } + valueCase_ = 3; + return this; + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + public Builder clearSlotIdRoute() { + if (slotIdRouteBuilder_ == null) { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + } + slotIdRouteBuilder_.clear(); + } + return this; + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + public redis_request.RedisRequestOuterClass.SlotIdRoute.Builder getSlotIdRouteBuilder() { + return getSlotIdRouteFieldBuilder().getBuilder(); + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder getSlotIdRouteOrBuilder() { + if ((valueCase_ == 3) && (slotIdRouteBuilder_ != null)) { + return slotIdRouteBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 3) { + return (redis_request.RedisRequestOuterClass.SlotIdRoute) value_; + } + return redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + } + + /** .redis_request.SlotIdRoute slot_id_route = 3; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotIdRoute, + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder, + redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder> + getSlotIdRouteFieldBuilder() { + if (slotIdRouteBuilder_ == null) { + if (!(valueCase_ == 3)) { + value_ = redis_request.RedisRequestOuterClass.SlotIdRoute.getDefaultInstance(); + } + slotIdRouteBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.SlotIdRoute, + redis_request.RedisRequestOuterClass.SlotIdRoute.Builder, + redis_request.RedisRequestOuterClass.SlotIdRouteOrBuilder>( + (redis_request.RedisRequestOuterClass.SlotIdRoute) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 3; + onChanged(); + return slotIdRouteBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.Routes) + } + + // @@protoc_insertion_point(class_scope:redis_request.Routes) + private static final redis_request.RedisRequestOuterClass.Routes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.Routes(); + } + + public static redis_request.RedisRequestOuterClass.Routes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Routes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Routes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CommandOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.Command) + com.google.protobuf.MessageOrBuilder { + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The enum numeric value on the wire for requestType. + */ + int getRequestTypeValue(); + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The requestType. + */ + redis_request.RedisRequestOuterClass.RequestType getRequestType(); + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return Whether the argsArray field is set. + */ + boolean hasArgsArray(); + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return The argsArray. + */ + redis_request.RedisRequestOuterClass.Command.ArgsArray getArgsArray(); + + /** .redis_request.Command.ArgsArray args_array = 2; */ + redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder getArgsArrayOrBuilder(); + + /** + * uint64 args_vec_pointer = 3; + * + * @return Whether the argsVecPointer field is set. + */ + boolean hasArgsVecPointer(); + + /** + * uint64 args_vec_pointer = 3; + * + * @return The argsVecPointer. + */ + long getArgsVecPointer(); + + redis_request.RedisRequestOuterClass.Command.ArgsCase getArgsCase(); + } + + /** Protobuf type {@code redis_request.Command} */ + public static final class Command extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.Command) + CommandOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Command.newBuilder() to construct. + private Command(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Command() { + requestType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Command(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass.internal_static_redis_request_Command_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Command.class, + redis_request.RedisRequestOuterClass.Command.Builder.class); + } + + public interface ArgsArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.Command.ArgsArray) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string args = 1; + * + * @return A list containing the args. + */ + java.util.List getArgsList(); + + /** + * repeated string args = 1; + * + * @return The count of args. + */ + int getArgsCount(); + + /** + * repeated string args = 1; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + java.lang.String getArgs(int index); + + /** + * repeated string args = 1; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + com.google.protobuf.ByteString getArgsBytes(int index); + } + + /** Protobuf type {@code redis_request.Command.ArgsArray} */ + public static final class ArgsArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.Command.ArgsArray) + ArgsArrayOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ArgsArray.newBuilder() to construct. + private ArgsArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ArgsArray() { + args_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ArgsArray(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_ArgsArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_ArgsArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Command.ArgsArray.class, + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder.class); + } + + public static final int ARGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList args_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * repeated string args = 1; + * + * @return A list containing the args. + */ + public com.google.protobuf.ProtocolStringList getArgsList() { + return args_; + } + + /** + * repeated string args = 1; + * + * @return The count of args. + */ + public int getArgsCount() { + return args_.size(); + } + + /** + * repeated string args = 1; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + + /** + * repeated string args = 1; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + public com.google.protobuf.ByteString getArgsBytes(int index) { + return args_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < args_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, args_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < args_.size(); i++) { + dataSize += computeStringSizeNoTag(args_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.Command.ArgsArray)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.Command.ArgsArray other = + (redis_request.RedisRequestOuterClass.Command.ArgsArray) obj; + + if (!getArgsList().equals(other.getArgsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getArgsCount() > 0) { + hash = (37 * hash) + ARGS_FIELD_NUMBER; + hash = (53 * hash) + getArgsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + redis_request.RedisRequestOuterClass.Command.ArgsArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.Command.ArgsArray} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.Command.ArgsArray) + redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_ArgsArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_ArgsArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Command.ArgsArray.class, + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.Command.ArgsArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + args_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_ArgsArray_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray build() { + redis_request.RedisRequestOuterClass.Command.ArgsArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray buildPartial() { + redis_request.RedisRequestOuterClass.Command.ArgsArray result = + new redis_request.RedisRequestOuterClass.Command.ArgsArray(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.Command.ArgsArray result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + args_.makeImmutable(); + result.args_ = args_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.Command.ArgsArray) { + return mergeFrom((redis_request.RedisRequestOuterClass.Command.ArgsArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.Command.ArgsArray other) { + if (other == redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance()) + return this; + if (!other.args_.isEmpty()) { + if (args_.isEmpty()) { + args_ = other.args_; + bitField0_ |= 0x00000001; + } else { + ensureArgsIsMutable(); + args_.addAll(other.args_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureArgsIsMutable(); + args_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList args_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureArgsIsMutable() { + if (!args_.isModifiable()) { + args_ = new com.google.protobuf.LazyStringArrayList(args_); + } + bitField0_ |= 0x00000001; + } + + /** + * repeated string args = 1; + * + * @return A list containing the args. + */ + public com.google.protobuf.ProtocolStringList getArgsList() { + args_.makeImmutable(); + return args_; + } + + /** + * repeated string args = 1; + * + * @return The count of args. + */ + public int getArgsCount() { + return args_.size(); + } + + /** + * repeated string args = 1; + * + * @param index The index of the element to return. + * @return The args at the given index. + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + + /** + * repeated string args = 1; + * + * @param index The index of the value to return. + * @return The bytes of the args at the given index. + */ + public com.google.protobuf.ByteString getArgsBytes(int index) { + return args_.getByteString(index); + } + + /** + * repeated string args = 1; + * + * @param index The index to set the value at. + * @param value The args to set. + * @return This builder for chaining. + */ + public Builder setArgs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string args = 1; + * + * @param value The args to add. + * @return This builder for chaining. + */ + public Builder addArgs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string args = 1; + * + * @param values The args to add. + * @return This builder for chaining. + */ + public Builder addAllArgs(java.lang.Iterable values) { + ensureArgsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, args_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string args = 1; + * + * @return This builder for chaining. + */ + public Builder clearArgs() { + args_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * repeated string args = 1; + * + * @param value The bytes of the args to add. + * @return This builder for chaining. + */ + public Builder addArgsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureArgsIsMutable(); + args_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.Command.ArgsArray) + } + + // @@protoc_insertion_point(class_scope:redis_request.Command.ArgsArray) + private static final redis_request.RedisRequestOuterClass.Command.ArgsArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.Command.ArgsArray(); + } + + public static redis_request.RedisRequestOuterClass.Command.ArgsArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArgsArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int argsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object args_; + + public enum ArgsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ARGS_ARRAY(2), + ARGS_VEC_POINTER(3), + ARGS_NOT_SET(0); + private final int value; + + private ArgsCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ArgsCase valueOf(int value) { + return forNumber(value); + } + + public static ArgsCase forNumber(int value) { + switch (value) { + case 2: + return ARGS_ARRAY; + case 3: + return ARGS_VEC_POINTER; + case 0: + return ARGS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ArgsCase getArgsCase() { + return ArgsCase.forNumber(argsCase_); + } + + public static final int REQUEST_TYPE_FIELD_NUMBER = 1; + private int requestType_ = 0; + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The enum numeric value on the wire for requestType. + */ + @java.lang.Override + public int getRequestTypeValue() { + return requestType_; + } + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The requestType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.RequestType getRequestType() { + redis_request.RedisRequestOuterClass.RequestType result = + redis_request.RedisRequestOuterClass.RequestType.forNumber(requestType_); + return result == null + ? redis_request.RedisRequestOuterClass.RequestType.UNRECOGNIZED + : result; + } + + public static final int ARGS_ARRAY_FIELD_NUMBER = 2; + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return Whether the argsArray field is set. + */ + @java.lang.Override + public boolean hasArgsArray() { + return argsCase_ == 2; + } + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return The argsArray. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray getArgsArray() { + if (argsCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_; + } + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder getArgsArrayOrBuilder() { + if (argsCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_; + } + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + + public static final int ARGS_VEC_POINTER_FIELD_NUMBER = 3; + + /** + * uint64 args_vec_pointer = 3; + * + * @return Whether the argsVecPointer field is set. + */ + @java.lang.Override + public boolean hasArgsVecPointer() { + return argsCase_ == 3; + } + + /** + * uint64 args_vec_pointer = 3; + * + * @return The argsVecPointer. + */ + @java.lang.Override + public long getArgsVecPointer() { + if (argsCase_ == 3) { + return (java.lang.Long) args_; + } + return 0L; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (requestType_ + != redis_request.RedisRequestOuterClass.RequestType.InvalidRequest.getNumber()) { + output.writeEnum(1, requestType_); + } + if (argsCase_ == 2) { + output.writeMessage(2, (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_); + } + if (argsCase_ == 3) { + output.writeUInt64(3, (long) ((java.lang.Long) args_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestType_ + != redis_request.RedisRequestOuterClass.RequestType.InvalidRequest.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, requestType_); + } + if (argsCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_); + } + if (argsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeUInt64Size( + 3, (long) ((java.lang.Long) args_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.Command)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.Command other = + (redis_request.RedisRequestOuterClass.Command) obj; + + if (requestType_ != other.requestType_) return false; + if (!getArgsCase().equals(other.getArgsCase())) return false; + switch (argsCase_) { + case 2: + if (!getArgsArray().equals(other.getArgsArray())) return false; + break; + case 3: + if (getArgsVecPointer() != other.getArgsVecPointer()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQUEST_TYPE_FIELD_NUMBER; + hash = (53 * hash) + requestType_; + switch (argsCase_) { + case 2: + hash = (37 * hash) + ARGS_ARRAY_FIELD_NUMBER; + hash = (53 * hash) + getArgsArray().hashCode(); + break; + case 3: + hash = (37 * hash) + ARGS_VEC_POINTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getArgsVecPointer()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Command parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.Command prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.Command} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.Command) + redis_request.RedisRequestOuterClass.CommandOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Command.class, + redis_request.RedisRequestOuterClass.Command.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.Command.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + requestType_ = 0; + if (argsArrayBuilder_ != null) { + argsArrayBuilder_.clear(); + } + argsCase_ = 0; + args_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Command_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command build() { + redis_request.RedisRequestOuterClass.Command result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command buildPartial() { + redis_request.RedisRequestOuterClass.Command result = + new redis_request.RedisRequestOuterClass.Command(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.Command result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.requestType_ = requestType_; + } + } + + private void buildPartialOneofs(redis_request.RedisRequestOuterClass.Command result) { + result.argsCase_ = argsCase_; + result.args_ = this.args_; + if (argsCase_ == 2 && argsArrayBuilder_ != null) { + result.args_ = argsArrayBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.Command) { + return mergeFrom((redis_request.RedisRequestOuterClass.Command) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.Command other) { + if (other == redis_request.RedisRequestOuterClass.Command.getDefaultInstance()) return this; + if (other.requestType_ != 0) { + setRequestTypeValue(other.getRequestTypeValue()); + } + switch (other.getArgsCase()) { + case ARGS_ARRAY: + { + mergeArgsArray(other.getArgsArray()); + break; + } + case ARGS_VEC_POINTER: + { + setArgsVecPointer(other.getArgsVecPointer()); + break; + } + case ARGS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + requestType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getArgsArrayFieldBuilder().getBuilder(), extensionRegistry); + argsCase_ = 2; + break; + } // case 18 + case 24: + { + args_ = input.readUInt64(); + argsCase_ = 3; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int argsCase_ = 0; + private java.lang.Object args_; + + public ArgsCase getArgsCase() { + return ArgsCase.forNumber(argsCase_); + } + + public Builder clearArgs() { + argsCase_ = 0; + args_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int requestType_ = 0; + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The enum numeric value on the wire for requestType. + */ + @java.lang.Override + public int getRequestTypeValue() { + return requestType_; + } + + /** + * .redis_request.RequestType request_type = 1; + * + * @param value The enum numeric value on the wire for requestType to set. + * @return This builder for chaining. + */ + public Builder setRequestTypeValue(int value) { + requestType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .redis_request.RequestType request_type = 1; + * + * @return The requestType. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.RequestType getRequestType() { + redis_request.RedisRequestOuterClass.RequestType result = + redis_request.RedisRequestOuterClass.RequestType.forNumber(requestType_); + return result == null + ? redis_request.RedisRequestOuterClass.RequestType.UNRECOGNIZED + : result; + } + + /** + * .redis_request.RequestType request_type = 1; + * + * @param value The requestType to set. + * @return This builder for chaining. + */ + public Builder setRequestType(redis_request.RedisRequestOuterClass.RequestType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + requestType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .redis_request.RequestType request_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearRequestType() { + bitField0_ = (bitField0_ & ~0x00000001); + requestType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command.ArgsArray, + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder, + redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder> + argsArrayBuilder_; + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return Whether the argsArray field is set. + */ + @java.lang.Override + public boolean hasArgsArray() { + return argsCase_ == 2; + } + + /** + * .redis_request.Command.ArgsArray args_array = 2; + * + * @return The argsArray. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArray getArgsArray() { + if (argsArrayBuilder_ == null) { + if (argsCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_; + } + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } else { + if (argsCase_ == 2) { + return argsArrayBuilder_.getMessage(); + } + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + public Builder setArgsArray(redis_request.RedisRequestOuterClass.Command.ArgsArray value) { + if (argsArrayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + args_ = value; + onChanged(); + } else { + argsArrayBuilder_.setMessage(value); + } + argsCase_ = 2; + return this; + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + public Builder setArgsArray( + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder builderForValue) { + if (argsArrayBuilder_ == null) { + args_ = builderForValue.build(); + onChanged(); + } else { + argsArrayBuilder_.setMessage(builderForValue.build()); + } + argsCase_ = 2; + return this; + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + public Builder mergeArgsArray(redis_request.RedisRequestOuterClass.Command.ArgsArray value) { + if (argsArrayBuilder_ == null) { + if (argsCase_ == 2 + && args_ + != redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance()) { + args_ = + redis_request.RedisRequestOuterClass.Command.ArgsArray.newBuilder( + (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_) + .mergeFrom(value) + .buildPartial(); + } else { + args_ = value; + } + onChanged(); + } else { + if (argsCase_ == 2) { + argsArrayBuilder_.mergeFrom(value); + } else { + argsArrayBuilder_.setMessage(value); + } + } + argsCase_ = 2; + return this; + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + public Builder clearArgsArray() { + if (argsArrayBuilder_ == null) { + if (argsCase_ == 2) { + argsCase_ = 0; + args_ = null; + onChanged(); + } + } else { + if (argsCase_ == 2) { + argsCase_ = 0; + args_ = null; + } + argsArrayBuilder_.clear(); + } + return this; + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + public redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder getArgsArrayBuilder() { + return getArgsArrayFieldBuilder().getBuilder(); + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder + getArgsArrayOrBuilder() { + if ((argsCase_ == 2) && (argsArrayBuilder_ != null)) { + return argsArrayBuilder_.getMessageOrBuilder(); + } else { + if (argsCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_; + } + return redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + } + + /** .redis_request.Command.ArgsArray args_array = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command.ArgsArray, + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder, + redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder> + getArgsArrayFieldBuilder() { + if (argsArrayBuilder_ == null) { + if (!(argsCase_ == 2)) { + args_ = redis_request.RedisRequestOuterClass.Command.ArgsArray.getDefaultInstance(); + } + argsArrayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command.ArgsArray, + redis_request.RedisRequestOuterClass.Command.ArgsArray.Builder, + redis_request.RedisRequestOuterClass.Command.ArgsArrayOrBuilder>( + (redis_request.RedisRequestOuterClass.Command.ArgsArray) args_, + getParentForChildren(), + isClean()); + args_ = null; + } + argsCase_ = 2; + onChanged(); + return argsArrayBuilder_; + } + + /** + * uint64 args_vec_pointer = 3; + * + * @return Whether the argsVecPointer field is set. + */ + public boolean hasArgsVecPointer() { + return argsCase_ == 3; + } + + /** + * uint64 args_vec_pointer = 3; + * + * @return The argsVecPointer. + */ + public long getArgsVecPointer() { + if (argsCase_ == 3) { + return (java.lang.Long) args_; + } + return 0L; + } + + /** + * uint64 args_vec_pointer = 3; + * + * @param value The argsVecPointer to set. + * @return This builder for chaining. + */ + public Builder setArgsVecPointer(long value) { + + argsCase_ = 3; + args_ = value; + onChanged(); + return this; + } + + /** + * uint64 args_vec_pointer = 3; + * + * @return This builder for chaining. + */ + public Builder clearArgsVecPointer() { + if (argsCase_ == 3) { + argsCase_ = 0; + args_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.Command) + } + + // @@protoc_insertion_point(class_scope:redis_request.Command) + private static final redis_request.RedisRequestOuterClass.Command DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.Command(); + } + + public static redis_request.RedisRequestOuterClass.Command getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Command parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TransactionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.Transaction) + com.google.protobuf.MessageOrBuilder { + + /** repeated .redis_request.Command commands = 1; */ + java.util.List getCommandsList(); + + /** repeated .redis_request.Command commands = 1; */ + redis_request.RedisRequestOuterClass.Command getCommands(int index); + + /** repeated .redis_request.Command commands = 1; */ + int getCommandsCount(); + + /** repeated .redis_request.Command commands = 1; */ + java.util.List + getCommandsOrBuilderList(); + + /** repeated .redis_request.Command commands = 1; */ + redis_request.RedisRequestOuterClass.CommandOrBuilder getCommandsOrBuilder(int index); + } + + /** Protobuf type {@code redis_request.Transaction} */ + public static final class Transaction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.Transaction) + TransactionOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Transaction.newBuilder() to construct. + private Transaction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Transaction() { + commands_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Transaction(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Transaction.class, + redis_request.RedisRequestOuterClass.Transaction.Builder.class); + } + + public static final int COMMANDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List commands_; + + /** repeated .redis_request.Command commands = 1; */ + @java.lang.Override + public java.util.List getCommandsList() { + return commands_; + } + + /** repeated .redis_request.Command commands = 1; */ + @java.lang.Override + public java.util.List + getCommandsOrBuilderList() { + return commands_; + } + + /** repeated .redis_request.Command commands = 1; */ + @java.lang.Override + public int getCommandsCount() { + return commands_.size(); + } + + /** repeated .redis_request.Command commands = 1; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command getCommands(int index) { + return commands_.get(index); + } + + /** repeated .redis_request.Command commands = 1; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.CommandOrBuilder getCommandsOrBuilder(int index) { + return commands_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < commands_.size(); i++) { + output.writeMessage(1, commands_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < commands_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, commands_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.Transaction)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.Transaction other = + (redis_request.RedisRequestOuterClass.Transaction) obj; + + if (!getCommandsList().equals(other.getCommandsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCommandsCount() > 0) { + hash = (37 * hash) + COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getCommandsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.Transaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.Transaction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.Transaction} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.Transaction) + redis_request.RedisRequestOuterClass.TransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Transaction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.Transaction.class, + redis_request.RedisRequestOuterClass.Transaction.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.Transaction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (commandsBuilder_ == null) { + commands_ = java.util.Collections.emptyList(); + } else { + commands_ = null; + commandsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_Transaction_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction build() { + redis_request.RedisRequestOuterClass.Transaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction buildPartial() { + redis_request.RedisRequestOuterClass.Transaction result = + new redis_request.RedisRequestOuterClass.Transaction(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + redis_request.RedisRequestOuterClass.Transaction result) { + if (commandsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + commands_ = java.util.Collections.unmodifiableList(commands_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.commands_ = commands_; + } else { + result.commands_ = commandsBuilder_.build(); + } + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.Transaction result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.Transaction) { + return mergeFrom((redis_request.RedisRequestOuterClass.Transaction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.Transaction other) { + if (other == redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance()) + return this; + if (commandsBuilder_ == null) { + if (!other.commands_.isEmpty()) { + if (commands_.isEmpty()) { + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCommandsIsMutable(); + commands_.addAll(other.commands_); + } + onChanged(); + } + } else { + if (!other.commands_.isEmpty()) { + if (commandsBuilder_.isEmpty()) { + commandsBuilder_.dispose(); + commandsBuilder_ = null; + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000001); + commandsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCommandsFieldBuilder() + : null; + } else { + commandsBuilder_.addAllMessages(other.commands_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + redis_request.RedisRequestOuterClass.Command m = + input.readMessage( + redis_request.RedisRequestOuterClass.Command.parser(), extensionRegistry); + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.add(m); + } else { + commandsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List commands_ = + java.util.Collections.emptyList(); + + private void ensureCommandsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + commands_ = + new java.util.ArrayList(commands_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder> + commandsBuilder_; + + /** repeated .redis_request.Command commands = 1; */ + public java.util.List getCommandsList() { + if (commandsBuilder_ == null) { + return java.util.Collections.unmodifiableList(commands_); + } else { + return commandsBuilder_.getMessageList(); + } + } + + /** repeated .redis_request.Command commands = 1; */ + public int getCommandsCount() { + if (commandsBuilder_ == null) { + return commands_.size(); + } else { + return commandsBuilder_.getCount(); + } + } + + /** repeated .redis_request.Command commands = 1; */ + public redis_request.RedisRequestOuterClass.Command getCommands(int index) { + if (commandsBuilder_ == null) { + return commands_.get(index); + } else { + return commandsBuilder_.getMessage(index); + } + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder setCommands(int index, redis_request.RedisRequestOuterClass.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.set(index, value); + onChanged(); + } else { + commandsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder setCommands( + int index, redis_request.RedisRequestOuterClass.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.set(index, builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder addCommands(redis_request.RedisRequestOuterClass.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.add(value); + onChanged(); + } else { + commandsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder addCommands(int index, redis_request.RedisRequestOuterClass.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.add(index, value); + onChanged(); + } else { + commandsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder addCommands( + redis_request.RedisRequestOuterClass.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.add(builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder addCommands( + int index, redis_request.RedisRequestOuterClass.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.add(index, builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder addAllCommands( + java.lang.Iterable values) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, commands_); + onChanged(); + } else { + commandsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder clearCommands() { + if (commandsBuilder_ == null) { + commands_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + commandsBuilder_.clear(); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public Builder removeCommands(int index) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.remove(index); + onChanged(); + } else { + commandsBuilder_.remove(index); + } + return this; + } + + /** repeated .redis_request.Command commands = 1; */ + public redis_request.RedisRequestOuterClass.Command.Builder getCommandsBuilder(int index) { + return getCommandsFieldBuilder().getBuilder(index); + } + + /** repeated .redis_request.Command commands = 1; */ + public redis_request.RedisRequestOuterClass.CommandOrBuilder getCommandsOrBuilder(int index) { + if (commandsBuilder_ == null) { + return commands_.get(index); + } else { + return commandsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .redis_request.Command commands = 1; */ + public java.util.List + getCommandsOrBuilderList() { + if (commandsBuilder_ != null) { + return commandsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(commands_); + } + } + + /** repeated .redis_request.Command commands = 1; */ + public redis_request.RedisRequestOuterClass.Command.Builder addCommandsBuilder() { + return getCommandsFieldBuilder() + .addBuilder(redis_request.RedisRequestOuterClass.Command.getDefaultInstance()); + } + + /** repeated .redis_request.Command commands = 1; */ + public redis_request.RedisRequestOuterClass.Command.Builder addCommandsBuilder(int index) { + return getCommandsFieldBuilder() + .addBuilder(index, redis_request.RedisRequestOuterClass.Command.getDefaultInstance()); + } + + /** repeated .redis_request.Command commands = 1; */ + public java.util.List + getCommandsBuilderList() { + return getCommandsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder> + getCommandsFieldBuilder() { + if (commandsBuilder_ == null) { + commandsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder>( + commands_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + commands_ = null; + } + return commandsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.Transaction) + } + + // @@protoc_insertion_point(class_scope:redis_request.Transaction) + private static final redis_request.RedisRequestOuterClass.Transaction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.Transaction(); + } + + public static redis_request.RedisRequestOuterClass.Transaction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RedisRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:redis_request.RedisRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + int getCallbackIdx(); + + /** + * .redis_request.Command single_command = 2; + * + * @return Whether the singleCommand field is set. + */ + boolean hasSingleCommand(); + + /** + * .redis_request.Command single_command = 2; + * + * @return The singleCommand. + */ + redis_request.RedisRequestOuterClass.Command getSingleCommand(); + + /** .redis_request.Command single_command = 2; */ + redis_request.RedisRequestOuterClass.CommandOrBuilder getSingleCommandOrBuilder(); + + /** + * .redis_request.Transaction transaction = 3; + * + * @return Whether the transaction field is set. + */ + boolean hasTransaction(); + + /** + * .redis_request.Transaction transaction = 3; + * + * @return The transaction. + */ + redis_request.RedisRequestOuterClass.Transaction getTransaction(); + + /** .redis_request.Transaction transaction = 3; */ + redis_request.RedisRequestOuterClass.TransactionOrBuilder getTransactionOrBuilder(); + + /** + * .redis_request.Routes route = 4; + * + * @return Whether the route field is set. + */ + boolean hasRoute(); + + /** + * .redis_request.Routes route = 4; + * + * @return The route. + */ + redis_request.RedisRequestOuterClass.Routes getRoute(); + + /** .redis_request.Routes route = 4; */ + redis_request.RedisRequestOuterClass.RoutesOrBuilder getRouteOrBuilder(); + + redis_request.RedisRequestOuterClass.RedisRequest.CommandCase getCommandCase(); + } + + /** Protobuf type {@code redis_request.RedisRequest} */ + public static final class RedisRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:redis_request.RedisRequest) + RedisRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RedisRequest.newBuilder() to construct. + private RedisRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RedisRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RedisRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_RedisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_RedisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.RedisRequest.class, + redis_request.RedisRequestOuterClass.RedisRequest.Builder.class); + } + + private int commandCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object command_; + + public enum CommandCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SINGLE_COMMAND(2), + TRANSACTION(3), + COMMAND_NOT_SET(0); + private final int value; + + private CommandCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CommandCase valueOf(int value) { + return forNumber(value); + } + + public static CommandCase forNumber(int value) { + switch (value) { + case 2: + return SINGLE_COMMAND; + case 3: + return TRANSACTION; + case 0: + return COMMAND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CommandCase getCommandCase() { + return CommandCase.forNumber(commandCase_); + } + + public static final int CALLBACK_IDX_FIELD_NUMBER = 1; + private int callbackIdx_ = 0; + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + @java.lang.Override + public int getCallbackIdx() { + return callbackIdx_; + } + + public static final int SINGLE_COMMAND_FIELD_NUMBER = 2; + + /** + * .redis_request.Command single_command = 2; + * + * @return Whether the singleCommand field is set. + */ + @java.lang.Override + public boolean hasSingleCommand() { + return commandCase_ == 2; + } + + /** + * .redis_request.Command single_command = 2; + * + * @return The singleCommand. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command getSingleCommand() { + if (commandCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command) command_; + } + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + + /** .redis_request.Command single_command = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.CommandOrBuilder getSingleCommandOrBuilder() { + if (commandCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command) command_; + } + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + + public static final int TRANSACTION_FIELD_NUMBER = 3; + + /** + * .redis_request.Transaction transaction = 3; + * + * @return Whether the transaction field is set. + */ + @java.lang.Override + public boolean hasTransaction() { + return commandCase_ == 3; + } + + /** + * .redis_request.Transaction transaction = 3; + * + * @return The transaction. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction getTransaction() { + if (commandCase_ == 3) { + return (redis_request.RedisRequestOuterClass.Transaction) command_; + } + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + + /** .redis_request.Transaction transaction = 3; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.TransactionOrBuilder getTransactionOrBuilder() { + if (commandCase_ == 3) { + return (redis_request.RedisRequestOuterClass.Transaction) command_; + } + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + + public static final int ROUTE_FIELD_NUMBER = 4; + private redis_request.RedisRequestOuterClass.Routes route_; + + /** + * .redis_request.Routes route = 4; + * + * @return Whether the route field is set. + */ + @java.lang.Override + public boolean hasRoute() { + return route_ != null; + } + + /** + * .redis_request.Routes route = 4; + * + * @return The route. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Routes getRoute() { + return route_ == null + ? redis_request.RedisRequestOuterClass.Routes.getDefaultInstance() + : route_; + } + + /** .redis_request.Routes route = 4; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.RoutesOrBuilder getRouteOrBuilder() { + return route_ == null + ? redis_request.RedisRequestOuterClass.Routes.getDefaultInstance() + : route_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (callbackIdx_ != 0) { + output.writeUInt32(1, callbackIdx_); + } + if (commandCase_ == 2) { + output.writeMessage(2, (redis_request.RedisRequestOuterClass.Command) command_); + } + if (commandCase_ == 3) { + output.writeMessage(3, (redis_request.RedisRequestOuterClass.Transaction) command_); + } + if (route_ != null) { + output.writeMessage(4, getRoute()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (callbackIdx_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(1, callbackIdx_); + } + if (commandCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (redis_request.RedisRequestOuterClass.Command) command_); + } + if (commandCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (redis_request.RedisRequestOuterClass.Transaction) command_); + } + if (route_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRoute()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof redis_request.RedisRequestOuterClass.RedisRequest)) { + return super.equals(obj); + } + redis_request.RedisRequestOuterClass.RedisRequest other = + (redis_request.RedisRequestOuterClass.RedisRequest) obj; + + if (getCallbackIdx() != other.getCallbackIdx()) return false; + if (hasRoute() != other.hasRoute()) return false; + if (hasRoute()) { + if (!getRoute().equals(other.getRoute())) return false; + } + if (!getCommandCase().equals(other.getCommandCase())) return false; + switch (commandCase_) { + case 2: + if (!getSingleCommand().equals(other.getSingleCommand())) return false; + break; + case 3: + if (!getTransaction().equals(other.getTransaction())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CALLBACK_IDX_FIELD_NUMBER; + hash = (53 * hash) + getCallbackIdx(); + if (hasRoute()) { + hash = (37 * hash) + ROUTE_FIELD_NUMBER; + hash = (53 * hash) + getRoute().hashCode(); + } + switch (commandCase_) { + case 2: + hash = (37 * hash) + SINGLE_COMMAND_FIELD_NUMBER; + hash = (53 * hash) + getSingleCommand().hashCode(); + break; + case 3: + hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; + hash = (53 * hash) + getTransaction().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(redis_request.RedisRequestOuterClass.RedisRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code redis_request.RedisRequest} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:redis_request.RedisRequest) + redis_request.RedisRequestOuterClass.RedisRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_RedisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_RedisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + redis_request.RedisRequestOuterClass.RedisRequest.class, + redis_request.RedisRequestOuterClass.RedisRequest.Builder.class); + } + + // Construct using redis_request.RedisRequestOuterClass.RedisRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + callbackIdx_ = 0; + if (singleCommandBuilder_ != null) { + singleCommandBuilder_.clear(); + } + if (transactionBuilder_ != null) { + transactionBuilder_.clear(); + } + route_ = null; + if (routeBuilder_ != null) { + routeBuilder_.dispose(); + routeBuilder_ = null; + } + commandCase_ = 0; + command_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return redis_request.RedisRequestOuterClass + .internal_static_redis_request_RedisRequest_descriptor; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.RedisRequest getDefaultInstanceForType() { + return redis_request.RedisRequestOuterClass.RedisRequest.getDefaultInstance(); + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.RedisRequest build() { + redis_request.RedisRequestOuterClass.RedisRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.RedisRequest buildPartial() { + redis_request.RedisRequestOuterClass.RedisRequest result = + new redis_request.RedisRequestOuterClass.RedisRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(redis_request.RedisRequestOuterClass.RedisRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.callbackIdx_ = callbackIdx_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.route_ = routeBuilder_ == null ? route_ : routeBuilder_.build(); + } + } + + private void buildPartialOneofs(redis_request.RedisRequestOuterClass.RedisRequest result) { + result.commandCase_ = commandCase_; + result.command_ = this.command_; + if (commandCase_ == 2 && singleCommandBuilder_ != null) { + result.command_ = singleCommandBuilder_.build(); + } + if (commandCase_ == 3 && transactionBuilder_ != null) { + result.command_ = transactionBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof redis_request.RedisRequestOuterClass.RedisRequest) { + return mergeFrom((redis_request.RedisRequestOuterClass.RedisRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(redis_request.RedisRequestOuterClass.RedisRequest other) { + if (other == redis_request.RedisRequestOuterClass.RedisRequest.getDefaultInstance()) + return this; + if (other.getCallbackIdx() != 0) { + setCallbackIdx(other.getCallbackIdx()); + } + if (other.hasRoute()) { + mergeRoute(other.getRoute()); + } + switch (other.getCommandCase()) { + case SINGLE_COMMAND: + { + mergeSingleCommand(other.getSingleCommand()); + break; + } + case TRANSACTION: + { + mergeTransaction(other.getTransaction()); + break; + } + case COMMAND_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + callbackIdx_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getSingleCommandFieldBuilder().getBuilder(), extensionRegistry); + commandCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getTransactionFieldBuilder().getBuilder(), extensionRegistry); + commandCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getRouteFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int commandCase_ = 0; + private java.lang.Object command_; + + public CommandCase getCommandCase() { + return CommandCase.forNumber(commandCase_); + } + + public Builder clearCommand() { + commandCase_ = 0; + command_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int callbackIdx_; + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + @java.lang.Override + public int getCallbackIdx() { + return callbackIdx_; + } + + /** + * uint32 callback_idx = 1; + * + * @param value The callbackIdx to set. + * @return This builder for chaining. + */ + public Builder setCallbackIdx(int value) { + + callbackIdx_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * uint32 callback_idx = 1; + * + * @return This builder for chaining. + */ + public Builder clearCallbackIdx() { + bitField0_ = (bitField0_ & ~0x00000001); + callbackIdx_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder> + singleCommandBuilder_; + + /** + * .redis_request.Command single_command = 2; + * + * @return Whether the singleCommand field is set. + */ + @java.lang.Override + public boolean hasSingleCommand() { + return commandCase_ == 2; + } + + /** + * .redis_request.Command single_command = 2; + * + * @return The singleCommand. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Command getSingleCommand() { + if (singleCommandBuilder_ == null) { + if (commandCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command) command_; + } + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } else { + if (commandCase_ == 2) { + return singleCommandBuilder_.getMessage(); + } + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + } + + /** .redis_request.Command single_command = 2; */ + public Builder setSingleCommand(redis_request.RedisRequestOuterClass.Command value) { + if (singleCommandBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + command_ = value; + onChanged(); + } else { + singleCommandBuilder_.setMessage(value); + } + commandCase_ = 2; + return this; + } + + /** .redis_request.Command single_command = 2; */ + public Builder setSingleCommand( + redis_request.RedisRequestOuterClass.Command.Builder builderForValue) { + if (singleCommandBuilder_ == null) { + command_ = builderForValue.build(); + onChanged(); + } else { + singleCommandBuilder_.setMessage(builderForValue.build()); + } + commandCase_ = 2; + return this; + } + + /** .redis_request.Command single_command = 2; */ + public Builder mergeSingleCommand(redis_request.RedisRequestOuterClass.Command value) { + if (singleCommandBuilder_ == null) { + if (commandCase_ == 2 + && command_ != redis_request.RedisRequestOuterClass.Command.getDefaultInstance()) { + command_ = + redis_request.RedisRequestOuterClass.Command.newBuilder( + (redis_request.RedisRequestOuterClass.Command) command_) + .mergeFrom(value) + .buildPartial(); + } else { + command_ = value; + } + onChanged(); + } else { + if (commandCase_ == 2) { + singleCommandBuilder_.mergeFrom(value); + } else { + singleCommandBuilder_.setMessage(value); + } + } + commandCase_ = 2; + return this; + } + + /** .redis_request.Command single_command = 2; */ + public Builder clearSingleCommand() { + if (singleCommandBuilder_ == null) { + if (commandCase_ == 2) { + commandCase_ = 0; + command_ = null; + onChanged(); + } + } else { + if (commandCase_ == 2) { + commandCase_ = 0; + command_ = null; + } + singleCommandBuilder_.clear(); + } + return this; + } + + /** .redis_request.Command single_command = 2; */ + public redis_request.RedisRequestOuterClass.Command.Builder getSingleCommandBuilder() { + return getSingleCommandFieldBuilder().getBuilder(); + } + + /** .redis_request.Command single_command = 2; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.CommandOrBuilder getSingleCommandOrBuilder() { + if ((commandCase_ == 2) && (singleCommandBuilder_ != null)) { + return singleCommandBuilder_.getMessageOrBuilder(); + } else { + if (commandCase_ == 2) { + return (redis_request.RedisRequestOuterClass.Command) command_; + } + return redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + } + + /** .redis_request.Command single_command = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder> + getSingleCommandFieldBuilder() { + if (singleCommandBuilder_ == null) { + if (!(commandCase_ == 2)) { + command_ = redis_request.RedisRequestOuterClass.Command.getDefaultInstance(); + } + singleCommandBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Command, + redis_request.RedisRequestOuterClass.Command.Builder, + redis_request.RedisRequestOuterClass.CommandOrBuilder>( + (redis_request.RedisRequestOuterClass.Command) command_, + getParentForChildren(), + isClean()); + command_ = null; + } + commandCase_ = 2; + onChanged(); + return singleCommandBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Transaction, + redis_request.RedisRequestOuterClass.Transaction.Builder, + redis_request.RedisRequestOuterClass.TransactionOrBuilder> + transactionBuilder_; + + /** + * .redis_request.Transaction transaction = 3; + * + * @return Whether the transaction field is set. + */ + @java.lang.Override + public boolean hasTransaction() { + return commandCase_ == 3; + } + + /** + * .redis_request.Transaction transaction = 3; + * + * @return The transaction. + */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.Transaction getTransaction() { + if (transactionBuilder_ == null) { + if (commandCase_ == 3) { + return (redis_request.RedisRequestOuterClass.Transaction) command_; + } + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } else { + if (commandCase_ == 3) { + return transactionBuilder_.getMessage(); + } + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + } + + /** .redis_request.Transaction transaction = 3; */ + public Builder setTransaction(redis_request.RedisRequestOuterClass.Transaction value) { + if (transactionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + command_ = value; + onChanged(); + } else { + transactionBuilder_.setMessage(value); + } + commandCase_ = 3; + return this; + } + + /** .redis_request.Transaction transaction = 3; */ + public Builder setTransaction( + redis_request.RedisRequestOuterClass.Transaction.Builder builderForValue) { + if (transactionBuilder_ == null) { + command_ = builderForValue.build(); + onChanged(); + } else { + transactionBuilder_.setMessage(builderForValue.build()); + } + commandCase_ = 3; + return this; + } + + /** .redis_request.Transaction transaction = 3; */ + public Builder mergeTransaction(redis_request.RedisRequestOuterClass.Transaction value) { + if (transactionBuilder_ == null) { + if (commandCase_ == 3 + && command_ + != redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance()) { + command_ = + redis_request.RedisRequestOuterClass.Transaction.newBuilder( + (redis_request.RedisRequestOuterClass.Transaction) command_) + .mergeFrom(value) + .buildPartial(); + } else { + command_ = value; + } + onChanged(); + } else { + if (commandCase_ == 3) { + transactionBuilder_.mergeFrom(value); + } else { + transactionBuilder_.setMessage(value); + } + } + commandCase_ = 3; + return this; + } + + /** .redis_request.Transaction transaction = 3; */ + public Builder clearTransaction() { + if (transactionBuilder_ == null) { + if (commandCase_ == 3) { + commandCase_ = 0; + command_ = null; + onChanged(); + } + } else { + if (commandCase_ == 3) { + commandCase_ = 0; + command_ = null; + } + transactionBuilder_.clear(); + } + return this; + } + + /** .redis_request.Transaction transaction = 3; */ + public redis_request.RedisRequestOuterClass.Transaction.Builder getTransactionBuilder() { + return getTransactionFieldBuilder().getBuilder(); + } + + /** .redis_request.Transaction transaction = 3; */ + @java.lang.Override + public redis_request.RedisRequestOuterClass.TransactionOrBuilder getTransactionOrBuilder() { + if ((commandCase_ == 3) && (transactionBuilder_ != null)) { + return transactionBuilder_.getMessageOrBuilder(); + } else { + if (commandCase_ == 3) { + return (redis_request.RedisRequestOuterClass.Transaction) command_; + } + return redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + } + + /** .redis_request.Transaction transaction = 3; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Transaction, + redis_request.RedisRequestOuterClass.Transaction.Builder, + redis_request.RedisRequestOuterClass.TransactionOrBuilder> + getTransactionFieldBuilder() { + if (transactionBuilder_ == null) { + if (!(commandCase_ == 3)) { + command_ = redis_request.RedisRequestOuterClass.Transaction.getDefaultInstance(); + } + transactionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Transaction, + redis_request.RedisRequestOuterClass.Transaction.Builder, + redis_request.RedisRequestOuterClass.TransactionOrBuilder>( + (redis_request.RedisRequestOuterClass.Transaction) command_, + getParentForChildren(), + isClean()); + command_ = null; + } + commandCase_ = 3; + onChanged(); + return transactionBuilder_; + } + + private redis_request.RedisRequestOuterClass.Routes route_; + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Routes, + redis_request.RedisRequestOuterClass.Routes.Builder, + redis_request.RedisRequestOuterClass.RoutesOrBuilder> + routeBuilder_; + + /** + * .redis_request.Routes route = 4; + * + * @return Whether the route field is set. + */ + public boolean hasRoute() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .redis_request.Routes route = 4; + * + * @return The route. + */ + public redis_request.RedisRequestOuterClass.Routes getRoute() { + if (routeBuilder_ == null) { + return route_ == null + ? redis_request.RedisRequestOuterClass.Routes.getDefaultInstance() + : route_; + } else { + return routeBuilder_.getMessage(); + } + } + + /** .redis_request.Routes route = 4; */ + public Builder setRoute(redis_request.RedisRequestOuterClass.Routes value) { + if (routeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + route_ = value; + } else { + routeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .redis_request.Routes route = 4; */ + public Builder setRoute(redis_request.RedisRequestOuterClass.Routes.Builder builderForValue) { + if (routeBuilder_ == null) { + route_ = builderForValue.build(); + } else { + routeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .redis_request.Routes route = 4; */ + public Builder mergeRoute(redis_request.RedisRequestOuterClass.Routes value) { + if (routeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && route_ != null + && route_ != redis_request.RedisRequestOuterClass.Routes.getDefaultInstance()) { + getRouteBuilder().mergeFrom(value); + } else { + route_ = value; + } + } else { + routeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .redis_request.Routes route = 4; */ + public Builder clearRoute() { + bitField0_ = (bitField0_ & ~0x00000008); + route_ = null; + if (routeBuilder_ != null) { + routeBuilder_.dispose(); + routeBuilder_ = null; + } + onChanged(); + return this; + } + + /** .redis_request.Routes route = 4; */ + public redis_request.RedisRequestOuterClass.Routes.Builder getRouteBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRouteFieldBuilder().getBuilder(); + } + + /** .redis_request.Routes route = 4; */ + public redis_request.RedisRequestOuterClass.RoutesOrBuilder getRouteOrBuilder() { + if (routeBuilder_ != null) { + return routeBuilder_.getMessageOrBuilder(); + } else { + return route_ == null + ? redis_request.RedisRequestOuterClass.Routes.getDefaultInstance() + : route_; + } + } + + /** .redis_request.Routes route = 4; */ + private com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Routes, + redis_request.RedisRequestOuterClass.Routes.Builder, + redis_request.RedisRequestOuterClass.RoutesOrBuilder> + getRouteFieldBuilder() { + if (routeBuilder_ == null) { + routeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + redis_request.RedisRequestOuterClass.Routes, + redis_request.RedisRequestOuterClass.Routes.Builder, + redis_request.RedisRequestOuterClass.RoutesOrBuilder>( + getRoute(), getParentForChildren(), isClean()); + route_ = null; + } + return routeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:redis_request.RedisRequest) + } + + // @@protoc_insertion_point(class_scope:redis_request.RedisRequest) + private static final redis_request.RedisRequestOuterClass.RedisRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new redis_request.RedisRequestOuterClass.RedisRequest(); + } + + public static redis_request.RedisRequestOuterClass.RedisRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RedisRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public redis_request.RedisRequestOuterClass.RedisRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_SlotIdRoute_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_SlotIdRoute_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_SlotKeyRoute_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_SlotKeyRoute_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_Routes_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_Routes_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_Command_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_Command_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_Command_ArgsArray_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_Command_ArgsArray_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_Transaction_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_Transaction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_redis_request_RedisRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_redis_request_RedisRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "\023redis_request.proto\022\r" + + "redis_request\"K\n" + + "\013SlotIdRoute\022+\n" + + "\tslot_type\030\001 \001(\0162\030.redis_request.SlotTypes\022\017\n" + + "\007slot_id\030\002 \001(\005\"M\n" + + "\014SlotKeyRoute\022+\n" + + "\tslot_type\030\001 \001(\0162\030.redis_request.SlotTypes\022\020\n" + + "\010slot_key\030\002 \001(\t\"\263\001\n" + + "\006Routes\0224\n\r" + + "simple_routes\030\001 \001(\0162\033.redis_request.SimpleRoutesH\000\0225\n" + + "\016slot_key_route\030\002 \001(\0132\033.redis_request.SlotKeyRouteH\000\0223\n\r" + + "slot_id_route\030\003 \001(\0132\032.redis_request.SlotIdRouteH\000B\007\n" + + "\005value\"\262\001\n" + + "\007Command\0220\n" + + "\014request_type\030\001 \001(\0162\032.redis_request.RequestType\0226\n\n" + + "args_array\030\002 \001(\0132 .redis_request.Command.ArgsArrayH\000\022\032\n" + + "\020args_vec_pointer\030\003 \001(\004H\000\032\031\n" + + "\tArgsArray\022\014\n" + + "\004args\030\001 \003(\tB\006\n" + + "\004args\"7\n" + + "\013Transaction\022(\n" + + "\010commands\030\001 \003(\0132\026.redis_request.Command\"\272\001\n" + + "\014RedisRequest\022\024\n" + + "\014callback_idx\030\001 \001(\r" + + "\0220\n" + + "\016single_command\030\002 \001(\0132\026.redis_request.CommandH\000\0221\n" + + "\013transaction\030\003 \001(\0132\032.redis_request.TransactionH\000\022$\n" + + "\005route\030\004 \001(\0132\025.redis_request.RoutesB\t\n" + + "\007command*:\n" + + "\014SimpleRoutes\022\014\n" + + "\010AllNodes\020\000\022\020\n" + + "\014AllPrimaries\020\001\022\n\n" + + "\006Random\020\002*%\n" + + "\tSlotTypes\022\013\n" + + "\007Primary\020\000\022\013\n" + + "\007Replica\020\001*\316\004\n" + + "\013RequestType\022\022\n" + + "\016InvalidRequest\020\000\022\021\n\r" + + "CustomCommand\020\001\022\r\n" + + "\tGetString\020\002\022\r\n" + + "\tSetString\020\003\022\010\n" + + "\004Ping\020\004\022\010\n" + + "\004Info\020\005\022\007\n" + + "\003Del\020\006\022\n\n" + + "\006Select\020\007\022\r\n" + + "\tConfigGet\020\010\022\r\n" + + "\tConfigSet\020\t\022\023\n" + + "\017ConfigResetStat\020\n" + + "\022\021\n" + + "\r" + + "ConfigRewrite\020\013\022\021\n\r" + + "ClientGetName\020\014\022\022\n" + + "\016ClientGetRedir\020\r" + + "\022\014\n" + + "\010ClientId\020\016\022\016\n\n" + + "ClientInfo\020\017\022\016\n\n" + + "ClientKill\020\020\022\016\n\n" + + "ClientList\020\021\022\021\n" + + "\r" + + "ClientNoEvict\020\022\022\021\n\r" + + "ClientNoTouch\020\023\022\017\n" + + "\013ClientPause\020\024\022\017\n" + + "\013ClientReply\020\025\022\021\n\r" + + "ClientSetInfo\020\026\022\021\n\r" + + "ClientSetName\020\027\022\021\n\r" + + "ClientUnblock\020\030\022\021\n\r" + + "ClientUnpause\020\031\022\n\n" + + "\006Expire\020\032\022\013\n" + + "\007HashSet\020\033\022\013\n" + + "\007HashGet\020\034\022\013\n" + + "\007HashDel\020\035\022\016\n\n" + + "HashExists\020\036\022\010\n" + + "\004MGet\020\037\022\010\n" + + "\004MSet\020 \022\010\n" + + "\004Incr\020!\022\n\n" + + "\006IncrBy\020\"\022\010\n" + + "\004Decr\020#\022\017\n" + + "\013IncrByFloat\020$\022\n\n" + + "\006DecrBy\020%b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_redis_request_SlotIdRoute_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_redis_request_SlotIdRoute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_SlotIdRoute_descriptor, + new java.lang.String[] { + "SlotType", "SlotId", + }); + internal_static_redis_request_SlotKeyRoute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_redis_request_SlotKeyRoute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_SlotKeyRoute_descriptor, + new java.lang.String[] { + "SlotType", "SlotKey", + }); + internal_static_redis_request_Routes_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_redis_request_Routes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_Routes_descriptor, + new java.lang.String[] { + "SimpleRoutes", "SlotKeyRoute", "SlotIdRoute", "Value", + }); + internal_static_redis_request_Command_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_redis_request_Command_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_Command_descriptor, + new java.lang.String[] { + "RequestType", "ArgsArray", "ArgsVecPointer", "Args", + }); + internal_static_redis_request_Command_ArgsArray_descriptor = + internal_static_redis_request_Command_descriptor.getNestedTypes().get(0); + internal_static_redis_request_Command_ArgsArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_Command_ArgsArray_descriptor, + new java.lang.String[] { + "Args", + }); + internal_static_redis_request_Transaction_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_redis_request_Transaction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_Transaction_descriptor, + new java.lang.String[] { + "Commands", + }); + internal_static_redis_request_RedisRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_redis_request_RedisRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_redis_request_RedisRequest_descriptor, + new java.lang.String[] { + "CallbackIdx", "SingleCommand", "Transaction", "Route", "Command", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/ResponseOuterClass.java b/java/benchmarks/src/main/java/javababushka/benchmarks/ResponseOuterClass.java new file mode 100644 index 0000000000..d94678db3f --- /dev/null +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/ResponseOuterClass.java @@ -0,0 +1,2283 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: response.proto + +package response; + +public final class ResponseOuterClass { + private ResponseOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** Protobuf enum {@code response.RequestErrorType} */ + public enum RequestErrorType implements com.google.protobuf.ProtocolMessageEnum { + /** Unspecified = 0; */ + Unspecified(0), + /** ExecAbort = 1; */ + ExecAbort(1), + /** Timeout = 2; */ + Timeout(2), + /** Disconnect = 3; */ + Disconnect(3), + UNRECOGNIZED(-1), + ; + + /** Unspecified = 0; */ + public static final int Unspecified_VALUE = 0; + + /** ExecAbort = 1; */ + public static final int ExecAbort_VALUE = 1; + + /** Timeout = 2; */ + public static final int Timeout_VALUE = 2; + + /** Disconnect = 3; */ + public static final int Disconnect_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestErrorType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequestErrorType forNumber(int value) { + switch (value) { + case 0: + return Unspecified; + case 1: + return ExecAbort; + case 2: + return Timeout; + case 3: + return Disconnect; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequestErrorType findValueByNumber(int number) { + return RequestErrorType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return response.ResponseOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final RequestErrorType[] VALUES = values(); + + public static RequestErrorType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RequestErrorType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:response.RequestErrorType) + } + + /** Protobuf enum {@code response.ConstantResponse} */ + public enum ConstantResponse implements com.google.protobuf.ProtocolMessageEnum { + /** OK = 0; */ + OK(0), + UNRECOGNIZED(-1), + ; + + /** OK = 0; */ + public static final int OK_VALUE = 0; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConstantResponse valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ConstantResponse forNumber(int value) { + switch (value) { + case 0: + return OK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ConstantResponse findValueByNumber(int number) { + return ConstantResponse.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return response.ResponseOuterClass.getDescriptor().getEnumTypes().get(1); + } + + private static final ConstantResponse[] VALUES = values(); + + public static ConstantResponse valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ConstantResponse(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:response.ConstantResponse) + } + + public interface RequestErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:response.RequestError) + com.google.protobuf.MessageOrBuilder { + + /** + * .response.RequestErrorType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * .response.RequestErrorType type = 1; + * + * @return The type. + */ + response.ResponseOuterClass.RequestErrorType getType(); + + /** + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + } + + /** Protobuf type {@code response.RequestError} */ + public static final class RequestError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:response.RequestError) + RequestErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RequestError.newBuilder() to construct. + private RequestError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RequestError() { + type_ = 0; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RequestError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return response.ResponseOuterClass.internal_static_response_RequestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return response.ResponseOuterClass.internal_static_response_RequestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + response.ResponseOuterClass.RequestError.class, + response.ResponseOuterClass.RequestError.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * .response.RequestErrorType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * .response.RequestErrorType type = 1; + * + * @return The type. + */ + @java.lang.Override + public response.ResponseOuterClass.RequestErrorType getType() { + response.ResponseOuterClass.RequestErrorType result = + response.ResponseOuterClass.RequestErrorType.forNumber(type_); + return result == null ? response.ResponseOuterClass.RequestErrorType.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + + /** + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != response.ResponseOuterClass.RequestErrorType.Unspecified.getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != response.ResponseOuterClass.RequestErrorType.Unspecified.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof response.ResponseOuterClass.RequestError)) { + return super.equals(obj); + } + response.ResponseOuterClass.RequestError other = + (response.ResponseOuterClass.RequestError) obj; + + if (type_ != other.type_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static response.ResponseOuterClass.RequestError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.RequestError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.RequestError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static response.ResponseOuterClass.RequestError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.RequestError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.RequestError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(response.ResponseOuterClass.RequestError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code response.RequestError} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:response.RequestError) + response.ResponseOuterClass.RequestErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return response.ResponseOuterClass.internal_static_response_RequestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return response.ResponseOuterClass.internal_static_response_RequestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + response.ResponseOuterClass.RequestError.class, + response.ResponseOuterClass.RequestError.Builder.class); + } + + // Construct using response.ResponseOuterClass.RequestError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return response.ResponseOuterClass.internal_static_response_RequestError_descriptor; + } + + @java.lang.Override + public response.ResponseOuterClass.RequestError getDefaultInstanceForType() { + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + + @java.lang.Override + public response.ResponseOuterClass.RequestError build() { + response.ResponseOuterClass.RequestError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public response.ResponseOuterClass.RequestError buildPartial() { + response.ResponseOuterClass.RequestError result = + new response.ResponseOuterClass.RequestError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(response.ResponseOuterClass.RequestError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof response.ResponseOuterClass.RequestError) { + return mergeFrom((response.ResponseOuterClass.RequestError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(response.ResponseOuterClass.RequestError other) { + if (other == response.ResponseOuterClass.RequestError.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + + /** + * .response.RequestErrorType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * .response.RequestErrorType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .response.RequestErrorType type = 1; + * + * @return The type. + */ + @java.lang.Override + public response.ResponseOuterClass.RequestErrorType getType() { + response.ResponseOuterClass.RequestErrorType result = + response.ResponseOuterClass.RequestErrorType.forNumber(type_); + return result == null ? response.ResponseOuterClass.RequestErrorType.UNRECOGNIZED : result; + } + + /** + * .response.RequestErrorType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(response.ResponseOuterClass.RequestErrorType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .response.RequestErrorType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:response.RequestError) + } + + // @@protoc_insertion_point(class_scope:response.RequestError) + private static final response.ResponseOuterClass.RequestError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new response.ResponseOuterClass.RequestError(); + } + + public static response.ResponseOuterClass.RequestError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public response.ResponseOuterClass.RequestError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:response.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + int getCallbackIdx(); + + /** + * uint64 resp_pointer = 2; + * + * @return Whether the respPointer field is set. + */ + boolean hasRespPointer(); + + /** + * uint64 resp_pointer = 2; + * + * @return The respPointer. + */ + long getRespPointer(); + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return Whether the constantResponse field is set. + */ + boolean hasConstantResponse(); + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The enum numeric value on the wire for constantResponse. + */ + int getConstantResponseValue(); + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The constantResponse. + */ + response.ResponseOuterClass.ConstantResponse getConstantResponse(); + + /** + * .response.RequestError request_error = 4; + * + * @return Whether the requestError field is set. + */ + boolean hasRequestError(); + + /** + * .response.RequestError request_error = 4; + * + * @return The requestError. + */ + response.ResponseOuterClass.RequestError getRequestError(); + + /** .response.RequestError request_error = 4; */ + response.ResponseOuterClass.RequestErrorOrBuilder getRequestErrorOrBuilder(); + + /** + * string closing_error = 5; + * + * @return Whether the closingError field is set. + */ + boolean hasClosingError(); + + /** + * string closing_error = 5; + * + * @return The closingError. + */ + java.lang.String getClosingError(); + + /** + * string closing_error = 5; + * + * @return The bytes for closingError. + */ + com.google.protobuf.ByteString getClosingErrorBytes(); + + response.ResponseOuterClass.Response.ValueCase getValueCase(); + } + + /** Protobuf type {@code response.Response} */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:response.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Response() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Response(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return response.ResponseOuterClass.internal_static_response_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return response.ResponseOuterClass.internal_static_response_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + response.ResponseOuterClass.Response.class, + response.ResponseOuterClass.Response.Builder.class); + } + + private int valueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object value_; + + public enum ValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RESP_POINTER(2), + CONSTANT_RESPONSE(3), + REQUEST_ERROR(4), + CLOSING_ERROR(5), + VALUE_NOT_SET(0); + private final int value; + + private ValueCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 2: + return RESP_POINTER; + case 3: + return CONSTANT_RESPONSE; + case 4: + return REQUEST_ERROR; + case 5: + return CLOSING_ERROR; + case 0: + return VALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public static final int CALLBACK_IDX_FIELD_NUMBER = 1; + private int callbackIdx_ = 0; + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + @java.lang.Override + public int getCallbackIdx() { + return callbackIdx_; + } + + public static final int RESP_POINTER_FIELD_NUMBER = 2; + + /** + * uint64 resp_pointer = 2; + * + * @return Whether the respPointer field is set. + */ + @java.lang.Override + public boolean hasRespPointer() { + return valueCase_ == 2; + } + + /** + * uint64 resp_pointer = 2; + * + * @return The respPointer. + */ + @java.lang.Override + public long getRespPointer() { + if (valueCase_ == 2) { + return (java.lang.Long) value_; + } + return 0L; + } + + public static final int CONSTANT_RESPONSE_FIELD_NUMBER = 3; + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return Whether the constantResponse field is set. + */ + public boolean hasConstantResponse() { + return valueCase_ == 3; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The enum numeric value on the wire for constantResponse. + */ + public int getConstantResponseValue() { + if (valueCase_ == 3) { + return (java.lang.Integer) value_; + } + return 0; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The constantResponse. + */ + public response.ResponseOuterClass.ConstantResponse getConstantResponse() { + if (valueCase_ == 3) { + response.ResponseOuterClass.ConstantResponse result = + response.ResponseOuterClass.ConstantResponse.forNumber((java.lang.Integer) value_); + return result == null ? response.ResponseOuterClass.ConstantResponse.UNRECOGNIZED : result; + } + return response.ResponseOuterClass.ConstantResponse.OK; + } + + public static final int REQUEST_ERROR_FIELD_NUMBER = 4; + + /** + * .response.RequestError request_error = 4; + * + * @return Whether the requestError field is set. + */ + @java.lang.Override + public boolean hasRequestError() { + return valueCase_ == 4; + } + + /** + * .response.RequestError request_error = 4; + * + * @return The requestError. + */ + @java.lang.Override + public response.ResponseOuterClass.RequestError getRequestError() { + if (valueCase_ == 4) { + return (response.ResponseOuterClass.RequestError) value_; + } + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + + /** .response.RequestError request_error = 4; */ + @java.lang.Override + public response.ResponseOuterClass.RequestErrorOrBuilder getRequestErrorOrBuilder() { + if (valueCase_ == 4) { + return (response.ResponseOuterClass.RequestError) value_; + } + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + + public static final int CLOSING_ERROR_FIELD_NUMBER = 5; + + /** + * string closing_error = 5; + * + * @return Whether the closingError field is set. + */ + public boolean hasClosingError() { + return valueCase_ == 5; + } + + /** + * string closing_error = 5; + * + * @return The closingError. + */ + public java.lang.String getClosingError() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 5) { + value_ = s; + } + return s; + } + } + + /** + * string closing_error = 5; + * + * @return The bytes for closingError. + */ + public com.google.protobuf.ByteString getClosingErrorBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 5) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (callbackIdx_ != 0) { + output.writeUInt32(1, callbackIdx_); + } + if (valueCase_ == 2) { + output.writeUInt64(2, (long) ((java.lang.Long) value_)); + } + if (valueCase_ == 3) { + output.writeEnum(3, ((java.lang.Integer) value_)); + } + if (valueCase_ == 4) { + output.writeMessage(4, (response.ResponseOuterClass.RequestError) value_); + } + if (valueCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (callbackIdx_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(1, callbackIdx_); + } + if (valueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeUInt64Size( + 2, (long) ((java.lang.Long) value_)); + } + if (valueCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(3, ((java.lang.Integer) value_)); + } + if (valueCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (response.ResponseOuterClass.RequestError) value_); + } + if (valueCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof response.ResponseOuterClass.Response)) { + return super.equals(obj); + } + response.ResponseOuterClass.Response other = (response.ResponseOuterClass.Response) obj; + + if (getCallbackIdx() != other.getCallbackIdx()) return false; + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 2: + if (getRespPointer() != other.getRespPointer()) return false; + break; + case 3: + if (getConstantResponseValue() != other.getConstantResponseValue()) return false; + break; + case 4: + if (!getRequestError().equals(other.getRequestError())) return false; + break; + case 5: + if (!getClosingError().equals(other.getClosingError())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CALLBACK_IDX_FIELD_NUMBER; + hash = (53 * hash) + getCallbackIdx(); + switch (valueCase_) { + case 2: + hash = (37 * hash) + RESP_POINTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRespPointer()); + break; + case 3: + hash = (37 * hash) + CONSTANT_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getConstantResponseValue(); + break; + case 4: + hash = (37 * hash) + REQUEST_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getRequestError().hashCode(); + break; + case 5: + hash = (37 * hash) + CLOSING_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getClosingError().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static response.ResponseOuterClass.Response parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.Response parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static response.ResponseOuterClass.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static response.ResponseOuterClass.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.Response parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static response.ResponseOuterClass.Response parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.Response parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static response.ResponseOuterClass.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static response.ResponseOuterClass.Response parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(response.ResponseOuterClass.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code response.Response} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:response.Response) + response.ResponseOuterClass.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return response.ResponseOuterClass.internal_static_response_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return response.ResponseOuterClass.internal_static_response_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + response.ResponseOuterClass.Response.class, + response.ResponseOuterClass.Response.Builder.class); + } + + // Construct using response.ResponseOuterClass.Response.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + callbackIdx_ = 0; + if (requestErrorBuilder_ != null) { + requestErrorBuilder_.clear(); + } + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return response.ResponseOuterClass.internal_static_response_Response_descriptor; + } + + @java.lang.Override + public response.ResponseOuterClass.Response getDefaultInstanceForType() { + return response.ResponseOuterClass.Response.getDefaultInstance(); + } + + @java.lang.Override + public response.ResponseOuterClass.Response build() { + response.ResponseOuterClass.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public response.ResponseOuterClass.Response buildPartial() { + response.ResponseOuterClass.Response result = + new response.ResponseOuterClass.Response(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(response.ResponseOuterClass.Response result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.callbackIdx_ = callbackIdx_; + } + } + + private void buildPartialOneofs(response.ResponseOuterClass.Response result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + if (valueCase_ == 4 && requestErrorBuilder_ != null) { + result.value_ = requestErrorBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof response.ResponseOuterClass.Response) { + return mergeFrom((response.ResponseOuterClass.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(response.ResponseOuterClass.Response other) { + if (other == response.ResponseOuterClass.Response.getDefaultInstance()) return this; + if (other.getCallbackIdx() != 0) { + setCallbackIdx(other.getCallbackIdx()); + } + switch (other.getValueCase()) { + case RESP_POINTER: + { + setRespPointer(other.getRespPointer()); + break; + } + case CONSTANT_RESPONSE: + { + setConstantResponseValue(other.getConstantResponseValue()); + break; + } + case REQUEST_ERROR: + { + mergeRequestError(other.getRequestError()); + break; + } + case CLOSING_ERROR: + { + valueCase_ = 5; + value_ = other.value_; + onChanged(); + break; + } + case VALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + callbackIdx_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + value_ = input.readUInt64(); + valueCase_ = 2; + break; + } // case 16 + case 24: + { + int rawValue = input.readEnum(); + valueCase_ = 3; + value_ = rawValue; + break; + } // case 24 + case 34: + { + input.readMessage(getRequestErrorFieldBuilder().getBuilder(), extensionRegistry); + valueCase_ = 4; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 5; + value_ = s; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + + public ValueCase getValueCase() { + return ValueCase.forNumber(valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int callbackIdx_; + + /** + * uint32 callback_idx = 1; + * + * @return The callbackIdx. + */ + @java.lang.Override + public int getCallbackIdx() { + return callbackIdx_; + } + + /** + * uint32 callback_idx = 1; + * + * @param value The callbackIdx to set. + * @return This builder for chaining. + */ + public Builder setCallbackIdx(int value) { + + callbackIdx_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * uint32 callback_idx = 1; + * + * @return This builder for chaining. + */ + public Builder clearCallbackIdx() { + bitField0_ = (bitField0_ & ~0x00000001); + callbackIdx_ = 0; + onChanged(); + return this; + } + + /** + * uint64 resp_pointer = 2; + * + * @return Whether the respPointer field is set. + */ + public boolean hasRespPointer() { + return valueCase_ == 2; + } + + /** + * uint64 resp_pointer = 2; + * + * @return The respPointer. + */ + public long getRespPointer() { + if (valueCase_ == 2) { + return (java.lang.Long) value_; + } + return 0L; + } + + /** + * uint64 resp_pointer = 2; + * + * @param value The respPointer to set. + * @return This builder for chaining. + */ + public Builder setRespPointer(long value) { + + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + + /** + * uint64 resp_pointer = 2; + * + * @return This builder for chaining. + */ + public Builder clearRespPointer() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return Whether the constantResponse field is set. + */ + @java.lang.Override + public boolean hasConstantResponse() { + return valueCase_ == 3; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The enum numeric value on the wire for constantResponse. + */ + @java.lang.Override + public int getConstantResponseValue() { + if (valueCase_ == 3) { + return ((java.lang.Integer) value_).intValue(); + } + return 0; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @param value The enum numeric value on the wire for constantResponse to set. + * @return This builder for chaining. + */ + public Builder setConstantResponseValue(int value) { + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return The constantResponse. + */ + @java.lang.Override + public response.ResponseOuterClass.ConstantResponse getConstantResponse() { + if (valueCase_ == 3) { + response.ResponseOuterClass.ConstantResponse result = + response.ResponseOuterClass.ConstantResponse.forNumber((java.lang.Integer) value_); + return result == null + ? response.ResponseOuterClass.ConstantResponse.UNRECOGNIZED + : result; + } + return response.ResponseOuterClass.ConstantResponse.OK; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @param value The constantResponse to set. + * @return This builder for chaining. + */ + public Builder setConstantResponse(response.ResponseOuterClass.ConstantResponse value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .response.ConstantResponse constant_response = 3; + * + * @return This builder for chaining. + */ + public Builder clearConstantResponse() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + response.ResponseOuterClass.RequestError, + response.ResponseOuterClass.RequestError.Builder, + response.ResponseOuterClass.RequestErrorOrBuilder> + requestErrorBuilder_; + + /** + * .response.RequestError request_error = 4; + * + * @return Whether the requestError field is set. + */ + @java.lang.Override + public boolean hasRequestError() { + return valueCase_ == 4; + } + + /** + * .response.RequestError request_error = 4; + * + * @return The requestError. + */ + @java.lang.Override + public response.ResponseOuterClass.RequestError getRequestError() { + if (requestErrorBuilder_ == null) { + if (valueCase_ == 4) { + return (response.ResponseOuterClass.RequestError) value_; + } + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } else { + if (valueCase_ == 4) { + return requestErrorBuilder_.getMessage(); + } + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + } + + /** .response.RequestError request_error = 4; */ + public Builder setRequestError(response.ResponseOuterClass.RequestError value) { + if (requestErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + requestErrorBuilder_.setMessage(value); + } + valueCase_ = 4; + return this; + } + + /** .response.RequestError request_error = 4; */ + public Builder setRequestError( + response.ResponseOuterClass.RequestError.Builder builderForValue) { + if (requestErrorBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + requestErrorBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 4; + return this; + } + + /** .response.RequestError request_error = 4; */ + public Builder mergeRequestError(response.ResponseOuterClass.RequestError value) { + if (requestErrorBuilder_ == null) { + if (valueCase_ == 4 + && value_ != response.ResponseOuterClass.RequestError.getDefaultInstance()) { + value_ = + response.ResponseOuterClass.RequestError.newBuilder( + (response.ResponseOuterClass.RequestError) value_) + .mergeFrom(value) + .buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 4) { + requestErrorBuilder_.mergeFrom(value); + } else { + requestErrorBuilder_.setMessage(value); + } + } + valueCase_ = 4; + return this; + } + + /** .response.RequestError request_error = 4; */ + public Builder clearRequestError() { + if (requestErrorBuilder_ == null) { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + } + requestErrorBuilder_.clear(); + } + return this; + } + + /** .response.RequestError request_error = 4; */ + public response.ResponseOuterClass.RequestError.Builder getRequestErrorBuilder() { + return getRequestErrorFieldBuilder().getBuilder(); + } + + /** .response.RequestError request_error = 4; */ + @java.lang.Override + public response.ResponseOuterClass.RequestErrorOrBuilder getRequestErrorOrBuilder() { + if ((valueCase_ == 4) && (requestErrorBuilder_ != null)) { + return requestErrorBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 4) { + return (response.ResponseOuterClass.RequestError) value_; + } + return response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + } + + /** .response.RequestError request_error = 4; */ + private com.google.protobuf.SingleFieldBuilderV3< + response.ResponseOuterClass.RequestError, + response.ResponseOuterClass.RequestError.Builder, + response.ResponseOuterClass.RequestErrorOrBuilder> + getRequestErrorFieldBuilder() { + if (requestErrorBuilder_ == null) { + if (!(valueCase_ == 4)) { + value_ = response.ResponseOuterClass.RequestError.getDefaultInstance(); + } + requestErrorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + response.ResponseOuterClass.RequestError, + response.ResponseOuterClass.RequestError.Builder, + response.ResponseOuterClass.RequestErrorOrBuilder>( + (response.ResponseOuterClass.RequestError) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 4; + onChanged(); + return requestErrorBuilder_; + } + + /** + * string closing_error = 5; + * + * @return Whether the closingError field is set. + */ + @java.lang.Override + public boolean hasClosingError() { + return valueCase_ == 5; + } + + /** + * string closing_error = 5; + * + * @return The closingError. + */ + @java.lang.Override + public java.lang.String getClosingError() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 5) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string closing_error = 5; + * + * @return The bytes for closingError. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClosingErrorBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueCase_ == 5) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string closing_error = 5; + * + * @param value The closingError to set. + * @return This builder for chaining. + */ + public Builder setClosingError(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + + /** + * string closing_error = 5; + * + * @return This builder for chaining. + */ + public Builder clearClosingError() { + if (valueCase_ == 5) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * string closing_error = 5; + * + * @param value The bytes for closingError to set. + * @return This builder for chaining. + */ + public Builder setClosingErrorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:response.Response) + } + + // @@protoc_insertion_point(class_scope:response.Response) + private static final response.ResponseOuterClass.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new response.ResponseOuterClass.Response(); + } + + public static response.ResponseOuterClass.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public response.ResponseOuterClass.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_response_RequestError_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_response_RequestError_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_response_Response_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_response_Response_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\016response.proto\022\010response\"I\n\014RequestErr" + + "or\022(\n\004type\030\001 \001(\0162\032.response.RequestError" + + "Type\022\017\n\007message\030\002 \001(\t\"\304\001\n\010Response\022\024\n\014ca" + + "llback_idx\030\001 \001(\r\022\026\n\014resp_pointer\030\002 \001(\004H\000" + + "\0227\n\021constant_response\030\003 \001(\0162\032.response.C" + + "onstantResponseH\000\022/\n\rrequest_error\030\004 \001(\013" + + "2\026.response.RequestErrorH\000\022\027\n\rclosing_er" + + "ror\030\005 \001(\tH\000B\007\n\005value*O\n\020RequestErrorType" + + "\022\017\n\013Unspecified\020\000\022\r\n\tExecAbort\020\001\022\013\n\007Time" + + "out\020\002\022\016\n\nDisconnect\020\003*\032\n\020ConstantRespons" + + "e\022\006\n\002OK\020\000b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_response_RequestError_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_response_RequestError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_response_RequestError_descriptor, + new java.lang.String[] { + "Type", "Message", + }); + internal_static_response_Response_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_response_Response_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_response_Response_descriptor, + new java.lang.String[] { + "CallbackIdx", + "RespPointer", + "ConstantResponse", + "RequestError", + "ClosingError", + "Value", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java/src/lib.rs b/java/src/lib.rs index 5751010912..66f551e8de 100644 --- a/java/src/lib.rs +++ b/java/src/lib.rs @@ -2,8 +2,50 @@ use babushka::start_socket_listener; use jni::objects::{JClass, JObject, JValue}; use jni::JNIEnv; +use jni::sys::jlong; +use jni::sys::jint; use std::sync::mpsc; +use redis::Value; + +fn redis_value_to_java<'local>(mut env: JNIEnv<'local>, val: Value) -> JObject<'local> { + match val { + Value::Nil => JObject::null(), + Value::Status(str) => JObject::from(env.new_string(str).unwrap()), + Value::Okay => JObject::from(env.new_string("OK").unwrap()), + Value::Int(num) => env.new_object("java/lang/Integer", "(I)Ljava/lang/Integer;", &[num.into()]).unwrap(), + Value::Data(data) => match std::str::from_utf8(data.as_ref()) { + Ok(val) => JObject::from(env.new_string(val).unwrap()), + Err(_err) => { + let _ = env.throw("Error decoding Unicode data"); + JObject::null() + }, + }, + Value::Bulk(bulk) => { + let _ = env.throw("Not implemented"); + JObject::null() + /* + let elements: &PyList = PyList::new( + py, + bulk.into_iter() + .map(|item| redis_value_to_py(py, item).unwrap()), + ); + Ok(elements.into_py(py)) + */ + } + } +} + +#[no_mangle] +pub extern "system" fn Java_javababushka_client_RedisClient_valueFromPointer<'local>( + mut env: JNIEnv<'local>, + _class: JClass<'local>, + pointer: jlong +) -> JObject<'local> { + let value = unsafe { Box::from_raw(pointer as *mut Value) }; + redis_value_to_java(env, *value) +} + #[no_mangle] pub extern "system" fn Java_javababushka_client_RedisClient_startSocketListenerExternal<'local>( mut env: JNIEnv<'local>,