You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/07/07 21:25:15 UTC

[GitHub] [cassandra-in-jvm-dtest-api] maedhroz opened a new pull request #12: CASSANDRA-15920 expose client warnings via QueryResult (and its implementations where reasonable)

maedhroz opened a new pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12


   This change should provide sufficient hooks for `ICoordinator` implementations to provide client warnings in their results while avoiding any backwards-incompatible changes to either `QueryResult` or its implementations.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] maedhroz commented on pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
maedhroz commented on pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#issuecomment-656216997


   @ifesdjeen @dcapwell I've pushed up a [simple illustration](https://github.com/maedhroz/cassandra/commit/12c0a30f60e961b3dc6517f6ed2b8a12081cf353) (based on [the work-around](https://github.com/apache/cassandra/pull/666/files?file-filters%5B%5D=.java#diff-170db42477cd0b1d149a6c883d95f8c6R171) in CASSANDRA-15907) of how the changes here should make warning collection a bit smoother.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen commented on a change in pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
ifesdjeen commented on a change in pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#discussion_r452866593



##########
File path: src/main/java/org/apache/cassandra/distributed/api/SimpleQueryResult.java
##########
@@ -89,6 +97,12 @@ private SimpleQueryResult(String[] names, Object[][] results, Predicate<Row> fil
         return Collections.unmodifiableList(Arrays.asList(names));
     }
 
+    @Override
+    public List<String> warnings()
+    {
+        return Collections.unmodifiableList(warnings);

Review comment:
       sure, I'd do the same




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen commented on a change in pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
ifesdjeen commented on a change in pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#discussion_r452206226



##########
File path: src/main/java/org/apache/cassandra/distributed/api/SimpleQueryResult.java
##########
@@ -89,6 +99,12 @@ private SimpleQueryResult(String[] names, Object[][] results, Predicate<Row> fil
         return Collections.unmodifiableList(Arrays.asList(names));
     }
 
+    @Override
+    public List<String> warnings()
+    {
+        return Collections.unmodifiableList(Arrays.asList(warnings));

Review comment:
       Nit: Shuold we maybe store it in the list right away? I'm not sure what's the benefit of having an array if expose a list in API anyways. Additional benefit is consistency with a builder!




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] maedhroz commented on a change in pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
maedhroz commented on a change in pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#discussion_r452316283



##########
File path: src/main/java/org/apache/cassandra/distributed/api/SimpleQueryResult.java
##########
@@ -89,6 +97,12 @@ private SimpleQueryResult(String[] names, Object[][] results, Predicate<Row> fil
         return Collections.unmodifiableList(Arrays.asList(names));
     }
 
+    @Override
+    public List<String> warnings()
+    {
+        return Collections.unmodifiableList(warnings);

Review comment:
       @ifesdjeen I left the defensive wrapping here to protect the internal list, but let me know if this works for you otherwise :)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] maedhroz commented on a change in pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
maedhroz commented on a change in pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#discussion_r452300161



##########
File path: src/main/java/org/apache/cassandra/distributed/api/SimpleQueryResult.java
##########
@@ -89,6 +99,12 @@ private SimpleQueryResult(String[] names, Object[][] results, Predicate<Row> fil
         return Collections.unmodifiableList(Arrays.asList(names));
     }
 
+    @Override
+    public List<String> warnings()
+    {
+        return Collections.unmodifiableList(Arrays.asList(warnings));

Review comment:
       No objections from me.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen merged pull request #12: CASSANDRA-15920 make SimpleQueryResult a container for client warnings, and expose those warnings via QueryResult

Posted by GitBox <gi...@apache.org>.
ifesdjeen merged pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #12: CASSANDRA-15920 expose client warnings via QueryResult (and its implementations where reasonable)

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #12:
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/12#discussion_r451174354



##########
File path: src/main/java/org/apache/cassandra/distributed/api/SimpleQueryResult.java
##########
@@ -63,14 +63,21 @@
 {
     private final String[] names;
     private final Object[][] results;
+    private final String[] warnings;
     private final Predicate<Row> filter;
     private final Row row;
     private int offset = -1;
 
     public SimpleQueryResult(String[] names, Object[][] results)
+    {
+        this(names, results, new String[0]);

Review comment:
       may be good to have a constant empty array

##########
File path: src/main/java/org/apache/cassandra/distributed/api/QueryResults.java
##########
@@ -176,6 +176,12 @@ private FilterQueryResult(QueryResult delegate, Predicate<Row> filter)
         {
             return delegate.names();
         }
+        
+        @Override 
+        public List<String> warnings()

Review comment:
       Can we add these to `Builder` as well?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org