You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/08/02 03:53:19 UTC

[GitHub] [incubator-pegasus] Apache9 commented on a diff in pull request #1087: style(java-client): optimize code style

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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org