From deae06389bf5bc74771c1fe993bfa2f3fc2f0f58 Mon Sep 17 00:00:00 2001 From: seagle Date: Sun, 15 May 2022 18:35:15 +0800 Subject: [PATCH 1/7] fix protobuf checkstyle issue --- hugegraph-core/pom.xml | 71 +- .../backend/store/raft/RaftBackendStore.java | 17 +- .../store/raft/RaftBackendStoreProvider.java | 13 +- .../store/raft/RaftGroupManagerImpl.java | 20 +- .../backend/store/raft/RaftSharedContext.java | 16 +- .../backend/store/raft/StoreCommand.java | 19 +- .../backend/store/raft/StoreStateMachine.java | 17 +- .../store/raft/rpc/ListPeersProcessor.java | 41 +- .../backend/store/raft/rpc/RaftRequests.java | 4143 ----------------- .../backend/store/raft/rpc/RpcForwarder.java | 19 +- .../store/raft/rpc/SetLeaderProcessor.java | 30 +- .../store/raft/rpc/StoreCommandProcessor.java | 21 +- .../src/main/resources/{ => proto}/raft.proto | 0 .../unit/serializer/StoreSerializerTest.java | 11 +- pom.xml | 36 +- 15 files changed, 208 insertions(+), 4266 deletions(-) delete mode 100644 hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java rename hugegraph-core/src/main/resources/{ => proto}/raft.proto (100%) diff --git a/hugegraph-core/pom.xml b/hugegraph-core/pom.xml index 1e5a02f241..52abd5755d 100644 --- a/hugegraph-core/pom.xml +++ b/hugegraph-core/pom.xml @@ -192,6 +192,24 @@ 0.11.2 runtime + + + io.grpc + grpc-netty + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + com.google.protobuf + protobuf-java + + @@ -202,13 +220,62 @@ true + - ${basedir}/src/test/resources - + ${basedir}/src/test/resources + + + + kr.motd.maven + os-maven-plugin + 1.5.0.Final + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.4 + + + add-source + generate-sources + + add-source + + + + ${basedir}/src/protobuf/java + + + + + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.5.0 + + com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} + protoc-java + ${project.basedir}/src/main/resources + ${project.basedir}/src/protobuf/java + + + + + compile + + + + + maven-clean-plugin 3.0.0 diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java index 06ddf9e20b..19999d65cf 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java @@ -36,8 +36,7 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.BackendStoreProvider; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.util.E; @@ -114,7 +113,7 @@ public void init() { public void clear(boolean clearSpace) { byte value = clearSpace ? (byte) 1 : (byte) 0; byte[] bytes = StoreCommand.wrap(value); - this.submitAndWait(StoreAction.CLEAR, bytes); + this.submitAndWait(RaftRequests.StoreAction.CLEAR, bytes); } @Override @@ -124,7 +123,7 @@ public boolean initialized() { @Override public void truncate() { - this.submitAndWait(StoreAction.TRUNCATE, null); + this.submitAndWait(RaftRequests.StoreAction.TRUNCATE, null); } @Override @@ -159,7 +158,7 @@ public void commitTx() { MutationBatch batch = this.getOrNewBatch(); try { byte[] bytes = StoreSerializer.writeMutations(batch.mutations); - this.submitAndWait(StoreAction.COMMIT_TX, bytes); + this.submitAndWait(RaftRequests.StoreAction.COMMIT_TX, bytes); } finally { batch.clear(); } @@ -167,7 +166,7 @@ public void commitTx() { @Override public void rollbackTx() { - this.submitAndWait(StoreAction.ROLLBACK_TX, null); + this.submitAndWait(RaftRequests.StoreAction.ROLLBACK_TX, null); } @Override @@ -184,7 +183,7 @@ public BackendFeatures features() { public void increaseCounter(HugeType type, long increment) { IncrCounter incrCounter = new IncrCounter(type, increment); byte[] bytes = StoreSerializer.writeIncrCounter(incrCounter); - this.submitAndWait(StoreAction.INCR_COUNTER, bytes); + this.submitAndWait(RaftRequests.StoreAction.INCR_COUNTER, bytes); } @Override @@ -194,8 +193,8 @@ public long getCounter(HugeType type) { return (Long) counter; } - private Object submitAndWait(StoreAction action, byte[] data) { - StoreType type = this.context.storeType(this.store()); + private Object submitAndWait(RaftRequests.StoreAction action, byte[] data) { + RaftRequests.StoreType type = this.context.storeType(this.store()); return this.submitAndWait(new StoreCommand(type, action, data)); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java index 7e9ca5e66e..95f79b6fc1 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java @@ -29,8 +29,7 @@ import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.BackendStoreProvider; import com.baidu.hugegraph.backend.store.BackendStoreSystemInfo; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.event.EventHub; import com.baidu.hugegraph.event.EventListener; @@ -103,7 +102,7 @@ public synchronized BackendStore loadSchemaStore(HugeConfig config, String name) BackendStore store = this.provider.loadSchemaStore(config, name); this.checkNonSharedStore(store); this.schemaStore = new RaftBackendStore(store, this.context); - this.context.addStore(StoreType.SCHEMA, this.schemaStore); + this.context.addStore(RaftRequests.StoreType.SCHEMA, this.schemaStore); } return this.schemaStore; } @@ -115,7 +114,7 @@ public synchronized BackendStore loadGraphStore(HugeConfig config, String name) BackendStore store = this.provider.loadGraphStore(config, name); this.checkNonSharedStore(store); this.graphStore = new RaftBackendStore(store, this.context); - this.context.addStore(StoreType.GRAPH, this.graphStore); + this.context.addStore(RaftRequests.StoreType.GRAPH, this.graphStore); } return this.graphStore; } @@ -127,7 +126,7 @@ public synchronized BackendStore loadSystemStore(HugeConfig config, String name) BackendStore store = this.provider.loadSystemStore(config, name); this.checkNonSharedStore(store); this.systemStore = new RaftBackendStore(store, this.context); - this.context.addStore(StoreType.SYSTEM, this.systemStore); + this.context.addStore(RaftRequests.StoreType.SYSTEM, this.systemStore); } return this.systemStore; } @@ -215,8 +214,8 @@ public void initSystemInfo(HugeGraph graph) { @Override public void createSnapshot() { // TODO: snapshot for StoreType.ALL instead of StoreType.GRAPH - StoreCommand command = new StoreCommand(StoreType.GRAPH, - StoreAction.SNAPSHOT, null); + StoreCommand command = new StoreCommand(RaftRequests.StoreType.GRAPH, + RaftRequests.StoreAction.SNAPSHOT, null); RaftStoreClosure closure = new RaftStoreClosure(command); this.context.node().submitAndWait(command, closure); LOG.debug("Graph '{}' has writed snapshot", this.graph()); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java index d1b15b634e..4cef5e881e 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java @@ -26,10 +26,7 @@ import com.alipay.sofa.jraft.Status; import com.alipay.sofa.jraft.entity.PeerId; import com.baidu.hugegraph.backend.BackendException; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.backend.store.raft.rpc.RpcForwarder; import com.baidu.hugegraph.util.E; import com.google.protobuf.Message; @@ -59,11 +56,11 @@ public List listPeers() { .collect(Collectors.toList()); } // If current node is not leader, forward request to leader - ListPeersRequest request = ListPeersRequest.getDefaultInstance(); + RaftRequests.ListPeersRequest request = RaftRequests.ListPeersRequest.getDefaultInstance(); try { - RaftClosure future; + RaftClosure future; future = this.forwardToLeader(request); - ListPeersResponse response = future.waitFinished(); + RaftRequests.ListPeersResponse response = future.waitFinished(); return response.getEndpointsList(); } catch (Throwable e) { throw new BackendException("Failed to list peers", e); @@ -103,11 +100,12 @@ public String setLeader(String endpoint) { this.transferLeaderTo(endpoint); } else { // If current node is not leader, forward request to leader - SetLeaderRequest request = SetLeaderRequest.newBuilder() - .setEndpoint(endpoint) - .build(); + RaftRequests.SetLeaderRequest + request = RaftRequests.SetLeaderRequest.newBuilder() + .setEndpoint(endpoint) + .build(); try { - RaftClosure future; + RaftClosure future; future = this.forwardToLeader(request); future.waitFinished(); } catch (Throwable e) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java index 3176cafc8d..74b216df9d 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java @@ -53,7 +53,7 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.raft.rpc.ListPeersProcessor; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.backend.store.raft.rpc.RpcForwarder; import com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderProcessor; import com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandProcessor; @@ -111,7 +111,7 @@ public RaftSharedContext(HugeGraphParams params) { this.schemaStoreName = config.get(CoreOptions.STORE_SCHEMA); this.graphStoreName = config.get(CoreOptions.STORE_GRAPH); this.systemStoreName = config.get(CoreOptions.STORE_SYSTEM); - this.stores = new RaftBackendStore[StoreType.ALL.getNumber()]; + this.stores = new RaftBackendStore[RaftRequests.StoreType.ALL.getNumber()]; this.rpcServer = this.initAndStartRpcServer(); if (config.get(CoreOptions.RAFT_SAFE_READ)) { int threads = config.get(CoreOptions.RAFT_READ_INDEX_THREADS); @@ -178,18 +178,18 @@ public String group() { return DEFAULT_GROUP; } - public void addStore(StoreType type, RaftBackendStore store) { + public void addStore(RaftRequests.StoreType type, RaftBackendStore store) { this.stores[type.getNumber()] = store; } - public StoreType storeType(String store) { + public RaftRequests.StoreType storeType(String store) { if (this.schemaStoreName.equals(store)) { - return StoreType.SCHEMA; + return RaftRequests.StoreType.SCHEMA; } else if (this.graphStoreName.equals(store)) { - return StoreType.GRAPH; + return RaftRequests.StoreType.GRAPH; } else { assert this.systemStoreName.equals(store); - return StoreType.SYSTEM; + return RaftRequests.StoreType.SYSTEM; } } @@ -197,7 +197,7 @@ protected RaftBackendStore[] stores() { return this.stores; } - public BackendStore originStore(StoreType storeType) { + public BackendStore originStore(RaftRequests.StoreType storeType) { RaftBackendStore raftStore = this.stores[storeType.getNumber()]; E.checkState(raftStore != null, "The raft store of type %s shouldn't be null", storeType); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java index c90ffe8dac..f844d27570 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java @@ -20,23 +20,22 @@ package com.baidu.hugegraph.backend.store.raft; import com.baidu.hugegraph.backend.serializer.BytesBuffer; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; public final class StoreCommand { public static final int HEADER_SIZE = 2; - private final StoreType type; - private final StoreAction action; + private final RaftRequests.StoreType type; + private final RaftRequests.StoreAction action; private final byte[] data; private final boolean forwarded; - public StoreCommand(StoreType type, StoreAction action, byte[] data) { + public StoreCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, byte[] data) { this(type, action, data, false); } - public StoreCommand(StoreType type, StoreAction action, + public StoreCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, byte[] data, boolean forwarded) { this.type = type; this.action = action; @@ -51,11 +50,11 @@ public StoreCommand(StoreType type, StoreAction action, this.forwarded = forwarded; } - public StoreType type() { + public RaftRequests.StoreType type() { return this.type; } - public StoreAction action() { + public RaftRequests.StoreAction action() { return this.action; } @@ -79,8 +78,8 @@ public static byte[] wrap(byte value) { } public static StoreCommand fromBytes(byte[] bytes) { - StoreType type = StoreType.valueOf(bytes[0]); - StoreAction action = StoreAction.valueOf(bytes[1]); + RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(bytes[0]); + RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(bytes[1]); return new StoreCommand(type, action, bytes); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java index 73b1cd7c24..b04a36381b 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java @@ -42,8 +42,7 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.raft.RaftBackendStore.IncrCounter; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.LZ4Util; import com.baidu.hugegraph.util.Log; @@ -60,7 +59,7 @@ public StoreStateMachine(RaftSharedContext context) { this.snapshotFile = new StoreSnapshotFile(context.stores()); } - private BackendStore store(StoreType type) { + private BackendStore store(RaftRequests.StoreType type) { return this.context.originStore(type); } @@ -105,8 +104,8 @@ private Future onApplyLeader(RaftStoreClosure closure) { StoreCommand command = closure.command(); BytesBuffer buffer = BytesBuffer.wrap(command.data()); // The first two bytes are StoreType and StoreAction - StoreType type = StoreType.valueOf(buffer.read()); - StoreAction action = StoreAction.valueOf(buffer.read()); + RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(buffer.read()); + RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(buffer.read()); boolean forwarded = command.forwarded(); // Let the producer thread to handle it, and wait for it CompletableFuture future = new CompletableFuture<>(); @@ -132,8 +131,8 @@ private Future onApplyFollower(ByteBuffer data) { BytesBuffer buffer = LZ4Util.decompress(bytes, RaftSharedContext.BLOCK_SIZE); buffer.forReadWritten(); - StoreType type = StoreType.valueOf(buffer.read()); - StoreAction action = StoreAction.valueOf(buffer.read()); + RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(buffer.read()); + RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(buffer.read()); try { return this.applyCommand(type, action, buffer, false); } catch (Throwable e) { @@ -144,9 +143,9 @@ private Future onApplyFollower(ByteBuffer data) { }); } - private Object applyCommand(StoreType type, StoreAction action, + private Object applyCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, BytesBuffer buffer, boolean forwarded) { - E.checkState(type != StoreType.ALL, + E.checkState(type != RaftRequests.StoreType.ALL, "Can't apply command for all store at one time"); BackendStore store = this.store(type); switch (action) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java index 328cf3c108..5634bde325 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java @@ -25,15 +25,12 @@ import com.alipay.sofa.jraft.rpc.RpcRequestProcessor; import com.baidu.hugegraph.backend.store.raft.RaftGroupManager; import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse; import com.baidu.hugegraph.util.Log; import com.google.common.collect.ImmutableList; import com.google.protobuf.Message; public class ListPeersProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger(ListPeersProcessor.class); @@ -45,33 +42,35 @@ public ListPeersProcessor(RaftSharedContext context) { } @Override - public Message processRequest(ListPeersRequest request, + public Message processRequest(RaftRequests.ListPeersRequest request, RpcRequestClosure done) { LOG.debug("Processing ListPeersRequest {}", request.getClass()); RaftGroupManager nodeManager = this.context.raftNodeManager( RaftSharedContext.DEFAULT_GROUP); try { - CommonResponse common = CommonResponse.newBuilder() - .setStatus(true) - .build(); - return ListPeersResponse.newBuilder() - .setCommon(common) - .addAllEndpoints(nodeManager.listPeers()) - .build(); + RaftRequests.CommonResponse common = RaftRequests.CommonResponse.newBuilder() + .setStatus(true) + .build(); + return RaftRequests.ListPeersResponse.newBuilder() + .setCommon(common) + .addAllEndpoints(nodeManager.listPeers()) + .build(); } catch (Throwable e) { - CommonResponse common = CommonResponse.newBuilder() - .setStatus(false) - .setMessage(e.toString()) - .build(); - return ListPeersResponse.newBuilder() - .setCommon(common) - .addAllEndpoints(ImmutableList.of()) - .build(); + RaftRequests.CommonResponse common = + RaftRequests.CommonResponse.newBuilder() + .setStatus(false) + .setMessage(e.toString()) + .build(); + + return RaftRequests.ListPeersResponse.newBuilder() + .setCommon(common) + .addAllEndpoints(ImmutableList.of()) + .build(); } } @Override public String interest() { - return ListPeersRequest.class.getName(); + return RaftRequests.ListPeersRequest.class.getName(); } } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java deleted file mode 100644 index 6bcc9aa702..0000000000 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java +++ /dev/null @@ -1,4143 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: hugegraph-core/src/main/resources/raft.proto - -package com.baidu.hugegraph.backend.store.raft.rpc; - -@SuppressWarnings("unused") -public final class RaftRequests { - private RaftRequests() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - /** - * Protobuf enum {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreType} - */ - public enum StoreType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * SCHEMA = 0; - */ - SCHEMA(0, 0), - /** - * GRAPH = 1; - */ - GRAPH(1, 1), - /** - * SYSTEM = 2; - */ - SYSTEM(2, 2), - /** - * ALL = 3; - */ - ALL(3, 3), - ; - - /** - * SCHEMA = 0; - */ - public static final int SCHEMA_VALUE = 0; - /** - * GRAPH = 1; - */ - public static final int GRAPH_VALUE = 1; - /** - * SYSTEM = 2; - */ - public static final int SYSTEM_VALUE = 2; - /** - * ALL = 3; - */ - public static final int ALL_VALUE = 3; - - - public final int getNumber() { return value; } - - public static StoreType valueOf(int value) { - switch (value) { - case 0: return SCHEMA; - case 1: return GRAPH; - case 2: return SYSTEM; - case 3: return ALL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public StoreType findValueByNumber(int number) { - return StoreType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.getDescriptor().getEnumTypes().get(0); - } - - private static final StoreType[] VALUES = values(); - - public static StoreType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private StoreType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreType) - } - - /** - * Protobuf enum {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreAction} - */ - public enum StoreAction - implements com.google.protobuf.ProtocolMessageEnum { - /** - * NONE = 0; - */ - NONE(0, 0), - /** - * INIT = 1; - */ - INIT(1, 1), - /** - * CLEAR = 2; - */ - CLEAR(2, 2), - /** - * TRUNCATE = 3; - */ - TRUNCATE(3, 3), - /** - * SNAPSHOT = 4; - */ - SNAPSHOT(4, 4), - /** - * BEGIN_TX = 10; - */ - BEGIN_TX(5, 10), - /** - * COMMIT_TX = 11; - */ - COMMIT_TX(6, 11), - /** - * ROLLBACK_TX = 12; - */ - ROLLBACK_TX(7, 12), - /** - * MUTATE = 20; - */ - MUTATE(8, 20), - /** - * INCR_COUNTER = 21; - */ - INCR_COUNTER(9, 21), - /** - * QUERY = 30; - */ - QUERY(10, 30), - ; - - /** - * NONE = 0; - */ - public static final int NONE_VALUE = 0; - /** - * INIT = 1; - */ - public static final int INIT_VALUE = 1; - /** - * CLEAR = 2; - */ - public static final int CLEAR_VALUE = 2; - /** - * TRUNCATE = 3; - */ - public static final int TRUNCATE_VALUE = 3; - /** - * SNAPSHOT = 4; - */ - public static final int SNAPSHOT_VALUE = 4; - /** - * BEGIN_TX = 10; - */ - public static final int BEGIN_TX_VALUE = 10; - /** - * COMMIT_TX = 11; - */ - public static final int COMMIT_TX_VALUE = 11; - /** - * ROLLBACK_TX = 12; - */ - public static final int ROLLBACK_TX_VALUE = 12; - /** - * MUTATE = 20; - */ - public static final int MUTATE_VALUE = 20; - /** - * INCR_COUNTER = 21; - */ - public static final int INCR_COUNTER_VALUE = 21; - /** - * QUERY = 30; - */ - public static final int QUERY_VALUE = 30; - - - public final int getNumber() { return value; } - - public static StoreAction valueOf(int value) { - switch (value) { - case 0: return NONE; - case 1: return INIT; - case 2: return CLEAR; - case 3: return TRUNCATE; - case 4: return SNAPSHOT; - case 10: return BEGIN_TX; - case 11: return COMMIT_TX; - case 12: return ROLLBACK_TX; - case 20: return MUTATE; - case 21: return INCR_COUNTER; - case 30: return QUERY; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public StoreAction findValueByNumber(int number) { - return StoreAction.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.getDescriptor().getEnumTypes().get(1); - } - - private static final StoreAction[] VALUES = values(); - - public static StoreAction valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private StoreAction(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreAction) - } - - public interface StoreCommandRequestOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - boolean hasType(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType(); - - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - boolean hasAction(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction(); - - // required bytes data = 3; - /** - * required bytes data = 3; - */ - boolean hasData(); - /** - * required bytes data = 3; - */ - com.google.protobuf.ByteString getData(); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest} - */ - public static final class StoreCommandRequest extends - com.google.protobuf.GeneratedMessage - implements StoreCommandRequestOrBuilder { - // Use StoreCommandRequest.newBuilder() to construct. - private StoreCommandRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private StoreCommandRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final StoreCommandRequest defaultInstance; - public static StoreCommandRequest getDefaultInstance() { - return defaultInstance; - } - - public StoreCommandRequest getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StoreCommandRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType value = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(1, rawValue); - } else { - bitField0_ |= 0x00000001; - type_ = value; - } - break; - } - case 16: { - int rawValue = input.readEnum(); - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction value = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - action_ = value; - } - break; - } - case 26: { - bitField0_ |= 0x00000004; - data_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StoreCommandRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StoreCommandRequest(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - public static final int TYPE_FIELD_NUMBER = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType type_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType() { - return type_; - } - - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - public static final int ACTION_FIELD_NUMBER = 2; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction action_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public boolean hasAction() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction() { - return action_; - } - - // required bytes data = 3; - public static final int DATA_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString data_; - /** - * required bytes data = 3; - */ - public boolean hasData() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required bytes data = 3; - */ - public com.google.protobuf.ByteString getData() { - return data_; - } - - private void initFields() { - type_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA; - action_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE; - data_ = com.google.protobuf.ByteString.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasType()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasAction()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasData()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, type_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, action_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, data_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, type_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, action_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, data_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - type_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA; - bitField0_ = (bitField0_ & ~0x00000001); - action_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE; - bitField0_ = (bitField0_ & ~0x00000002); - data_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.action_ = action_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.data_ = data_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.getDefaultInstance()) return this; - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasAction()) { - setAction(other.getAction()); - } - if (other.hasData()) { - setData(other.getData()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasType()) { - - return false; - } - if (!hasAction()) { - - return false; - } - if (!hasData()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType type_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType() { - return type_; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public Builder setType(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - type_ = value; - onChanged(); - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; - */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000001); - type_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA; - onChanged(); - return this; - } - - // required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction action_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public boolean hasAction() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction() { - return action_; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public Builder setAction(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - action_ = value; - onChanged(); - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; - */ - public Builder clearAction() { - bitField0_ = (bitField0_ & ~0x00000002); - action_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE; - onChanged(); - return this; - } - - // required bytes data = 3; - private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; - /** - * required bytes data = 3; - */ - public boolean hasData() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * required bytes data = 3; - */ - public com.google.protobuf.ByteString getData() { - return data_; - } - /** - * required bytes data = 3; - */ - public Builder setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - data_ = value; - onChanged(); - return this; - } - /** - * required bytes data = 3; - */ - public Builder clearData() { - bitField0_ = (bitField0_ & ~0x00000004); - data_ = getDefaultInstance().getData(); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) - } - - static { - defaultInstance = new StoreCommandRequest(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) - } - - public interface StoreCommandResponseOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required bool status = 1; - /** - * required bool status = 1; - */ - boolean hasStatus(); - /** - * required bool status = 1; - */ - boolean getStatus(); - - // optional string message = 2; - /** - * optional string message = 2; - */ - boolean hasMessage(); - /** - * optional string message = 2; - */ - java.lang.String getMessage(); - /** - * optional string message = 2; - */ - com.google.protobuf.ByteString - getMessageBytes(); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse} - */ - public static final class StoreCommandResponse extends - com.google.protobuf.GeneratedMessage - implements StoreCommandResponseOrBuilder { - // Use StoreCommandResponse.newBuilder() to construct. - private StoreCommandResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private StoreCommandResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final StoreCommandResponse defaultInstance; - public static StoreCommandResponse getDefaultInstance() { - return defaultInstance; - } - - public StoreCommandResponse getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StoreCommandResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - status_ = input.readBool(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - message_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public StoreCommandResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StoreCommandResponse(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required bool status = 1; - public static final int STATUS_FIELD_NUMBER = 1; - private boolean status_; - /** - * required bool status = 1; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required bool status = 1; - */ - public boolean getStatus() { - return status_; - } - - // optional string message = 2; - public static final int MESSAGE_FIELD_NUMBER = 2; - private java.lang.Object message_; - /** - * optional string message = 2; - */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string message = 2; - */ - 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(); - if (bs.isValidUtf8()) { - message_ = s; - } - return s; - } - } - /** - * optional string message = 2; - */ - 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 void initFields() { - status_ = false; - message_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasStatus()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBool(1, status_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getMessageBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, status_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getMessageBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - status_ = false; - bitField0_ = (bitField0_ & ~0x00000001); - message_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.status_ = status_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.message_ = message_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.getDefaultInstance()) return this; - if (other.hasStatus()) { - setStatus(other.getStatus()); - } - if (other.hasMessage()) { - bitField0_ |= 0x00000002; - message_ = other.message_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasStatus()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required bool status = 1; - private boolean status_ ; - /** - * required bool status = 1; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required bool status = 1; - */ - public boolean getStatus() { - return status_; - } - /** - * required bool status = 1; - */ - public Builder setStatus(boolean value) { - bitField0_ |= 0x00000001; - status_ = value; - onChanged(); - return this; - } - /** - * required bool status = 1; - */ - public Builder clearStatus() { - bitField0_ = (bitField0_ & ~0x00000001); - status_ = false; - onChanged(); - return this; - } - - // optional string message = 2; - private java.lang.Object message_ = ""; - /** - * optional string message = 2; - */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - message_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string message = 2; - */ - 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; - } - } - /** - * optional string message = 2; - */ - public Builder setMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - message_ = value; - onChanged(); - return this; - } - /** - * optional string message = 2; - */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000002); - message_ = getDefaultInstance().getMessage(); - onChanged(); - return this; - } - /** - * optional string message = 2; - */ - public Builder setMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - message_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) - } - - static { - defaultInstance = new StoreCommandResponse(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) - } - - public interface CommonResponseOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required bool status = 1; - /** - * required bool status = 1; - */ - boolean hasStatus(); - /** - * required bool status = 1; - */ - boolean getStatus(); - - // optional string message = 2; - /** - * optional string message = 2; - */ - boolean hasMessage(); - /** - * optional string message = 2; - */ - java.lang.String getMessage(); - /** - * optional string message = 2; - */ - com.google.protobuf.ByteString - getMessageBytes(); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse} - */ - public static final class CommonResponse extends - com.google.protobuf.GeneratedMessage - implements CommonResponseOrBuilder { - // Use CommonResponse.newBuilder() to construct. - private CommonResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private CommonResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final CommonResponse defaultInstance; - public static CommonResponse getDefaultInstance() { - return defaultInstance; - } - - public CommonResponse getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CommonResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - status_ = input.readBool(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - message_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public CommonResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CommonResponse(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required bool status = 1; - public static final int STATUS_FIELD_NUMBER = 1; - private boolean status_; - /** - * required bool status = 1; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required bool status = 1; - */ - public boolean getStatus() { - return status_; - } - - // optional string message = 2; - public static final int MESSAGE_FIELD_NUMBER = 2; - private java.lang.Object message_; - /** - * optional string message = 2; - */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string message = 2; - */ - 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(); - if (bs.isValidUtf8()) { - message_ = s; - } - return s; - } - } - /** - * optional string message = 2; - */ - 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 void initFields() { - status_ = false; - message_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasStatus()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBool(1, status_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getMessageBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, status_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getMessageBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - status_ = false; - bitField0_ = (bitField0_ & ~0x00000001); - message_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.status_ = status_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.message_ = message_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) return this; - if (other.hasStatus()) { - setStatus(other.getStatus()); - } - if (other.hasMessage()) { - bitField0_ |= 0x00000002; - message_ = other.message_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasStatus()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required bool status = 1; - private boolean status_ ; - /** - * required bool status = 1; - */ - public boolean hasStatus() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required bool status = 1; - */ - public boolean getStatus() { - return status_; - } - /** - * required bool status = 1; - */ - public Builder setStatus(boolean value) { - bitField0_ |= 0x00000001; - status_ = value; - onChanged(); - return this; - } - /** - * required bool status = 1; - */ - public Builder clearStatus() { - bitField0_ = (bitField0_ & ~0x00000001); - status_ = false; - onChanged(); - return this; - } - - // optional string message = 2; - private java.lang.Object message_ = ""; - /** - * optional string message = 2; - */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - message_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string message = 2; - */ - 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; - } - } - /** - * optional string message = 2; - */ - public Builder setMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - message_ = value; - onChanged(); - return this; - } - /** - * optional string message = 2; - */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000002); - message_ = getDefaultInstance().getMessage(); - onChanged(); - return this; - } - /** - * optional string message = 2; - */ - public Builder setMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - message_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) - } - - static { - defaultInstance = new CommonResponse(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) - } - - public interface ListPeersRequestOrBuilder - extends com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest} - */ - public static final class ListPeersRequest extends - com.google.protobuf.GeneratedMessage - implements ListPeersRequestOrBuilder { - // Use ListPeersRequest.newBuilder() to construct. - private ListPeersRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ListPeersRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ListPeersRequest defaultInstance; - public static ListPeersRequest getDefaultInstance() { - return defaultInstance; - } - - public ListPeersRequest getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPeersRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ListPeersRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPeersRequest(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private void initFields() { - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest(this); - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.getDefaultInstance()) return this; - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) - } - - static { - defaultInstance = new ListPeersRequest(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) - } - - public interface ListPeersResponseOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - boolean hasCommon(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder(); - - // repeated string endpoints = 2; - /** - * repeated string endpoints = 2; - */ - java.util.List - getEndpointsList(); - /** - * repeated string endpoints = 2; - */ - int getEndpointsCount(); - /** - * repeated string endpoints = 2; - */ - java.lang.String getEndpoints(int index); - /** - * repeated string endpoints = 2; - */ - com.google.protobuf.ByteString - getEndpointsBytes(int index); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse} - */ - public static final class ListPeersResponse extends - com.google.protobuf.GeneratedMessage - implements ListPeersResponseOrBuilder { - // Use ListPeersResponse.newBuilder() to construct. - private ListPeersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ListPeersResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ListPeersResponse defaultInstance; - public static ListPeersResponse getDefaultInstance() { - return defaultInstance; - } - - public ListPeersResponse getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPeersResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = common_.toBuilder(); - } - common_ = input.readMessage(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(common_); - common_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - endpoints_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - endpoints_.add(input.readBytes()); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - endpoints_ = new com.google.protobuf.UnmodifiableLazyStringList(endpoints_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ListPeersResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPeersResponse(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - public static final int COMMON_FIELD_NUMBER = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public boolean hasCommon() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { - return common_; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { - return common_; - } - - // repeated string endpoints = 2; - public static final int ENDPOINTS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList endpoints_; - /** - * repeated string endpoints = 2; - */ - public java.util.List - getEndpointsList() { - return endpoints_; - } - /** - * repeated string endpoints = 2; - */ - public int getEndpointsCount() { - return endpoints_.size(); - } - /** - * repeated string endpoints = 2; - */ - public java.lang.String getEndpoints(int index) { - return endpoints_.get(index); - } - /** - * repeated string endpoints = 2; - */ - public com.google.protobuf.ByteString - getEndpointsBytes(int index) { - return endpoints_.getByteString(index); - } - - private void initFields() { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasCommon()) { - memoizedIsInitialized = 0; - return false; - } - if (!getCommon().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, common_); - } - for (int i = 0; i < endpoints_.size(); i++) { - output.writeBytes(2, endpoints_.getByteString(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, common_); - } - { - int dataSize = 0; - for (int i = 0; i < endpoints_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(endpoints_.getByteString(i)); - } - size += dataSize; - size += 1 * getEndpointsList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getCommonFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (commonBuilder_ == null) { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - } else { - commonBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - endpoints_ = new com.google.protobuf.UnmodifiableLazyStringList( - endpoints_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.endpoints_ = endpoints_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.getDefaultInstance()) return this; - if (other.hasCommon()) { - mergeCommon(other.getCommon()); - } - if (!other.endpoints_.isEmpty()) { - if (endpoints_.isEmpty()) { - endpoints_ = other.endpoints_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEndpointsIsMutable(); - endpoints_.addAll(other.endpoints_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasCommon()) { - - return false; - } - if (!getCommon().isInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> commonBuilder_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public boolean hasCommon() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { - if (commonBuilder_ == null) { - return common_; - } else { - return commonBuilder_.getMessage(); - } - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder setCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { - if (commonBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - common_ = value; - onChanged(); - } else { - commonBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder setCommon( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder builderForValue) { - if (commonBuilder_ == null) { - common_ = builderForValue.build(); - onChanged(); - } else { - commonBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder mergeCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { - if (commonBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - common_ != com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) { - common_ = - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder(common_).mergeFrom(value).buildPartial(); - } else { - common_ = value; - } - onChanged(); - } else { - commonBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - onChanged(); - } else { - commonBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder getCommonBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getCommonFieldBuilder().getBuilder(); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { - if (commonBuilder_ != null) { - return commonBuilder_.getMessageOrBuilder(); - } else { - return common_; - } - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> - getCommonFieldBuilder() { - if (commonBuilder_ == null) { - commonBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder>( - common_, - getParentForChildren(), - isClean()); - common_ = null; - } - return commonBuilder_; - } - - // repeated string endpoints = 2; - private com.google.protobuf.LazyStringList endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureEndpointsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - endpoints_ = new com.google.protobuf.LazyStringArrayList(endpoints_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated string endpoints = 2; - */ - public java.util.List - getEndpointsList() { - return java.util.Collections.unmodifiableList(endpoints_); - } - /** - * repeated string endpoints = 2; - */ - public int getEndpointsCount() { - return endpoints_.size(); - } - /** - * repeated string endpoints = 2; - */ - public java.lang.String getEndpoints(int index) { - return endpoints_.get(index); - } - /** - * repeated string endpoints = 2; - */ - public com.google.protobuf.ByteString - getEndpointsBytes(int index) { - return endpoints_.getByteString(index); - } - /** - * repeated string endpoints = 2; - */ - public Builder setEndpoints( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointsIsMutable(); - endpoints_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string endpoints = 2; - */ - public Builder addEndpoints( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointsIsMutable(); - endpoints_.add(value); - onChanged(); - return this; - } - /** - * repeated string endpoints = 2; - */ - public Builder addAllEndpoints( - java.lang.Iterable values) { - ensureEndpointsIsMutable(); - super.addAll(values, endpoints_); - onChanged(); - return this; - } - /** - * repeated string endpoints = 2; - */ - public Builder clearEndpoints() { - endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * repeated string endpoints = 2; - */ - public Builder addEndpointsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointsIsMutable(); - endpoints_.add(value); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) - } - - static { - defaultInstance = new ListPeersResponse(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) - } - - public interface SetLeaderRequestOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required string endpoint = 1; - /** - * required string endpoint = 1; - */ - boolean hasEndpoint(); - /** - * required string endpoint = 1; - */ - java.lang.String getEndpoint(); - /** - * required string endpoint = 1; - */ - com.google.protobuf.ByteString - getEndpointBytes(); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest} - */ - public static final class SetLeaderRequest extends - com.google.protobuf.GeneratedMessage - implements SetLeaderRequestOrBuilder { - // Use SetLeaderRequest.newBuilder() to construct. - private SetLeaderRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private SetLeaderRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final SetLeaderRequest defaultInstance; - public static SetLeaderRequest getDefaultInstance() { - return defaultInstance; - } - - public SetLeaderRequest getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SetLeaderRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - endpoint_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SetLeaderRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SetLeaderRequest(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required string endpoint = 1; - public static final int ENDPOINT_FIELD_NUMBER = 1; - private java.lang.Object endpoint_; - /** - * required string endpoint = 1; - */ - public boolean hasEndpoint() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required string endpoint = 1; - */ - public java.lang.String getEndpoint() { - java.lang.Object ref = endpoint_; - 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 (bs.isValidUtf8()) { - endpoint_ = s; - } - return s; - } - } - /** - * required string endpoint = 1; - */ - public com.google.protobuf.ByteString - getEndpointBytes() { - java.lang.Object ref = endpoint_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - endpoint_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasEndpoint()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getEndpointBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getEndpointBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - endpoint_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.endpoint_ = endpoint_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.getDefaultInstance()) return this; - if (other.hasEndpoint()) { - bitField0_ |= 0x00000001; - endpoint_ = other.endpoint_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasEndpoint()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required string endpoint = 1; - private java.lang.Object endpoint_ = ""; - /** - * required string endpoint = 1; - */ - public boolean hasEndpoint() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required string endpoint = 1; - */ - public java.lang.String getEndpoint() { - java.lang.Object ref = endpoint_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - endpoint_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * required string endpoint = 1; - */ - public com.google.protobuf.ByteString - getEndpointBytes() { - java.lang.Object ref = endpoint_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * required string endpoint = 1; - */ - public Builder setEndpoint( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - endpoint_ = value; - onChanged(); - return this; - } - /** - * required string endpoint = 1; - */ - public Builder clearEndpoint() { - bitField0_ = (bitField0_ & ~0x00000001); - endpoint_ = getDefaultInstance().getEndpoint(); - onChanged(); - return this; - } - /** - * required string endpoint = 1; - */ - public Builder setEndpointBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - endpoint_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) - } - - static { - defaultInstance = new SetLeaderRequest(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) - } - - public interface SetLeaderResponseOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - boolean hasCommon(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon(); - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder(); - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse} - */ - public static final class SetLeaderResponse extends - com.google.protobuf.GeneratedMessage - implements SetLeaderResponseOrBuilder { - // Use SetLeaderResponse.newBuilder() to construct. - private SetLeaderResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private SetLeaderResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final SetLeaderResponse defaultInstance; - public static SetLeaderResponse getDefaultInstance() { - return defaultInstance; - } - - public SetLeaderResponse getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SetLeaderResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = common_.toBuilder(); - } - common_ = input.readMessage(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(common_); - common_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public SetLeaderResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SetLeaderResponse(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - public static final int COMMON_FIELD_NUMBER = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public boolean hasCommon() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { - return common_; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { - return common_; - } - - private void initFields() { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasCommon()) { - memoizedIsInitialized = 0; - return false; - } - if (!getCommon().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, common_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, common_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.Builder.class); - } - - // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getCommonFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (commonBuilder_ == null) { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - } else { - commonBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse getDefaultInstanceForType() { - return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.getDefaultInstance(); - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse build() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse buildPartial() { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse) { - return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse other) { - if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.getDefaultInstance()) return this; - if (other.hasCommon()) { - mergeCommon(other.getCommon()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasCommon()) { - - return false; - } - if (!getCommon().isInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - // required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> commonBuilder_; - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public boolean hasCommon() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { - if (commonBuilder_ == null) { - return common_; - } else { - return commonBuilder_.getMessage(); - } - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder setCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { - if (commonBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - common_ = value; - onChanged(); - } else { - commonBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder setCommon( - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder builderForValue) { - if (commonBuilder_ == null) { - common_ = builderForValue.build(); - onChanged(); - } else { - commonBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder mergeCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { - if (commonBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - common_ != com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) { - common_ = - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder(common_).mergeFrom(value).buildPartial(); - } else { - common_ = value; - } - onChanged(); - } else { - commonBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); - onChanged(); - } else { - commonBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder getCommonBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getCommonFieldBuilder().getBuilder(); - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { - if (commonBuilder_ != null) { - return commonBuilder_.getMessageOrBuilder(); - } else { - return common_; - } - } - /** - * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> - getCommonFieldBuilder() { - if (commonBuilder_ == null) { - commonBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder>( - common_, - getParentForChildren(), - isClean()); - common_ = null; - } - return commonBuilder_; - } - - // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) - } - - static { - defaultInstance = new SetLeaderResponse(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) - } - - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_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,hugegraph-core/src/main/resources/raft" + - ".proto\022*com.baidu.hugegraph.backend.stor" + - "e.raft.rpc\"\261\001\n\023StoreCommandRequest\022C\n\004ty" + - "pe\030\001 \002(\01625.com.baidu.hugegraph.backend.s" + - "tore.raft.rpc.StoreType\022G\n\006action\030\002 \002(\0162" + - "7.com.baidu.hugegraph.backend.store.raft" + - ".rpc.StoreAction\022\014\n\004data\030\003 \002(\014\"7\n\024StoreC" + - "ommandResponse\022\016\n\006status\030\001 \002(\010\022\017\n\007messag" + - "e\030\002 \001(\t\"1\n\016CommonResponse\022\016\n\006status\030\001 \002(" + - "\010\022\017\n\007message\030\002 \001(\t\"\022\n\020ListPeersRequest\"r", - "\n\021ListPeersResponse\022J\n\006common\030\001 \002(\0132:.co" + - "m.baidu.hugegraph.backend.store.raft.rpc" + - ".CommonResponse\022\021\n\tendpoints\030\002 \003(\t\"$\n\020Se" + - "tLeaderRequest\022\020\n\010endpoint\030\001 \002(\t\"_\n\021SetL" + - "eaderResponse\022J\n\006common\030\001 \002(\0132:.com.baid" + - "u.hugegraph.backend.store.raft.rpc.Commo" + - "nResponse*7\n\tStoreType\022\n\n\006SCHEMA\020\000\022\t\n\005GR" + - "APH\020\001\022\n\n\006SYSTEM\020\002\022\007\n\003ALL\020\003*\237\001\n\013StoreActi" + - "on\022\010\n\004NONE\020\000\022\010\n\004INIT\020\001\022\t\n\005CLEAR\020\002\022\014\n\010TRU" + - "NCATE\020\003\022\014\n\010SNAPSHOT\020\004\022\014\n\010BEGIN_TX\020\n\022\r\n\tC", - "OMMIT_TX\020\013\022\017\n\013ROLLBACK_TX\020\014\022\n\n\006MUTATE\020\024\022" + - "\020\n\014INCR_COUNTER\020\025\022\t\n\005QUERY\020\036B:\n*com.baid" + - "u.hugegraph.backend.store.raft.rpcB\014Raft" + - "Requests" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor, - new java.lang.String[] { "Type", "Action", "Data", }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor, - new java.lang.String[] { "Status", "Message", }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor, - new java.lang.String[] { "Status", "Message", }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor, - new java.lang.String[] { }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor, - new java.lang.String[] { "Common", "Endpoints", }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor, - new java.lang.String[] { "Endpoint", }); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor, - new java.lang.String[] { "Common", }); - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java index 2c93d113ee..7d10eb8d38 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java @@ -37,9 +37,6 @@ import com.baidu.hugegraph.backend.store.raft.RaftClosure; import com.baidu.hugegraph.backend.store.raft.RaftStoreClosure; import com.baidu.hugegraph.backend.store.raft.StoreCommand; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Descriptors.FieldDescriptor; @@ -68,16 +65,18 @@ public void forwardToLeader(PeerId leaderId, StoreCommand command, LOG.debug("The node {} forward request to leader {}", this.nodeId, leaderId); - StoreCommandRequest.Builder builder = StoreCommandRequest.newBuilder(); + RaftRequests.StoreCommandRequest.Builder builder = + RaftRequests.StoreCommandRequest.newBuilder(); + builder.setType(command.type()); builder.setAction(command.action()); builder.setData(ZeroByteStringHelper.wrap(command.data())); - StoreCommandRequest request = builder.build(); + RaftRequests.StoreCommandRequest request = builder.build(); - RpcResponseClosure responseClosure; - responseClosure = new RpcResponseClosure() { + RpcResponseClosure responseClosure; + responseClosure = new RpcResponseClosure() { @Override - public void setResponse(StoreCommandResponse response) { + public void setResponse(RaftRequests.StoreCommandResponse response) { if (response.getStatus()) { LOG.debug("StoreCommandResponse status ok"); future.complete(Status.OK(), () -> null); @@ -118,11 +117,11 @@ public void setResponse(T response) { FieldDescriptor fd = response.getDescriptorForType() .findFieldByName("common"); Object object = response.getField(fd); - E.checkState(object instanceof CommonResponse, + E.checkState(object instanceof RaftRequests.CommonResponse, "The common field must be instance of " + "CommonResponse, actual is '%s'", object != null ? object.getClass() : null); - CommonResponse commonResponse = (CommonResponse) object; + RaftRequests.CommonResponse commonResponse = (RaftRequests.CommonResponse) object; if (commonResponse.getStatus()) { future.complete(Status.OK(), () -> response); } else { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java index f110537ffb..4dd3b3e6fb 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java @@ -25,14 +25,11 @@ import com.alipay.sofa.jraft.rpc.RpcRequestProcessor; import com.baidu.hugegraph.backend.store.raft.RaftGroupManager; import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Message; public class SetLeaderProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger(SetLeaderProcessor.class); @@ -44,28 +41,31 @@ public SetLeaderProcessor(RaftSharedContext context) { } @Override - public Message processRequest(SetLeaderRequest request, + public Message processRequest(RaftRequests.SetLeaderRequest request, RpcRequestClosure done) { LOG.debug("Processing SetLeaderRequest {}", request.getClass()); RaftGroupManager nodeManager = this.context.raftNodeManager( RaftSharedContext.DEFAULT_GROUP); try { nodeManager.setLeader(request.getEndpoint()); - CommonResponse common = CommonResponse.newBuilder() - .setStatus(true) - .build(); - return SetLeaderResponse.newBuilder().setCommon(common).build(); + RaftRequests.CommonResponse common = RaftRequests.CommonResponse.newBuilder() + .setStatus(true) + .build(); + return RaftRequests.SetLeaderResponse.newBuilder().setCommon(common).build(); } catch (Throwable e) { - CommonResponse common = CommonResponse.newBuilder() - .setStatus(false) - .setMessage(e.toString()) - .build(); - return SetLeaderResponse.newBuilder().setCommon(common).build(); + + RaftRequests.CommonResponse common = + RaftRequests.CommonResponse.newBuilder() + .setStatus(false) + .setMessage(e.toString()) + .build(); + + return RaftRequests.SetLeaderResponse.newBuilder().setCommon(common).build(); } } @Override public String interest() { - return SetLeaderRequest.class.getName(); + return RaftRequests.SetLeaderRequest.class.getName(); } } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java index 13ce2cfb8e..ccbdc932ec 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java @@ -27,15 +27,11 @@ import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; import com.baidu.hugegraph.backend.store.raft.RaftStoreClosure; import com.baidu.hugegraph.backend.store.raft.StoreCommand; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Message; public class StoreCommandProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger( StoreCommandProcessor.class); @@ -48,7 +44,7 @@ public StoreCommandProcessor(RaftSharedContext context) { } @Override - public Message processRequest(StoreCommandRequest request, + public Message processRequest(RaftRequests.StoreCommandRequest request, RpcRequestClosure done) { LOG.debug("Processing StoreCommandRequest: {}", request.getAction()); RaftNode node = this.context.node(); @@ -57,11 +53,11 @@ public Message processRequest(StoreCommandRequest request, RaftStoreClosure closure = new RaftStoreClosure(command); node.submitAndWait(command, closure); // TODO: return the submitAndWait() result to rpc client - return StoreCommandResponse.newBuilder().setStatus(true).build(); + return RaftRequests.StoreCommandResponse.newBuilder().setStatus(true).build(); } catch (Throwable e) { LOG.warn("Failed to process StoreCommandRequest: {}", request.getAction(), e); - StoreCommandResponse.Builder builder = StoreCommandResponse + RaftRequests.StoreCommandResponse.Builder builder = RaftRequests.StoreCommandResponse .newBuilder() .setStatus(false); if (e.getMessage() != null) { @@ -73,12 +69,13 @@ public Message processRequest(StoreCommandRequest request, @Override public String interest() { - return StoreCommandRequest.class.getName(); + return RaftRequests.StoreCommandRequest.class.getName(); } - private StoreCommand parseStoreCommand(StoreCommandRequest request) { - StoreType type = request.getType(); - StoreAction action = request.getAction(); + private StoreCommand parseStoreCommand( + RaftRequests.StoreCommandRequest request) { + RaftRequests.StoreType type = request.getType(); + RaftRequests.StoreAction action = request.getAction(); byte[] data = request.getData().toByteArray(); return new StoreCommand(type, action, data, true); } diff --git a/hugegraph-core/src/main/resources/raft.proto b/hugegraph-core/src/main/resources/proto/raft.proto similarity index 100% rename from hugegraph-core/src/main/resources/raft.proto rename to hugegraph-core/src/main/resources/proto/raft.proto diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java index 21dd2ddf05..5b6bfd0970 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java @@ -28,10 +28,9 @@ import com.baidu.hugegraph.backend.store.BackendAction; import com.baidu.hugegraph.backend.store.BackendEntry; import com.baidu.hugegraph.backend.store.BackendMutation; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.backend.store.raft.StoreCommand; import com.baidu.hugegraph.backend.store.raft.StoreSerializer; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.testutil.Assert; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.type.define.Action; @@ -77,15 +76,15 @@ public void testSerializeStoreCommand() { origin.add(entry, Action.INSERT); byte[] mutationBytes = StoreSerializer.writeMutation(origin); - StoreCommand command = new StoreCommand(StoreType.GRAPH, - StoreAction.MUTATE, + StoreCommand command = new StoreCommand(RaftRequests.StoreType.GRAPH, + RaftRequests.StoreAction.MUTATE, mutationBytes); - Assert.assertEquals(StoreAction.MUTATE, command.action()); + Assert.assertEquals(RaftRequests.StoreAction.MUTATE, command.action()); Assert.assertArrayEquals(mutationBytes, command.data()); byte[] commandBytes = command.data(); StoreCommand actual = StoreCommand.fromBytes(commandBytes); - Assert.assertEquals(StoreType.GRAPH, command.type()); + Assert.assertEquals(RaftRequests.StoreType.GRAPH, command.type()); Assert.assertEquals(command.action(), actual.action()); Assert.assertArrayEquals(command.data(), actual.data()); } diff --git a/pom.xml b/pom.xml index 398875f235..4910e7a333 100644 --- a/pom.xml +++ b/pom.xml @@ -106,7 +106,11 @@ 4.2.4 3.21.0-GA bash - 3.1.2 + 3.1.2 + 8.45 + + 1.6.1 + 3.3.0 hugegraph-core @@ -271,6 +275,32 @@ javassist ${javassist.version} + + + + io.grpc + grpc-netty + ${grpc.version} + provided + + + io.grpc + grpc-protobuf + ${grpc.version} + provided + + + io.grpc + grpc-stub + ${grpc.version} + provided + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + @@ -350,12 +380,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - ${checkstyle.version} + ${checkstyle.plugin.version} com.puppycrawl.tools checkstyle - 8.45 + ${checkstyle.version} From 650de1b90d89da7747bc3d8630f10af8b9a6a3a1 Mon Sep 17 00:00:00 2001 From: seagle Date: Sun, 15 May 2022 18:36:36 +0800 Subject: [PATCH 2/7] fix protobuf checkstyle issue --- hugegraph-core/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hugegraph-core/pom.xml b/hugegraph-core/pom.xml index 52abd5755d..14bb12543a 100644 --- a/hugegraph-core/pom.xml +++ b/hugegraph-core/pom.xml @@ -256,7 +256,6 @@ - org.xolstice.maven.plugins protobuf-maven-plugin @@ -264,7 +263,7 @@ com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} protoc-java - ${project.basedir}/src/main/resources + ${project.basedir}/src/main/resources/proto ${project.basedir}/src/protobuf/java From 66b10ca34d5661f4c4e86a2dd8be2c6d1f2b5bb6 Mon Sep 17 00:00:00 2001 From: seagle Date: Sun, 15 May 2022 18:37:15 +0800 Subject: [PATCH 3/7] fix protobuf checkstyle issue --- .../backend/store/raft/rpc/RaftRequests.java | 4756 +++++++++++++++++ 1 file changed, 4756 insertions(+) create mode 100644 hugegraph-core/src/protobuf/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java diff --git a/hugegraph-core/src/protobuf/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java b/hugegraph-core/src/protobuf/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java new file mode 100644 index 0000000000..44e0d202b8 --- /dev/null +++ b/hugegraph-core/src/protobuf/java/com/baidu/hugegraph/backend/store/raft/rpc/RaftRequests.java @@ -0,0 +1,4756 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: raft.proto + +package com.baidu.hugegraph.backend.store.raft.rpc; + +public final class RaftRequests { + private RaftRequests() {} + 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 com.baidu.hugegraph.backend.store.raft.rpc.StoreType} + */ + public enum StoreType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SCHEMA = 0; + */ + SCHEMA(0), + /** + * GRAPH = 1; + */ + GRAPH(1), + /** + * SYSTEM = 2; + */ + SYSTEM(2), + /** + * ALL = 3; + */ + ALL(3), + ; + + /** + * SCHEMA = 0; + */ + public static final int SCHEMA_VALUE = 0; + /** + * GRAPH = 1; + */ + public static final int GRAPH_VALUE = 1; + /** + * SYSTEM = 2; + */ + public static final int SYSTEM_VALUE = 2; + /** + * ALL = 3; + */ + public static final int ALL_VALUE = 3; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StoreType valueOf(int value) { + return forNumber(value); + } + + public static StoreType forNumber(int value) { + switch (value) { + case 0: return SCHEMA; + case 1: return GRAPH; + case 2: return SYSTEM; + case 3: return ALL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StoreType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StoreType findValueByNumber(int number) { + return StoreType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.getDescriptor().getEnumTypes().get(0); + } + + private static final StoreType[] VALUES = values(); + + public static StoreType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StoreType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreType) + } + + /** + * Protobuf enum {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreAction} + */ + public enum StoreAction + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 0; + */ + NONE(0), + /** + * INIT = 1; + */ + INIT(1), + /** + * CLEAR = 2; + */ + CLEAR(2), + /** + * TRUNCATE = 3; + */ + TRUNCATE(3), + /** + * SNAPSHOT = 4; + */ + SNAPSHOT(4), + /** + * BEGIN_TX = 10; + */ + BEGIN_TX(10), + /** + * COMMIT_TX = 11; + */ + COMMIT_TX(11), + /** + * ROLLBACK_TX = 12; + */ + ROLLBACK_TX(12), + /** + * MUTATE = 20; + */ + MUTATE(20), + /** + * INCR_COUNTER = 21; + */ + INCR_COUNTER(21), + /** + * QUERY = 30; + */ + QUERY(30), + ; + + /** + * NONE = 0; + */ + public static final int NONE_VALUE = 0; + /** + * INIT = 1; + */ + public static final int INIT_VALUE = 1; + /** + * CLEAR = 2; + */ + public static final int CLEAR_VALUE = 2; + /** + * TRUNCATE = 3; + */ + public static final int TRUNCATE_VALUE = 3; + /** + * SNAPSHOT = 4; + */ + public static final int SNAPSHOT_VALUE = 4; + /** + * BEGIN_TX = 10; + */ + public static final int BEGIN_TX_VALUE = 10; + /** + * COMMIT_TX = 11; + */ + public static final int COMMIT_TX_VALUE = 11; + /** + * ROLLBACK_TX = 12; + */ + public static final int ROLLBACK_TX_VALUE = 12; + /** + * MUTATE = 20; + */ + public static final int MUTATE_VALUE = 20; + /** + * INCR_COUNTER = 21; + */ + public static final int INCR_COUNTER_VALUE = 21; + /** + * QUERY = 30; + */ + public static final int QUERY_VALUE = 30; + + + public final int getNumber() { + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StoreAction valueOf(int value) { + return forNumber(value); + } + + public static StoreAction forNumber(int value) { + switch (value) { + case 0: return NONE; + case 1: return INIT; + case 2: return CLEAR; + case 3: return TRUNCATE; + case 4: return SNAPSHOT; + case 10: return BEGIN_TX; + case 11: return COMMIT_TX; + case 12: return ROLLBACK_TX; + case 20: return MUTATE; + case 21: return INCR_COUNTER; + case 30: return QUERY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StoreAction> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StoreAction findValueByNumber(int number) { + return StoreAction.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.getDescriptor().getEnumTypes().get(1); + } + + private static final StoreAction[] VALUES = values(); + + public static StoreAction valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StoreAction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreAction) + } + + public interface StoreCommandRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + boolean hasType(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType(); + + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + boolean hasAction(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction(); + + /** + * required bytes data = 3; + */ + boolean hasData(); + /** + * required bytes data = 3; + */ + com.google.protobuf.ByteString getData(); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest} + */ + public static final class StoreCommandRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) + StoreCommandRequestOrBuilder { + // Use StoreCommandRequest.newBuilder() to construct. + private StoreCommandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoreCommandRequest() { + type_ = 0; + action_ = 0; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoreCommandRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType value = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = rawValue; + } + break; + } + case 16: { + int rawValue = input.readEnum(); + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction value = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + action_ = rawValue; + } + break; + } + case 26: { + bitField0_ |= 0x00000004; + data_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.Builder.class); + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType result = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.valueOf(type_); + return result == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA : result; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private int action_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public boolean hasAction() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction result = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.valueOf(action_); + return result == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE : result; + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString data_; + /** + * required bytes data = 3; + */ + public boolean hasData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes data = 3; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasAction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasData()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, action_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, data_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, action_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest) obj; + + boolean result = true; + result = result && (hasType() == other.hasType()); + if (hasType()) { + result = result && type_ == other.type_; + } + result = result && (hasAction() == other.hasAction()); + if (hasAction()) { + result = result && action_ == other.action_; + } + result = result && (hasData() == other.hasData()); + if (hasData()) { + result = result && getData() + .equals(other.getData()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasAction()) { + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + } + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + action_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + data_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.action_ = action_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.data_ = data_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasAction()) { + setAction(other.getAction()); + } + if (other.hasData()) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasType()) { + return false; + } + if (!hasAction()) { + return false; + } + if (!hasData()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int type_ = 0; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType getType() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType result = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.valueOf(type_); + return result == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType.SCHEMA : result; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public Builder setType(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreType type = 1; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int action_ = 0; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public boolean hasAction() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction getAction() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction result = com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.valueOf(action_); + return result == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction.NONE : result; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public Builder setAction(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.StoreAction action = 2; + */ + public Builder clearAction() { + bitField0_ = (bitField0_ & ~0x00000002); + action_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes data = 3; + */ + public boolean hasData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes data = 3; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * required bytes data = 3; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + data_ = value; + onChanged(); + return this; + } + /** + * required bytes data = 3; + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000004); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandRequest) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoreCommandRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoreCommandRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StoreCommandResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required bool status = 1; + */ + boolean hasStatus(); + /** + * required bool status = 1; + */ + boolean getStatus(); + + /** + * optional string message = 2; + */ + boolean hasMessage(); + /** + * optional string message = 2; + */ + java.lang.String getMessage(); + /** + * optional string message = 2; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse} + */ + public static final class StoreCommandResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) + StoreCommandResponseOrBuilder { + // Use StoreCommandResponse.newBuilder() to construct. + private StoreCommandResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoreCommandResponse() { + status_ = false; + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoreCommandResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + status_ = input.readBool(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private boolean status_; + /** + * required bool status = 1; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool status = 1; + */ + public boolean getStatus() { + return status_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * optional string message = 2; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string message = 2; + */ + 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(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * optional string message = 2; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasStatus()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, status_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, status_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse) obj; + + boolean result = true; + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && (getStatus() + == other.getStatus()); + } + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + } + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + status_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse.getDefaultInstance()) return this; + if (other.hasStatus()) { + setStatus(other.getStatus()); + } + if (other.hasMessage()) { + bitField0_ |= 0x00000002; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasStatus()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private boolean status_ ; + /** + * required bool status = 1; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool status = 1; + */ + public boolean getStatus() { + return status_; + } + /** + * required bool status = 1; + */ + public Builder setStatus(boolean value) { + bitField0_ |= 0x00000001; + status_ = value; + onChanged(); + return this; + } + /** + * required bool status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = false; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * optional string message = 2; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string message = 2; + */ + 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(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string message = 2; + */ + 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; + } + } + /** + * optional string message = 2; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + message_ = value; + onChanged(); + return this; + } + /** + * optional string message = 2; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000002); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * optional string message = 2; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandResponse) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public StoreCommandResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoreCommandResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommonResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required bool status = 1; + */ + boolean hasStatus(); + /** + * required bool status = 1; + */ + boolean getStatus(); + + /** + * optional string message = 2; + */ + boolean hasMessage(); + /** + * optional string message = 2; + */ + java.lang.String getMessage(); + /** + * optional string message = 2; + */ + com.google.protobuf.ByteString + getMessageBytes(); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse} + */ + public static final class CommonResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) + CommonResponseOrBuilder { + // Use CommonResponse.newBuilder() to construct. + private CommonResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommonResponse() { + status_ = false; + message_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommonResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + status_ = input.readBool(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + message_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private boolean status_; + /** + * required bool status = 1; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool status = 1; + */ + public boolean getStatus() { + return status_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * optional string message = 2; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string message = 2; + */ + 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(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } + } + /** + * optional string message = 2; + */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasStatus()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, status_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, status_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse) obj; + + boolean result = true; + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && (getStatus() + == other.getStatus()); + } + result = result && (hasMessage() == other.hasMessage()); + if (hasMessage()) { + result = result && getMessage() + .equals(other.getMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStatus()); + } + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + status_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + message_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.status_ = status_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.message_ = message_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) return this; + if (other.hasStatus()) { + setStatus(other.getStatus()); + } + if (other.hasMessage()) { + bitField0_ |= 0x00000002; + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasStatus()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private boolean status_ ; + /** + * required bool status = 1; + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool status = 1; + */ + public boolean getStatus() { + return status_; + } + /** + * required bool status = 1; + */ + public Builder setStatus(boolean value) { + bitField0_ |= 0x00000001; + status_ = value; + onChanged(); + return this; + } + /** + * required bool status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = false; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * optional string message = 2; + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string message = 2; + */ + 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(); + if (bs.isValidUtf8()) { + message_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string message = 2; + */ + 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; + } + } + /** + * optional string message = 2; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + message_ = value; + onChanged(); + return this; + } + /** + * optional string message = 2; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000002); + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * optional string message = 2; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + message_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public CommonResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommonResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListPeersRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) + com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest} + */ + public static final class ListPeersRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) + ListPeersRequestOrBuilder { + // Use ListPeersRequest.newBuilder() to construct. + private ListPeersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPeersRequest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPeersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.Builder.class); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest(this); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersRequest) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListPeersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPeersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListPeersResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + boolean hasCommon(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder(); + + /** + * repeated string endpoints = 2; + */ + java.util.List + getEndpointsList(); + /** + * repeated string endpoints = 2; + */ + int getEndpointsCount(); + /** + * repeated string endpoints = 2; + */ + java.lang.String getEndpoints(int index); + /** + * repeated string endpoints = 2; + */ + com.google.protobuf.ByteString + getEndpointsBytes(int index); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse} + */ + public static final class ListPeersResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) + ListPeersResponseOrBuilder { + // Use ListPeersResponse.newBuilder() to construct. + private ListPeersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPeersResponse() { + endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPeersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = common_.toBuilder(); + } + common_ = input.readMessage(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(common_); + common_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + endpoints_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + endpoints_.add(bs); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + endpoints_ = endpoints_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.Builder.class); + } + + private int bitField0_; + public static final int COMMON_FIELD_NUMBER = 1; + private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + + public static final int ENDPOINTS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList endpoints_; + /** + * repeated string endpoints = 2; + */ + public com.google.protobuf.ProtocolStringList + getEndpointsList() { + return endpoints_; + } + /** + * repeated string endpoints = 2; + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * repeated string endpoints = 2; + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * repeated string endpoints = 2; + */ + public com.google.protobuf.ByteString + getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasCommon()) { + memoizedIsInitialized = 0; + return false; + } + if (!getCommon().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getCommon()); + } + for (int i = 0; i < endpoints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpoints_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + { + int dataSize = 0; + for (int i = 0; i < endpoints_.size(); i++) { + dataSize += computeStringSizeNoTag(endpoints_.getRaw(i)); + } + size += dataSize; + size += 1 * getEndpointsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse) obj; + + boolean result = true; + result = result && (hasCommon() == other.hasCommon()); + if (hasCommon()) { + result = result && getCommon() + .equals(other.getCommon()); + } + result = result && getEndpointsList() + .equals(other.getEndpointsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCommonFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (commonBuilder_ == null) { + common_ = null; + } else { + commonBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (commonBuilder_ == null) { + result.common_ = common_; + } else { + result.common_ = commonBuilder_.build(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + endpoints_ = endpoints_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.endpoints_ = endpoints_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasCommon()) { + return false; + } + if (!getCommon().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> commonBuilder_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder setCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + onChanged(); + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder setCommon( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + onChanged(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder mergeCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + common_ != null && + common_ != com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) { + common_ = + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder(common_).mergeFrom(value).buildPartial(); + } else { + common_ = value; + } + onChanged(); + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder clearCommon() { + if (commonBuilder_ == null) { + common_ = null; + onChanged(); + } else { + commonBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + + private com.google.protobuf.LazyStringList endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + endpoints_ = new com.google.protobuf.LazyStringArrayList(endpoints_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated string endpoints = 2; + */ + public com.google.protobuf.ProtocolStringList + getEndpointsList() { + return endpoints_.getUnmodifiableView(); + } + /** + * repeated string endpoints = 2; + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * repeated string endpoints = 2; + */ + public java.lang.String getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * repeated string endpoints = 2; + */ + public com.google.protobuf.ByteString + getEndpointsBytes(int index) { + return endpoints_.getByteString(index); + } + /** + * repeated string endpoints = 2; + */ + public Builder setEndpoints( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string endpoints = 2; + */ + public Builder addEndpoints( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + return this; + } + /** + * repeated string endpoints = 2; + */ + public Builder addAllEndpoints( + java.lang.Iterable values) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, endpoints_); + onChanged(); + return this; + } + /** + * repeated string endpoints = 2; + */ + public Builder clearEndpoints() { + endpoints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * repeated string endpoints = 2; + */ + public Builder addEndpointsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.ListPeersResponse) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ListPeersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPeersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SetLeaderRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * required string endpoint = 1; + */ + boolean hasEndpoint(); + /** + * required string endpoint = 1; + */ + java.lang.String getEndpoint(); + /** + * required string endpoint = 1; + */ + com.google.protobuf.ByteString + getEndpointBytes(); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest} + */ + public static final class SetLeaderRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) + SetLeaderRequestOrBuilder { + // Use SetLeaderRequest.newBuilder() to construct. + private SetLeaderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SetLeaderRequest() { + endpoint_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SetLeaderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + endpoint_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.Builder.class); + } + + private int bitField0_; + public static final int ENDPOINT_FIELD_NUMBER = 1; + private volatile java.lang.Object endpoint_; + /** + * required string endpoint = 1; + */ + public boolean hasEndpoint() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string endpoint = 1; + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + 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 (bs.isValidUtf8()) { + endpoint_ = s; + } + return s; + } + } + /** + * required string endpoint = 1; + */ + public com.google.protobuf.ByteString + getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasEndpoint()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest) obj; + + boolean result = true; + result = result && (hasEndpoint() == other.hasEndpoint()); + if (hasEndpoint()) { + result = result && getEndpoint() + .equals(other.getEndpoint()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEndpoint()) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + endpoint_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.endpoint_ = endpoint_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest.getDefaultInstance()) return this; + if (other.hasEndpoint()) { + bitField0_ |= 0x00000001; + endpoint_ = other.endpoint_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasEndpoint()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * required string endpoint = 1; + */ + public boolean hasEndpoint() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string endpoint = 1; + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + endpoint_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string endpoint = 1; + */ + public com.google.protobuf.ByteString + getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string endpoint = 1; + */ + public Builder setEndpoint( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + endpoint_ = value; + onChanged(); + return this; + } + /** + * required string endpoint = 1; + */ + public Builder clearEndpoint() { + bitField0_ = (bitField0_ & ~0x00000001); + endpoint_ = getDefaultInstance().getEndpoint(); + onChanged(); + return this; + } + /** + * required string endpoint = 1; + */ + public Builder setEndpointBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + endpoint_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderRequest) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SetLeaderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetLeaderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SetLeaderResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + boolean hasCommon(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon(); + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder(); + } + /** + * Protobuf type {@code com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse} + */ + public static final class SetLeaderResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) + SetLeaderResponseOrBuilder { + // Use SetLeaderResponse.newBuilder() to construct. + private SetLeaderResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SetLeaderResponse() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SetLeaderResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = common_.toBuilder(); + } + common_ = input.readMessage(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(common_); + common_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.Builder.class); + } + + private int bitField0_; + public static final int COMMON_FIELD_NUMBER = 1; + private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasCommon()) { + memoizedIsInitialized = 0; + return false; + } + if (!getCommon().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getCommon()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCommon()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse)) { + return super.equals(obj); + } + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse other = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse) obj; + + boolean result = true; + result = result && (hasCommon() == other.hasCommon()); + if (hasCommon()) { + result = result && getCommon() + .equals(other.getCommon()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse 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 com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + 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 com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.class, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.Builder.class); + } + + // Construct using com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCommonFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (commonBuilder_ == null) { + common_ = null; + } else { + commonBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse getDefaultInstanceForType() { + return com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.getDefaultInstance(); + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse build() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse buildPartial() { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse result = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (commonBuilder_ == null) { + result.common_ = common_; + } else { + result.common_ = commonBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse) { + return mergeFrom((com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse other) { + if (other == com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (!hasCommon()) { + return false; + } + if (!getCommon().isInitialized()) { + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse common_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> commonBuilder_; + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse getCommon() { + if (commonBuilder_ == null) { + return common_ == null ? com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder setCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + onChanged(); + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder setCommon( + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + onChanged(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder mergeCommon(com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + common_ != null && + common_ != com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance()) { + common_ = + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.newBuilder(common_).mergeFrom(value).buildPartial(); + } else { + common_ = value; + } + onChanged(); + } else { + commonBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public Builder clearCommon() { + if (commonBuilder_ == null) { + common_ = null; + onChanged(); + } else { + commonBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null ? + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.getDefaultInstance() : common_; + } + } + /** + * required .com.baidu.hugegraph.backend.store.raft.rpc.CommonResponse common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse.Builder, com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponseOrBuilder>( + getCommon(), + getParentForChildren(), + isClean()); + common_ = null; + } + return commonBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) + } + + // @@protoc_insertion_point(class_scope:com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderResponse) + private static final com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse(); + } + + public static com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SetLeaderResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetLeaderResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_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\nraft.proto\022*com.baidu.hugegraph.backen" + + "d.store.raft.rpc\"\261\001\n\023StoreCommandRequest" + + "\022C\n\004type\030\001 \002(\01625.com.baidu.hugegraph.bac" + + "kend.store.raft.rpc.StoreType\022G\n\006action\030" + + "\002 \002(\01627.com.baidu.hugegraph.backend.stor" + + "e.raft.rpc.StoreAction\022\014\n\004data\030\003 \002(\014\"7\n\024" + + "StoreCommandResponse\022\016\n\006status\030\001 \002(\010\022\017\n\007" + + "message\030\002 \001(\t\"1\n\016CommonResponse\022\016\n\006statu" + + "s\030\001 \002(\010\022\017\n\007message\030\002 \001(\t\"\022\n\020ListPeersReq" + + "uest\"r\n\021ListPeersResponse\022J\n\006common\030\001 \002(", + "\0132:.com.baidu.hugegraph.backend.store.ra" + + "ft.rpc.CommonResponse\022\021\n\tendpoints\030\002 \003(\t" + + "\"$\n\020SetLeaderRequest\022\020\n\010endpoint\030\001 \002(\t\"_" + + "\n\021SetLeaderResponse\022J\n\006common\030\001 \002(\0132:.co" + + "m.baidu.hugegraph.backend.store.raft.rpc" + + ".CommonResponse*7\n\tStoreType\022\n\n\006SCHEMA\020\000" + + "\022\t\n\005GRAPH\020\001\022\n\n\006SYSTEM\020\002\022\007\n\003ALL\020\003*\237\001\n\013Sto" + + "reAction\022\010\n\004NONE\020\000\022\010\n\004INIT\020\001\022\t\n\005CLEAR\020\002\022" + + "\014\n\010TRUNCATE\020\003\022\014\n\010SNAPSHOT\020\004\022\014\n\010BEGIN_TX\020" + + "\n\022\r\n\tCOMMIT_TX\020\013\022\017\n\013ROLLBACK_TX\020\014\022\n\n\006MUT", + "ATE\020\024\022\020\n\014INCR_COUNTER\020\025\022\t\n\005QUERY\020\036B:\n*co" + + "m.baidu.hugegraph.backend.store.raft.rpc" + + "B\014RaftRequests" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandRequest_descriptor, + new java.lang.String[] { "Type", "Action", "Data", }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_StoreCommandResponse_descriptor, + new java.lang.String[] { "Status", "Message", }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_CommonResponse_descriptor, + new java.lang.String[] { "Status", "Message", }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersRequest_descriptor, + new java.lang.String[] { }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_ListPeersResponse_descriptor, + new java.lang.String[] { "Common", "Endpoints", }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderRequest_descriptor, + new java.lang.String[] { "Endpoint", }); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_baidu_hugegraph_backend_store_raft_rpc_SetLeaderResponse_descriptor, + new java.lang.String[] { "Common", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} From fe4bc24805fb69a1d7c8a04e8299f9e1f7622689 Mon Sep 17 00:00:00 2001 From: seagle Date: Mon, 16 May 2022 20:36:21 +0800 Subject: [PATCH 4/7] restore RaftRequests invoke --- .../backend/store/raft/RaftBackendStore.java | 17 ++++---- .../store/raft/RaftBackendStoreProvider.java | 13 +++--- .../store/raft/RaftGroupManagerImpl.java | 20 +++++---- .../backend/store/raft/RaftSharedContext.java | 16 ++++---- .../backend/store/raft/StoreCommand.java | 19 +++++---- .../backend/store/raft/StoreStateMachine.java | 17 ++++---- .../store/raft/rpc/ListPeersProcessor.java | 41 ++++++++++--------- .../backend/store/raft/rpc/RpcForwarder.java | 19 +++++---- .../store/raft/rpc/SetLeaderProcessor.java | 30 +++++++------- .../store/raft/rpc/StoreCommandProcessor.java | 21 ++++++---- 10 files changed, 112 insertions(+), 101 deletions(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java index 19999d65cf..06ddf9e20b 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStore.java @@ -36,7 +36,8 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.BackendStoreProvider; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.util.E; @@ -113,7 +114,7 @@ public void init() { public void clear(boolean clearSpace) { byte value = clearSpace ? (byte) 1 : (byte) 0; byte[] bytes = StoreCommand.wrap(value); - this.submitAndWait(RaftRequests.StoreAction.CLEAR, bytes); + this.submitAndWait(StoreAction.CLEAR, bytes); } @Override @@ -123,7 +124,7 @@ public boolean initialized() { @Override public void truncate() { - this.submitAndWait(RaftRequests.StoreAction.TRUNCATE, null); + this.submitAndWait(StoreAction.TRUNCATE, null); } @Override @@ -158,7 +159,7 @@ public void commitTx() { MutationBatch batch = this.getOrNewBatch(); try { byte[] bytes = StoreSerializer.writeMutations(batch.mutations); - this.submitAndWait(RaftRequests.StoreAction.COMMIT_TX, bytes); + this.submitAndWait(StoreAction.COMMIT_TX, bytes); } finally { batch.clear(); } @@ -166,7 +167,7 @@ public void commitTx() { @Override public void rollbackTx() { - this.submitAndWait(RaftRequests.StoreAction.ROLLBACK_TX, null); + this.submitAndWait(StoreAction.ROLLBACK_TX, null); } @Override @@ -183,7 +184,7 @@ public BackendFeatures features() { public void increaseCounter(HugeType type, long increment) { IncrCounter incrCounter = new IncrCounter(type, increment); byte[] bytes = StoreSerializer.writeIncrCounter(incrCounter); - this.submitAndWait(RaftRequests.StoreAction.INCR_COUNTER, bytes); + this.submitAndWait(StoreAction.INCR_COUNTER, bytes); } @Override @@ -193,8 +194,8 @@ public long getCounter(HugeType type) { return (Long) counter; } - private Object submitAndWait(RaftRequests.StoreAction action, byte[] data) { - RaftRequests.StoreType type = this.context.storeType(this.store()); + private Object submitAndWait(StoreAction action, byte[] data) { + StoreType type = this.context.storeType(this.store()); return this.submitAndWait(new StoreCommand(type, action, data)); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java index 95f79b6fc1..7e9ca5e66e 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftBackendStoreProvider.java @@ -29,7 +29,8 @@ import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.BackendStoreProvider; import com.baidu.hugegraph.backend.store.BackendStoreSystemInfo; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.event.EventHub; import com.baidu.hugegraph.event.EventListener; @@ -102,7 +103,7 @@ public synchronized BackendStore loadSchemaStore(HugeConfig config, String name) BackendStore store = this.provider.loadSchemaStore(config, name); this.checkNonSharedStore(store); this.schemaStore = new RaftBackendStore(store, this.context); - this.context.addStore(RaftRequests.StoreType.SCHEMA, this.schemaStore); + this.context.addStore(StoreType.SCHEMA, this.schemaStore); } return this.schemaStore; } @@ -114,7 +115,7 @@ public synchronized BackendStore loadGraphStore(HugeConfig config, String name) BackendStore store = this.provider.loadGraphStore(config, name); this.checkNonSharedStore(store); this.graphStore = new RaftBackendStore(store, this.context); - this.context.addStore(RaftRequests.StoreType.GRAPH, this.graphStore); + this.context.addStore(StoreType.GRAPH, this.graphStore); } return this.graphStore; } @@ -126,7 +127,7 @@ public synchronized BackendStore loadSystemStore(HugeConfig config, String name) BackendStore store = this.provider.loadSystemStore(config, name); this.checkNonSharedStore(store); this.systemStore = new RaftBackendStore(store, this.context); - this.context.addStore(RaftRequests.StoreType.SYSTEM, this.systemStore); + this.context.addStore(StoreType.SYSTEM, this.systemStore); } return this.systemStore; } @@ -214,8 +215,8 @@ public void initSystemInfo(HugeGraph graph) { @Override public void createSnapshot() { // TODO: snapshot for StoreType.ALL instead of StoreType.GRAPH - StoreCommand command = new StoreCommand(RaftRequests.StoreType.GRAPH, - RaftRequests.StoreAction.SNAPSHOT, null); + StoreCommand command = new StoreCommand(StoreType.GRAPH, + StoreAction.SNAPSHOT, null); RaftStoreClosure closure = new RaftStoreClosure(command); this.context.node().submitAndWait(command, closure); LOG.debug("Graph '{}' has writed snapshot", this.graph()); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java index 4cef5e881e..d1b15b634e 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftGroupManagerImpl.java @@ -26,7 +26,10 @@ import com.alipay.sofa.jraft.Status; import com.alipay.sofa.jraft.entity.PeerId; import com.baidu.hugegraph.backend.BackendException; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse; import com.baidu.hugegraph.backend.store.raft.rpc.RpcForwarder; import com.baidu.hugegraph.util.E; import com.google.protobuf.Message; @@ -56,11 +59,11 @@ public List listPeers() { .collect(Collectors.toList()); } // If current node is not leader, forward request to leader - RaftRequests.ListPeersRequest request = RaftRequests.ListPeersRequest.getDefaultInstance(); + ListPeersRequest request = ListPeersRequest.getDefaultInstance(); try { - RaftClosure future; + RaftClosure future; future = this.forwardToLeader(request); - RaftRequests.ListPeersResponse response = future.waitFinished(); + ListPeersResponse response = future.waitFinished(); return response.getEndpointsList(); } catch (Throwable e) { throw new BackendException("Failed to list peers", e); @@ -100,12 +103,11 @@ public String setLeader(String endpoint) { this.transferLeaderTo(endpoint); } else { // If current node is not leader, forward request to leader - RaftRequests.SetLeaderRequest - request = RaftRequests.SetLeaderRequest.newBuilder() - .setEndpoint(endpoint) - .build(); + SetLeaderRequest request = SetLeaderRequest.newBuilder() + .setEndpoint(endpoint) + .build(); try { - RaftClosure future; + RaftClosure future; future = this.forwardToLeader(request); future.waitFinished(); } catch (Throwable e) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java index 74b216df9d..3176cafc8d 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/RaftSharedContext.java @@ -53,7 +53,7 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.raft.rpc.ListPeersProcessor; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.backend.store.raft.rpc.RpcForwarder; import com.baidu.hugegraph.backend.store.raft.rpc.SetLeaderProcessor; import com.baidu.hugegraph.backend.store.raft.rpc.StoreCommandProcessor; @@ -111,7 +111,7 @@ public RaftSharedContext(HugeGraphParams params) { this.schemaStoreName = config.get(CoreOptions.STORE_SCHEMA); this.graphStoreName = config.get(CoreOptions.STORE_GRAPH); this.systemStoreName = config.get(CoreOptions.STORE_SYSTEM); - this.stores = new RaftBackendStore[RaftRequests.StoreType.ALL.getNumber()]; + this.stores = new RaftBackendStore[StoreType.ALL.getNumber()]; this.rpcServer = this.initAndStartRpcServer(); if (config.get(CoreOptions.RAFT_SAFE_READ)) { int threads = config.get(CoreOptions.RAFT_READ_INDEX_THREADS); @@ -178,18 +178,18 @@ public String group() { return DEFAULT_GROUP; } - public void addStore(RaftRequests.StoreType type, RaftBackendStore store) { + public void addStore(StoreType type, RaftBackendStore store) { this.stores[type.getNumber()] = store; } - public RaftRequests.StoreType storeType(String store) { + public StoreType storeType(String store) { if (this.schemaStoreName.equals(store)) { - return RaftRequests.StoreType.SCHEMA; + return StoreType.SCHEMA; } else if (this.graphStoreName.equals(store)) { - return RaftRequests.StoreType.GRAPH; + return StoreType.GRAPH; } else { assert this.systemStoreName.equals(store); - return RaftRequests.StoreType.SYSTEM; + return StoreType.SYSTEM; } } @@ -197,7 +197,7 @@ protected RaftBackendStore[] stores() { return this.stores; } - public BackendStore originStore(RaftRequests.StoreType storeType) { + public BackendStore originStore(StoreType storeType) { RaftBackendStore raftStore = this.stores[storeType.getNumber()]; E.checkState(raftStore != null, "The raft store of type %s shouldn't be null", storeType); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java index f844d27570..c90ffe8dac 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreCommand.java @@ -20,22 +20,23 @@ package com.baidu.hugegraph.backend.store.raft; import com.baidu.hugegraph.backend.serializer.BytesBuffer; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; public final class StoreCommand { public static final int HEADER_SIZE = 2; - private final RaftRequests.StoreType type; - private final RaftRequests.StoreAction action; + private final StoreType type; + private final StoreAction action; private final byte[] data; private final boolean forwarded; - public StoreCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, byte[] data) { + public StoreCommand(StoreType type, StoreAction action, byte[] data) { this(type, action, data, false); } - public StoreCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, + public StoreCommand(StoreType type, StoreAction action, byte[] data, boolean forwarded) { this.type = type; this.action = action; @@ -50,11 +51,11 @@ public StoreCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action this.forwarded = forwarded; } - public RaftRequests.StoreType type() { + public StoreType type() { return this.type; } - public RaftRequests.StoreAction action() { + public StoreAction action() { return this.action; } @@ -78,8 +79,8 @@ public static byte[] wrap(byte value) { } public static StoreCommand fromBytes(byte[] bytes) { - RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(bytes[0]); - RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(bytes[1]); + StoreType type = StoreType.valueOf(bytes[0]); + StoreAction action = StoreAction.valueOf(bytes[1]); return new StoreCommand(type, action, bytes); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java index b04a36381b..73b1cd7c24 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java @@ -42,7 +42,8 @@ import com.baidu.hugegraph.backend.store.BackendMutation; import com.baidu.hugegraph.backend.store.BackendStore; import com.baidu.hugegraph.backend.store.raft.RaftBackendStore.IncrCounter; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.LZ4Util; import com.baidu.hugegraph.util.Log; @@ -59,7 +60,7 @@ public StoreStateMachine(RaftSharedContext context) { this.snapshotFile = new StoreSnapshotFile(context.stores()); } - private BackendStore store(RaftRequests.StoreType type) { + private BackendStore store(StoreType type) { return this.context.originStore(type); } @@ -104,8 +105,8 @@ private Future onApplyLeader(RaftStoreClosure closure) { StoreCommand command = closure.command(); BytesBuffer buffer = BytesBuffer.wrap(command.data()); // The first two bytes are StoreType and StoreAction - RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(buffer.read()); - RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(buffer.read()); + StoreType type = StoreType.valueOf(buffer.read()); + StoreAction action = StoreAction.valueOf(buffer.read()); boolean forwarded = command.forwarded(); // Let the producer thread to handle it, and wait for it CompletableFuture future = new CompletableFuture<>(); @@ -131,8 +132,8 @@ private Future onApplyFollower(ByteBuffer data) { BytesBuffer buffer = LZ4Util.decompress(bytes, RaftSharedContext.BLOCK_SIZE); buffer.forReadWritten(); - RaftRequests.StoreType type = RaftRequests.StoreType.valueOf(buffer.read()); - RaftRequests.StoreAction action = RaftRequests.StoreAction.valueOf(buffer.read()); + StoreType type = StoreType.valueOf(buffer.read()); + StoreAction action = StoreAction.valueOf(buffer.read()); try { return this.applyCommand(type, action, buffer, false); } catch (Throwable e) { @@ -143,9 +144,9 @@ private Future onApplyFollower(ByteBuffer data) { }); } - private Object applyCommand(RaftRequests.StoreType type, RaftRequests.StoreAction action, + private Object applyCommand(StoreType type, StoreAction action, BytesBuffer buffer, boolean forwarded) { - E.checkState(type != RaftRequests.StoreType.ALL, + E.checkState(type != StoreType.ALL, "Can't apply command for all store at one time"); BackendStore store = this.store(type); switch (action) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java index 5634bde325..328cf3c108 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/ListPeersProcessor.java @@ -25,12 +25,15 @@ import com.alipay.sofa.jraft.rpc.RpcRequestProcessor; import com.baidu.hugegraph.backend.store.raft.RaftGroupManager; import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.ListPeersResponse; import com.baidu.hugegraph.util.Log; import com.google.common.collect.ImmutableList; import com.google.protobuf.Message; public class ListPeersProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger(ListPeersProcessor.class); @@ -42,35 +45,33 @@ public ListPeersProcessor(RaftSharedContext context) { } @Override - public Message processRequest(RaftRequests.ListPeersRequest request, + public Message processRequest(ListPeersRequest request, RpcRequestClosure done) { LOG.debug("Processing ListPeersRequest {}", request.getClass()); RaftGroupManager nodeManager = this.context.raftNodeManager( RaftSharedContext.DEFAULT_GROUP); try { - RaftRequests.CommonResponse common = RaftRequests.CommonResponse.newBuilder() - .setStatus(true) - .build(); - return RaftRequests.ListPeersResponse.newBuilder() - .setCommon(common) - .addAllEndpoints(nodeManager.listPeers()) - .build(); + CommonResponse common = CommonResponse.newBuilder() + .setStatus(true) + .build(); + return ListPeersResponse.newBuilder() + .setCommon(common) + .addAllEndpoints(nodeManager.listPeers()) + .build(); } catch (Throwable e) { - RaftRequests.CommonResponse common = - RaftRequests.CommonResponse.newBuilder() - .setStatus(false) - .setMessage(e.toString()) - .build(); - - return RaftRequests.ListPeersResponse.newBuilder() - .setCommon(common) - .addAllEndpoints(ImmutableList.of()) - .build(); + CommonResponse common = CommonResponse.newBuilder() + .setStatus(false) + .setMessage(e.toString()) + .build(); + return ListPeersResponse.newBuilder() + .setCommon(common) + .addAllEndpoints(ImmutableList.of()) + .build(); } } @Override public String interest() { - return RaftRequests.ListPeersRequest.class.getName(); + return ListPeersRequest.class.getName(); } } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java index 7d10eb8d38..2c93d113ee 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/RpcForwarder.java @@ -37,6 +37,9 @@ import com.baidu.hugegraph.backend.store.raft.RaftClosure; import com.baidu.hugegraph.backend.store.raft.RaftStoreClosure; import com.baidu.hugegraph.backend.store.raft.StoreCommand; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Descriptors.FieldDescriptor; @@ -65,18 +68,16 @@ public void forwardToLeader(PeerId leaderId, StoreCommand command, LOG.debug("The node {} forward request to leader {}", this.nodeId, leaderId); - RaftRequests.StoreCommandRequest.Builder builder = - RaftRequests.StoreCommandRequest.newBuilder(); - + StoreCommandRequest.Builder builder = StoreCommandRequest.newBuilder(); builder.setType(command.type()); builder.setAction(command.action()); builder.setData(ZeroByteStringHelper.wrap(command.data())); - RaftRequests.StoreCommandRequest request = builder.build(); + StoreCommandRequest request = builder.build(); - RpcResponseClosure responseClosure; - responseClosure = new RpcResponseClosure() { + RpcResponseClosure responseClosure; + responseClosure = new RpcResponseClosure() { @Override - public void setResponse(RaftRequests.StoreCommandResponse response) { + public void setResponse(StoreCommandResponse response) { if (response.getStatus()) { LOG.debug("StoreCommandResponse status ok"); future.complete(Status.OK(), () -> null); @@ -117,11 +118,11 @@ public void setResponse(T response) { FieldDescriptor fd = response.getDescriptorForType() .findFieldByName("common"); Object object = response.getField(fd); - E.checkState(object instanceof RaftRequests.CommonResponse, + E.checkState(object instanceof CommonResponse, "The common field must be instance of " + "CommonResponse, actual is '%s'", object != null ? object.getClass() : null); - RaftRequests.CommonResponse commonResponse = (RaftRequests.CommonResponse) object; + CommonResponse commonResponse = (CommonResponse) object; if (commonResponse.getStatus()) { future.complete(Status.OK(), () -> response); } else { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java index 4dd3b3e6fb..f110537ffb 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/SetLeaderProcessor.java @@ -25,11 +25,14 @@ import com.alipay.sofa.jraft.rpc.RpcRequestProcessor; import com.baidu.hugegraph.backend.store.raft.RaftGroupManager; import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.CommonResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.SetLeaderResponse; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Message; public class SetLeaderProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger(SetLeaderProcessor.class); @@ -41,31 +44,28 @@ public SetLeaderProcessor(RaftSharedContext context) { } @Override - public Message processRequest(RaftRequests.SetLeaderRequest request, + public Message processRequest(SetLeaderRequest request, RpcRequestClosure done) { LOG.debug("Processing SetLeaderRequest {}", request.getClass()); RaftGroupManager nodeManager = this.context.raftNodeManager( RaftSharedContext.DEFAULT_GROUP); try { nodeManager.setLeader(request.getEndpoint()); - RaftRequests.CommonResponse common = RaftRequests.CommonResponse.newBuilder() - .setStatus(true) - .build(); - return RaftRequests.SetLeaderResponse.newBuilder().setCommon(common).build(); + CommonResponse common = CommonResponse.newBuilder() + .setStatus(true) + .build(); + return SetLeaderResponse.newBuilder().setCommon(common).build(); } catch (Throwable e) { - - RaftRequests.CommonResponse common = - RaftRequests.CommonResponse.newBuilder() - .setStatus(false) - .setMessage(e.toString()) - .build(); - - return RaftRequests.SetLeaderResponse.newBuilder().setCommon(common).build(); + CommonResponse common = CommonResponse.newBuilder() + .setStatus(false) + .setMessage(e.toString()) + .build(); + return SetLeaderResponse.newBuilder().setCommon(common).build(); } } @Override public String interest() { - return RaftRequests.SetLeaderRequest.class.getName(); + return SetLeaderRequest.class.getName(); } } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java index ccbdc932ec..13ce2cfb8e 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/rpc/StoreCommandProcessor.java @@ -27,11 +27,15 @@ import com.baidu.hugegraph.backend.store.raft.RaftSharedContext; import com.baidu.hugegraph.backend.store.raft.RaftStoreClosure; import com.baidu.hugegraph.backend.store.raft.StoreCommand; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandRequest; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreCommandResponse; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.util.Log; import com.google.protobuf.Message; public class StoreCommandProcessor - extends RpcRequestProcessor { + extends RpcRequestProcessor { private static final Logger LOG = Log.logger( StoreCommandProcessor.class); @@ -44,7 +48,7 @@ public StoreCommandProcessor(RaftSharedContext context) { } @Override - public Message processRequest(RaftRequests.StoreCommandRequest request, + public Message processRequest(StoreCommandRequest request, RpcRequestClosure done) { LOG.debug("Processing StoreCommandRequest: {}", request.getAction()); RaftNode node = this.context.node(); @@ -53,11 +57,11 @@ public Message processRequest(RaftRequests.StoreCommandRequest request, RaftStoreClosure closure = new RaftStoreClosure(command); node.submitAndWait(command, closure); // TODO: return the submitAndWait() result to rpc client - return RaftRequests.StoreCommandResponse.newBuilder().setStatus(true).build(); + return StoreCommandResponse.newBuilder().setStatus(true).build(); } catch (Throwable e) { LOG.warn("Failed to process StoreCommandRequest: {}", request.getAction(), e); - RaftRequests.StoreCommandResponse.Builder builder = RaftRequests.StoreCommandResponse + StoreCommandResponse.Builder builder = StoreCommandResponse .newBuilder() .setStatus(false); if (e.getMessage() != null) { @@ -69,13 +73,12 @@ public Message processRequest(RaftRequests.StoreCommandRequest request, @Override public String interest() { - return RaftRequests.StoreCommandRequest.class.getName(); + return StoreCommandRequest.class.getName(); } - private StoreCommand parseStoreCommand( - RaftRequests.StoreCommandRequest request) { - RaftRequests.StoreType type = request.getType(); - RaftRequests.StoreAction action = request.getAction(); + private StoreCommand parseStoreCommand(StoreCommandRequest request) { + StoreType type = request.getType(); + StoreAction action = request.getAction(); byte[] data = request.getData().toByteArray(); return new StoreCommand(type, action, data, true); } From 054f84d8135753c15d4d9b07b0412c77bfe89778 Mon Sep 17 00:00:00 2001 From: seagle Date: Mon, 16 May 2022 20:38:16 +0800 Subject: [PATCH 5/7] restore RaftRequests invoke --- .../unit/serializer/StoreSerializerTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java index 5b6bfd0970..21dd2ddf05 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/serializer/StoreSerializerTest.java @@ -28,9 +28,10 @@ import com.baidu.hugegraph.backend.store.BackendAction; import com.baidu.hugegraph.backend.store.BackendEntry; import com.baidu.hugegraph.backend.store.BackendMutation; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreAction; +import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests.StoreType; import com.baidu.hugegraph.backend.store.raft.StoreCommand; import com.baidu.hugegraph.backend.store.raft.StoreSerializer; -import com.baidu.hugegraph.backend.store.raft.rpc.RaftRequests; import com.baidu.hugegraph.testutil.Assert; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.type.define.Action; @@ -76,15 +77,15 @@ public void testSerializeStoreCommand() { origin.add(entry, Action.INSERT); byte[] mutationBytes = StoreSerializer.writeMutation(origin); - StoreCommand command = new StoreCommand(RaftRequests.StoreType.GRAPH, - RaftRequests.StoreAction.MUTATE, + StoreCommand command = new StoreCommand(StoreType.GRAPH, + StoreAction.MUTATE, mutationBytes); - Assert.assertEquals(RaftRequests.StoreAction.MUTATE, command.action()); + Assert.assertEquals(StoreAction.MUTATE, command.action()); Assert.assertArrayEquals(mutationBytes, command.data()); byte[] commandBytes = command.data(); StoreCommand actual = StoreCommand.fromBytes(commandBytes); - Assert.assertEquals(RaftRequests.StoreType.GRAPH, command.type()); + Assert.assertEquals(StoreType.GRAPH, command.type()); Assert.assertEquals(command.action(), actual.action()); Assert.assertArrayEquals(command.data(), actual.data()); } From 647ff66288d03db41ad31546282fc4c67268d486 Mon Sep 17 00:00:00 2001 From: seagle Date: Sat, 4 Jun 2022 16:47:28 +0800 Subject: [PATCH 6/7] update dependency and version --- hugegraph-api/pom.xml | 1 - hugegraph-core/pom.xml | 21 +-------------------- pom.xml | 17 +++++++++++++++-- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/hugegraph-api/pom.xml b/hugegraph-api/pom.xml index b84b34f91a..9bca9d3949 100644 --- a/hugegraph-api/pom.xml +++ b/hugegraph-api/pom.xml @@ -21,7 +21,6 @@ com.baidu.hugegraph hugegraph-rpc - 2.0.1 diff --git a/hugegraph-core/pom.xml b/hugegraph-core/pom.xml index 14bb12543a..f8b3f8a45e 100644 --- a/hugegraph-core/pom.xml +++ b/hugegraph-core/pom.xml @@ -19,7 +19,6 @@ com.baidu.hugegraph hugegraph-common - 2.1.2 @@ -192,24 +191,6 @@ 0.11.2 runtime - - - io.grpc - grpc-netty - - - io.grpc - grpc-protobuf - - - io.grpc - grpc-stub - - - com.google.protobuf - protobuf-java - - @@ -259,7 +240,7 @@ org.xolstice.maven.plugins protobuf-maven-plugin - 0.5.0 + 0.6.1 com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} protoc-java diff --git a/pom.xml b/pom.xml index 4910e7a333..11d822b8a2 100644 --- a/pom.xml +++ b/pom.xml @@ -108,9 +108,10 @@ bash 3.1.2 8.45 - + 2.0.1 + 2.1.2 1.6.1 - 3.3.0 + 3.21.1 hugegraph-core @@ -129,6 +130,18 @@ + + + com.baidu.hugegraph + hugegraph-rpc + ${hugegraph-rpc.version} + + + com.baidu.hugegraph + hugegraph-common + ${hugegraph-common.version} + + org.apache.logging.log4j From e83debacc0a8a5275f8cf68506dfcef66f6dcaf9 Mon Sep 17 00:00:00 2001 From: seagle Date: Sat, 4 Jun 2022 17:25:37 +0800 Subject: [PATCH 7/7] update protobuf version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11d822b8a2..54b470a095 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ 2.0.1 2.1.2 1.6.1 - 3.21.1 + 3.3.0 hugegraph-core