GlenGeng edited a comment on pull request #2034:
URL: https://github.com/apache/ozone/pull/2034#issuecomment-799151598
> **Just a side question**
>
> Do we have any specific tests to test the behavior of replicate
annotation(looks like no) if those work we should be good right, as this is
using existing Replicate annotation, and the codec
serialization/deserialization tests are already added. Do you think we need to
add tests?
We have one `TestReplicationAnnotation`, yet it is a unit test.
Beside test, you can check from the trace to see if the replication
annotation is triggered as expected.
```
private Object invokeRatis(Method method, Object[] args)
throws Exception {
long startTime = Time.monotonicNowNanos();
Preconditions.checkNotNull(ratisHandler);
final SCMRatisResponse response = ratisHandler.submitRequest(
SCMRatisRequest.of(requestType, method.getName(), args));
LOG.info("Invoking method {} on target {}, cost {}us",
method, ratisHandler, (Time.monotonicNowNanos() - startTime) /
1000.0);
if (response.isSuccess()) {
return response.getResult();
}
// Should we unwrap and throw proper exception from here?
throw response.getException();
}
```
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]