You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Andrew Purtell (JIRA)" <ji...@apache.org> on 2016/08/19 17:48:20 UTC

[jira] [Comment Edited] (HBASE-16448) Custom metrics for custom replication endpoints

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

Andrew Purtell edited comment on HBASE-16448 at 8/19/16 5:47 PM:
-----------------------------------------------------------------

Please add an interface annotation similar to that of MetricsSource:
{code}
-public interface MetricsReplicationSourceSource {
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+public interface MetricsReplicationSourceSource extends BaseSource {
{code}

This change to the inheritance hierarchy of an LP interface is fine but means it can only go in on a new minor:
{code}
  * through the metrics interfaces.
  */
 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
-public class MetricsSource {
+public class MetricsSource implements BaseSource {
{code}

Edit: Removed a review error


was (Author: apurtell):
Please add an interface annotation similar to that of MetricsSource:
{code}
-public interface MetricsReplicationSourceSource {
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+public interface MetricsReplicationSourceSource extends BaseSource {
{code}

This change to the inheritance hierarchy of an LP interface is fine but means it can only go in on a new minor:
{code}
  * through the metrics interfaces.
  */
 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
-public class MetricsSource {
+public class MetricsSource implements BaseSource {
{code}

This is a more significant operational incompatibility that might not be allowed in except a new major release:
{code}
   public MetricsReplicationSourceSourceImpl(MetricsReplicationSourceImpl rms, String id) {
     this.rms = rms;
     this.id = id;
+    this.keyPrefix = "source." + this.id + ".";
 
-    ageOfLastShippedOpKey = "source." + id + ".ageOfLastShippedOp";
+    ageOfLastShippedOpKey = this.keyPrefix + "ageOfLastShippedOp";
     ageOfLastShippedOpGauge = rms.getMetricsRegistry().getGauge(ageOfLastShippedOpKey, 0L);
{code}


> Custom metrics for custom replication endpoints
> -----------------------------------------------
>
>                 Key: HBASE-16448
>                 URL: https://issues.apache.org/jira/browse/HBASE-16448
>             Project: HBase
>          Issue Type: Improvement
>          Components: Replication
>    Affects Versions: 2.0.0, 1.2.2, 0.98.21
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>         Attachments: HBASE-16448.patch
>
>
> ReplicationEndpoints contain a MetricsSource class that can update a fixed set of key replication metrics. It does not, however, allow a developer implementing a custom ReplicationEndpoint to create/update custom metrics unique to the new endpoint's use case. 
> As it turns out, MetricsSource wraps a class, which in turn wraps a class, that implements the Hadoop BaseSource interface, which does allow for custom metrics. Simply having the two wrappers implement BaseSource as well with pass-through methods should be straightforward, and would allow replication endpoints to use these generic metric methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)