Apache9 commented on a change in pull request #774: HBASE-23221 Polish the WAL 
interface after HBASE-23181
URL: https://github.com/apache/hbase/pull/774#discussion_r340398920
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALEdit.java
 ##########
 @@ -257,30 +317,55 @@ public static WALEdit createFlushWALEdit(RegionInfo hri, 
FlushDescriptor f) {
   }
 
   public static FlushDescriptor getFlushDescriptor(Cell cell) throws 
IOException {
-    if (CellUtil.matchingColumn(cell, METAFAMILY, FLUSH)) {
-      return FlushDescriptor.parseFrom(CellUtil.cloneValue(cell));
-    }
-    return null;
+    return CellUtil.matchingColumn(cell, METAFAMILY, FLUSH)?
+        FlushDescriptor.parseFrom(CellUtil.cloneValue(cell)): null;
   }
 
+  /**
+   * @return A meta Marker WALEdit that has a single Cell whose value is the 
passed in
+   * <code>regionEventDesc</code> serialized and whose row is this region,
+   * columnfamily is {@link #METAFAMILY} and qualifier is
+   * {@link #REGION_EVENT_PREFIX} + {@link 
RegionEventDescriptor#getEventType()};
+   * for example HBASE::REGION_EVENT::REGION_CLOSE.
+   */
   public static WALEdit createRegionEventWALEdit(RegionInfo hri,
       RegionEventDescriptor regionEventDesc) {
-    KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, REGION_EVENT,
+    KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY,
+        createRegionEventDescriptorQualifier(regionEventDesc.getEventType()),
 
 Review comment:
   Maybe we could pre-create all the region events?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to