eab148 commented on code in PR #6076:
URL: https://github.com/apache/hbase/pull/6076#discussion_r1681554763


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBufferedMutator.java:
##########
@@ -93,4 +94,11 @@ default CompletableFuture<Void> mutate(Mutation mutation) {
   default long getPeriodicalFlushTimeout(TimeUnit unit) {
     throw new UnsupportedOperationException("Not implemented");
   }
+
+  /**
+   * Returns the rpc request attributes.
+   */
+  default Map<String, byte[]> getRequestAttributes() {
+    throw new UnsupportedOperationException("Not implemented");

Review Comment:
   I wanted to create a consistent API for users. The 
[Table](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java#L755-L761)
 and 
[AsyncTable](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTable.java#L115-L121)
 interfaces both throw a not implemented exception for `getRequestAttributes`, 
so I did the same for the 
[BufferedMutator](https://github.com/apache/hbase/blob/46aa8b5371f065af8146210fdc5b1b1e5f683126/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java#L208-L214)
 and 
[AsyncBufferedMutator](https://github.com/apache/hbase/blob/46aa8b5371f065af8146210fdc5b1b1e5f683126/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBufferedMutator.java#L98-L103)
 interfaces. 
   
   `Table`/`AsyncTable`/`BufferedMutator`/`AsyncBufferedMutator` objects only 
have request attributes if they are built with request attributes.
   - `TableBuilder` sets request attributes for `Table`
   - `AsyncTableBuilder` sets request attributes for `AsyncTable` 
   - `BufferedMutatorParams` sets request attributes for `BufferedMutator` 
(there is no BufferedMutatorBuilder class that I am aware of)
   - `AsyncBufferedMutatorBuilder` sets request attributes for 
`AsyncBufferedMutator`
   
   With this in mind, I wonder if it makes sense to remove the 
`BufferedMutator::getRequestAttributes` method and only have the 
`BufferedMutatorParams::getRequestAttributes` method? A `BufferedMutator`'s 
request attributes are always set via the `BufferedMutatorParams`.



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBufferedMutator.java:
##########
@@ -93,4 +94,11 @@ default CompletableFuture<Void> mutate(Mutation mutation) {
   default long getPeriodicalFlushTimeout(TimeUnit unit) {
     throw new UnsupportedOperationException("Not implemented");
   }
+
+  /**
+   * Returns the rpc request attributes.
+   */
+  default Map<String, byte[]> getRequestAttributes() {
+    throw new UnsupportedOperationException("Not implemented");

Review Comment:
   I wanted to create a consistent API for users. The 
[Table](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java#L755-L761)
 and 
[AsyncTable](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTable.java#L115-L121)
 interfaces both throw a not implemented exception for `getRequestAttributes`, 
so I did the same for the 
[BufferedMutator](https://github.com/apache/hbase/blob/46aa8b5371f065af8146210fdc5b1b1e5f683126/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java#L208-L214)
 and 
[AsyncBufferedMutator](https://github.com/apache/hbase/blob/46aa8b5371f065af8146210fdc5b1b1e5f683126/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBufferedMutator.java#L98-L103)
 interfaces. 
   
   `Table`/`AsyncTable`/`BufferedMutator`/`AsyncBufferedMutator` objects only 
have request attributes if they are built with request attributes.
   - TableBuilder sets request attributes for Table
   - AsyncTableBuilder sets request attributes for AsyncTable 
   - BufferedMutatorParams sets request attributes for BufferedMutator (there 
is no BufferedMutatorBuilder class that I am aware of)
   - AsyncBufferedMutatorBuilder sets request attributes for 
AsyncBufferedMutator
   
   With this in mind, I wonder if it makes sense to remove the 
`BufferedMutator::getRequestAttributes` method and only have the 
`BufferedMutatorParams::getRequestAttributes` method? A `BufferedMutator`'s 
request attributes are always set via the `BufferedMutatorParams`.



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

Reply via email to