[ 
https://issues.apache.org/jira/browse/HBASE-22622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16872617#comment-16872617
 ] 

Andrew Purtell commented on HBASE-22622:
----------------------------------------

Something like this:

{code}
diff --git a/hbase-protocol/src/main/protobuf/WAL.proto 
b/hbase-protocol/src/main/protobuf/WAL.proto
index a888686107..3ac0d33aa1 100644
--- a/hbase-protocol/src/main/protobuf/WAL.proto
+++ b/hbase-protocol/src/main/protobuf/WAL.proto
@@ -65,13 +65,12 @@ message WALKey {
   optional uint64 nonce = 10;
   optional uint64 orig_sequence_number = 11;
 
-/*
-  optional CustomEntryType custom_entry_type = 9;
+  repeated Attribute attrs = 12;
+}
 
-  enum CustomEntryType {
-    COMPACTION = 0;
-  }
-*/
+message Attribute {
+  required bytes name = 1;
+  required bytes value = 2;
 }
{code}

and in WALKey

{code}
+  /**
+   * @param name attribute name
+   * @return attribute value, or null if unset
+   */
+  public byte[] getAttribute(byte[] name) {
...
+  }
+
+  /**
+   * @param name attribute name
+   * @param value attribute value
+   */
+  public void setAttribute(byte[] name, byte[] value) {
...
+  }
{code}

> WALKey Extended Attributes
> --------------------------
>
>                 Key: HBASE-22622
>                 URL: https://issues.apache.org/jira/browse/HBASE-22622
>             Project: HBase
>          Issue Type: New Feature
>          Components: wal
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>            Priority: Major
>
> It would be useful if the WAL protobuf and WALKey class included an optional 
> map of extended key/value attributes that downstream coprocessors could use 
> to annotate WAL Entries. While standard HBase replication would not use them, 
> custom replication endpoints could use the data to make filtering decisions 
> or take actions.
> An example use case would be allowing a tool like Phoenix to annotate 
> WAL.Entries to indicate that a given Entry is associated with a particular 
> Phoenix view rather than the base Phoenix table. (Multiple logical views in 
> Phoenix can map to the same physical HBase table.) A custom replication 
> endpoint might choose to replicate some views but not others. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to