greyp9 commented on a change in pull request #5311:
URL: https://github.com/apache/nifi/pull/5311#discussion_r704849336



##########
File path: 
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedCacheClient.java
##########
@@ -16,35 +16,23 @@
  */
 package org.apache.nifi.distributed.cache.client;
 
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.concurrent.TimeUnit;
-
-import javax.net.ssl.SSLContext;
-
-public interface CommsSession extends Closeable {
-
-    void setTimeout(final long value, final TimeUnit timeUnit);
-
-    InputStream getInputStream() throws IOException;
-
-    OutputStream getOutputStream() throws IOException;
-
-    boolean isClosed();
+import org.apache.nifi.distributed.cache.client.adapter.InboundAdapter;
+import org.apache.nifi.distributed.cache.client.adapter.OutboundAdapter;
 
-    void interrupt();
-
-    String getHostname();
-
-    int getPort();
-
-    long getTimeout(TimeUnit timeUnit);
-
-    SSLContext getSSLContext();
-
-    int getProtocolVersion();
+import java.io.IOException;
 
-    void setProtocolVersion(final int protocolVersion);
+/**
+ * Encapsulate operations which may be performed using a {@link 
DistributedSetCacheClientService} or a
+ * {@link DistributedMapCacheClientService}.
+ */
+public interface DistributedCacheClient {
+
+    /**
+     * Call a service method.
+     *
+     * @param outboundAdapter the object used to assemble the service request 
byte stream
+     * @param inboundAdapter  the object used to interpret the service 
response byte stream
+     * @throws IOException on serialization failure; on communication failure
+     */
+    void invoke(OutboundAdapter outboundAdapter, InboundAdapter 
inboundAdapter) throws IOException;

Review comment:
       I changed this to a base class, and added implementations for Set & Map. 
 Also added enums to bound the supported operations.  It was a significant 
refactor, but I think the result is aligned with your suggestion.  LMK if this 
looks ok.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to