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

Chia-Ping Tsai commented on HBASE-16769:
----------------------------------------

{code}
+    withCpCall = withCpCall && cpHost != null;
     // loop through all the completed snapshots
     for (FileStatus snapshot : snapshots) {
       Path info = new Path(snapshot.getPath(), 
SnapshotDescriptionUtils.SNAPSHOTINFO_FILE);
@@ -235,9 +238,11 @@ public class SnapshotManager extends 
MasterProcedureManager implements Stoppable
       try {
         in = fs.open(info);
         SnapshotDescription desc = SnapshotDescription.parseFrom(in);
+        org.apache.hadoop.hbase.client.SnapshotDescription descPOJO = 
(withCpCall)
+            ? ProtobufUtil.createSnapshotDesc(desc) : null;
         if (cpHost != null) {
           try {
-            cpHost.preListSnapshot(desc);
+            cpHost.preListSnapshot(descPOJO);
{code}
the condition {{if (cpHost != null)}} should be replaced by {{if 
(withCpCall)}}. Otherwise, we will call CP hooks even though the passed value 
of withCpCall is {{False}}.

> Deprecate/remove PB references from MasterObserver and RegionServerObserver
> ---------------------------------------------------------------------------
>
>                 Key: HBASE-16769
>                 URL: https://issues.apache.org/jira/browse/HBASE-16769
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>            Priority: Blocker
>             Fix For: 2.0.0-alpha-4
>
>         Attachments: HBASE-16769.patch, HBASE-16769_V2.patch
>
>
> This is effectively a sub-task for HBASE-15174.
> CP Methods
> MasterObserver
>       preListSnapshot
>       postListSnapshot
>       preSnapshot
>       postSnapshot
>       preCloneSnapshot
>       postCloneSnapshot
>       preRestoreSnapshot
>       postRestoreSnapshot
>       preDeleteSnapshot
>       postDeleteSnapshot
>       
>       preSetUserQuota
>       postSetUserQuota
>       preSetUserQuota
>       postSetUserQuota
>       preSetUserQuota
>       postSetUserQuota
>       preSetTableQuota
>       postSetTableQuota
>       preSetNamespaceQuota
>       postSetNamespaceQuota
>       
> RegionServerObserver
>       preReplicateLogEntries
>       postReplicateLogEntries
> Note : This issue not handling Quota related CPs.  Same is handled by a 
> subtask here HBase-18807



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to