anoopsjohn commented on a change in pull request #2707:
URL: https://github.com/apache/hbase/pull/2707#discussion_r537229508



##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/RawCell.java
##########
@@ -64,4 +65,19 @@ public static void checkForTagsLength(int tagsLength) {
       throw new IllegalArgumentException("tagslength " + tagsLength + " > " + 
MAX_TAGS_LENGTH);
     }
   }
+
+  /**
+   * @return A new cell which is having the extra tags also added to it.
+   */
+  public static Cell createCell(Cell cell, List<Tag> tags) {
+    return PrivateCellUtil.createCell(cell, tags);
+  }
+
+  /**
+   * @param cell The Cell
+   * @return Tags in the given Cell as a List
+   */
+  public static List<Tag> getTags(Cell cell) {

Review comment:
       We have an instance method already here which return all Tags in this 
object.  So adding a static method here which similar behave seems a bit ugly 
for me.  I understood why u wanted to add this which helps to make the new Cell 
create code simpler there (Avoid going over iterator and collect tags to a 
List).  But I think its better if Phoenix (or other) do not try change the 
returned List by adding a new entry.  In many a places we return Immutable List 
impls. Here that is not needed for HBase but who knows may be at some time some 
patch might change that.  So that time Phoenix code will break. So i would 
suggest in phoenix code create a new List only and we can make use of the 
Iterator.




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


Reply via email to