[
https://issues.apache.org/jira/browse/GEODE-3213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095193#comment-16095193
]
ASF GitHub Bot commented on GEODE-3213:
---------------------------------------
Github user WireBaron commented on a diff in the pull request:
https://github.com/apache/geode/pull/646#discussion_r128600182
--- Diff:
geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufOpsProcessor.java
---
@@ -15,32 +15,35 @@
package org.apache.geode.protocol.protobuf;
import org.apache.geode.cache.Cache;
-import org.apache.geode.protocol.exception.InvalidProtocolMessageException;
-import org.apache.geode.protocol.operations.OperationHandler;
-import
org.apache.geode.protocol.operations.registry.OperationsHandlerRegistry;
-import
org.apache.geode.protocol.operations.registry.exception.OperationHandlerNotRegisteredException;
+import org.apache.geode.protocol.operations.OperationContext;
+import org.apache.geode.protocol.operations.Result;
+import
org.apache.geode.protocol.operations.registry.OperationContextRegistry;
import org.apache.geode.serialization.SerializationService;
/**
* This handles protobuf requests by determining the operation type of the
request and dispatching
* it to the appropriate handler.
*/
public class ProtobufOpsProcessor {
- private final OperationsHandlerRegistry opsHandlerRegistry;
+
+ private final OperationContextRegistry operationContextRegistry;
private final SerializationService serializationService;
- public ProtobufOpsProcessor(OperationsHandlerRegistry opsHandlerRegistry,
- SerializationService serializationService) {
- this.opsHandlerRegistry = opsHandlerRegistry;
+ public ProtobufOpsProcessor(SerializationService serializationService,
+ OperationContextRegistry operationsContextRegistry) {
this.serializationService = serializationService;
+ this.operationContextRegistry = operationsContextRegistry;
}
- public ClientProtocol.Response process(ClientProtocol.Request request,
Cache cache)
- throws OperationHandlerNotRegisteredException,
InvalidProtocolMessageException {
+ public ClientProtocol.Response process(ClientProtocol.Request request,
Cache cache) {
ClientProtocol.Request.RequestAPICase requestType =
request.getRequestAPICase();
- OperationHandler opsHandler =
-
opsHandlerRegistry.getOperationHandlerForOperationId(requestType.getNumber());
+ OperationContext operationContext =
operationContextRegistry.getOperationContext(requestType);
--- End diff --
How are we dealing with missing registry entries now that we're no longer
throwing OperationNotRegisteredException?
> Refactor Protobuf Serialization Implemenation
> ---------------------------------------------
>
> Key: GEODE-3213
> URL: https://issues.apache.org/jira/browse/GEODE-3213
> Project: Geode
> Issue Type: Improvement
> Components: client/server, serialization
> Reporter: Udo Kohlmeyer
>
> In the Protobuf serialization implementation, there are some refactorings we
> want to make:
> * OperationHandlers take OperationRequest and OperationResponse message, not
> the parent Request/Response Object
> * A generic flow needs to be implemented that all OperationHandlers follow.
> No bespoke flows for any OperationHandlers... way too much maintenance
> * Use Functional semantics to configure the functionality to extract
> OperationRequest from Request (per OperationHandler)
> * Use Functional semantics to configure the functionality to populate
> OperationResponse in the relevant Response
> * Have generic Error Handling framework to populate "known" errors and error
> codes
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)