bbeaudreault commented on code in PR #5326:
URL: https://github.com/apache/hbase/pull/5326#discussion_r1267162144


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTable.java:
##########
@@ -110,6 +111,12 @@ public interface AsyncTable<C extends 
ScanResultConsumerBase> {
    */
   long getScanTimeout(TimeUnit unit);
 
+  /**
+   * Get the map of request attributes
+   * @return a map of request attributes supplied by the client
+   */
+  Map<String, byte[]> getRequestAttributes();

Review Comment:
   Can you add a default implementation that throws NotImplementedException? We 
have this pattern for newish methods in Table. People shouldn't be necessarily 
extending this, but I find it makes migrations much easier if they do :)



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/Call.java:
##########
@@ -64,6 +67,13 @@ class Call {
   Call(int id, final Descriptors.MethodDescriptor md, Message param, final 
CellScanner cells,
     final Message responseDefaultType, int timeout, int priority, 
RpcCallback<Call> callback,
     MetricsConnection.CallStats callStats) {
+    this(id, md, param, cells, responseDefaultType, timeout, priority, 
Collections.emptyMap(),

Review Comment:
   there are only 2 extra test-related usages of this constructor.. if there 
were many, i'd say this is good to avoid unnecessary changes. but with just 2 i 
might prefer keeping the one constructor so as not to create an unnecessary 
precedent.



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java:
##########
@@ -751,4 +751,12 @@ default long getWriteRpcTimeout(TimeUnit unit) {
   default long getOperationTimeout(TimeUnit unit) {
     throw new NotImplementedException("Add an implementation!");
   }
+
+  /**
+   * Get the attributes to be submitted with requests
+   * @return map of request attributes
+   */
+  default Map<String, byte[]> getRequestAttributes() {
+    return Collections.emptyMap();

Review Comment:
   Might be better to throw an exception. Neither option is great if someone 
actually ends up calling the default, but I think throwing a clear exception is 
better than potentially returning the wrong results (i.e. there may indeed by 
request attributes).



-- 
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: issues-unsubscr...@hbase.apache.org

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

Reply via email to