[
https://issues.apache.org/jira/browse/GEODE-4054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282844#comment-16282844
]
ASF GitHub Bot commented on GEODE-4054:
---------------------------------------
WireBaron commented on a change in pull request #1141: GEODE-4054: Create
module for Protobuf message-based client
URL: https://github.com/apache/geode/pull/1141#discussion_r155681799
##########
File path:
geode-protobuf-client/src/main/java/org/apache/geode/internal/cache/client/protobuf/CacheFactory.java
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.client.protobuf;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.geode.annotations.Experimental;
+import org.apache.geode.internal.protocol.protobuf.v1.BasicTypes;
+import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol;
+import org.apache.geode.internal.protocol.protobuf.v1.LocatorAPI;
+
+@Experimental
+public class CacheFactory {
+ public static class ServerInfo {
+ public String host;
+ public int port;
+
+ public ServerInfo(String host, int port) {
+ this.host = host;
+ this.port = port;
+ }
+ }
+
+ String host;
+ int port;
+
+ public CacheFactory() {
+ // NOP
+ }
+
+ public CacheFactory addLocator(String host, int port) {
+ this.host = host;
+ this.port = port;
+ return this;
+ }
+
+ public Collection<ServerInfo> getAvailableServers() throws Exception {
+ final Socket locatorSocket = new Socket(host, port);
+
+ OutputStream outputStream = locatorSocket.getOutputStream();
+ // Once GEODE-4010 is fixed, this can revert to just the communication
mode and major version.
+ outputStream.write(0x00); // NON_GOSSIP_REQUEST_VERSION
Review comment:
The change here is to send a handshake request instead of these six bytes,
there's no response handling, just continue with your getAvailableServers
request.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Create module for Protobuf message-based client
> -----------------------------------------------
>
> Key: GEODE-4054
> URL: https://issues.apache.org/jira/browse/GEODE-4054
> Project: Geode
> Issue Type: Improvement
> Components: client/server
> Reporter: Michael Dodge
> Fix For: 1.4.0
>
>
> Create a module, geode-protobuf-client, that contains a simple Java client
> that exercises the Protobuf messages and the new protocol. This client should
> allow the interaction with a locator and cache server based on command-line
> arguments, a file of commands, or an interactive shell.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)