alopresto commented on a change in pull request #4289:
URL: https://github.com/apache/nifi/pull/4289#discussion_r435632547
##########
File path:
nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/PeerStatusProvider.java
##########
@@ -52,12 +51,25 @@
* Fetch peer statuses from a remote NiFi cluster.
* Implementation of this method should fetch peer statuses from the node
* represented by the passed PeerDescription using its transport protocol.
+ *
* @param peerDescription a bootstrap node or one of query-able nodes
lastly fetched successfully
* @return Remote peer statuses
* @throws IOException thrown when it fails to fetch peer statuses of the
remote cluster from the specified peer
*/
Set<PeerStatus> fetchRemotePeerStatuses(final PeerDescription
peerDescription) throws IOException;
+ /**
+ * Fetch peer statuses from a remote NiFi cluster.
+ * Implementation of this method should fetch peer statuses from the node
+ * represented by the passed PeerDescription using its transport protocol.
+ *
+ * @param peerDescription a bootstrap node or one of query-able nodes
lastly fetched successfully
+ * @param communicator the communication mechanism provider can be
provided directly
+ * @return Remote peer statuses
+ * @throws IOException thrown when it fails to fetch peer statuses of the
remote cluster from the specified peer
+ */
+ Set<PeerStatus> fetchRemotePeerStatuses(final PeerDescription
peerDescription, SiteToSiteCommunicator communicator) throws IOException;
Review comment:
I am not opposed to genericizing the class, but I think it introduces
more complexity as every instance would need to determine in advance what
communicator implementation it accepted.
I would argue that while compile-time checks are obviously better than
runtime, passing a new anonymous instantiation of a marker interface is
"allowed" but "an intentionally bad decision" like many other bad decisions
which can occur in code.
I'm going to look at other options to allow reusability of the specific
client instance for performance, perhaps without exposing that functionality
directly to the caller.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]