Apache9 commented on code in PR #1087:
URL: https://github.com/apache/incubator-pegasus/pull/1087#discussion_r935089219


##########
java-client/src/main/java/org/apache/pegasus/client/PegasusTable.java:
##########
@@ -98,6 +128,10 @@ public Future<Long> asyncSortKeyCount(byte[] hashKey, int 
timeout) {
         new Table.ClientOPCallback() {
           @Override
           public void onCompletion(client_operator clientOP) {
+            if (!(clientOP instanceof rrdb_sortkey_count_operator)) {
+              promise.setFailure(new PException("Unexpected client operator"));

Review Comment:
   Better to not expose netty's promise and future. We can use 
CompletableFuture in JDK.  Can be a separated issue, and this will be an 
incompatible change...



##########
java-client/src/main/java/org/apache/pegasus/client/PegasusScanner.java:
##########
@@ -188,6 +193,16 @@ private void asyncStartScan() {
         new Table.ClientOPCallback() {
           @Override
           public void onCompletion(client_operator clientOP) throws Throwable {
+            if (!(clientOP instanceof rrdb_get_scanner_operator)) {
+              logger.error(
+                  "scan rpc callback, encounter logic error, we just abandon 
this scan, "
+                      + "tableName({}), appId({})",
+                  _table.getTableName(),

Review Comment:
   These are all C style naming? Can we remove the leading '_'?



##########
java-client/src/main/java/org/apache/pegasus/client/ClientOptions.java:
##########
@@ -227,6 +227,11 @@ public boolean equals(Object options) {
     return false;
   }
 
+  @Override
+  public int hashCode() {

Review Comment:
   Usually this is not a good practise to just call super.hashCode...



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to