cbornet commented on a change in pull request #6720:
URL: https://github.com/apache/pulsar/pull/6720#discussion_r522497646
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarCommandSender.java
##########
@@ -26,39 +29,92 @@
public interface PulsarCommandSender {
-
- void sendPartitionMetadataResponse(PulsarApi.ServerError error, String
errorMsg, long requestId);
-
- void sendPartitionMetadataResponse(int partitions, long requestId);
-
- void sendSuccessResponse(long requestId);
-
- void sendErrorResponse(long requestId, PulsarApi.ServerError error, String
message);
-
- void sendProducerSuccessResponse(long requestId, String producerName,
SchemaVersion schemaVersion);
-
- void sendProducerSuccessResponse(long requestId, String producerName, long
lastSequenceId,
- SchemaVersion schemaVersion);
-
- void sendSendReceiptResponse(long producerId, long sequenceId, long
highestId, long ledgerId,
- long entryId);
-
- void sendSendError(long producerId, long sequenceId, PulsarApi.ServerError
error, String errorMsg);
-
- void sendGetTopicsOfNamespaceResponse(List<String> topics, long requestId);
-
- void sendGetSchemaResponse(long requestId, SchemaInfo schema,
SchemaVersion version);
-
- void sendGetSchemaErrorResponse(long requestId, PulsarApi.ServerError
error, String errorMessage);
-
- void sendGetOrCreateSchemaResponse(long requestId, SchemaVersion
schemaVersion);
-
- void sendGetOrCreateSchemaErrorResponse(long requestId,
PulsarApi.ServerError error, String errorMessage);
-
- void sendConnectedResponse(int clientProtocolVersion, int maxMessageSize);
-
- void sendLookupResponse(String brokerServiceUrl, String
brokerServiceUrlTls, boolean authoritative,
- PulsarApi.CommandLookupTopicResponse.LookupType
response, long requestId, boolean proxyThroughServiceUrl);
-
- void sendLookupResponse(PulsarApi.ServerError error, String errorMsg, long
requestId);
+ default void sendPartitionMetadataResponse(PulsarApi.ServerError error,
String errorMsg, long requestId) {
Review comment:
This way a protocol may or may not implement the method. For instance if
some features are not yet supported. Also if new methods are added later, if
they have default impl, it will not break dependant handlers.
----------------------------------------------------------------
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]