hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lars hofhansl <la...@apache.org>
Subject Re: meaning for AgeOfLastAppliedOp in Replication MetricsSink
Date Wed, 30 Jul 2014 05:54:15 GMT
This metric indicates the time an edit sat in the "replication queue" before it got replicated.
With that definition it is doing the right thing: Reporting current time - the time an edit
entered the system (it's WAL time) 

-- Lars

 From: Demai Ni <nidmgg@gmail.com>
To: "dev@hbase.apache.org" <dev@hbase.apache.org> 
Sent: Tuesday, July 29, 2014 3:48 PM
Subject: meaning for AgeOfLastAppliedOp in Replication MetricsSink


A quick question to clarify this  AgeOfLastAppliedOp in MetricsSink.java. I
assume it is used as an indicator about how long for a Sink OP to be
applied; but instead, it is more like to show how long since the last Sink
OP applied

   * Set the age of the last applied operation
   * @param timestamp The timestamp of the last operation applied.
   * @return the age that was set
  public long setAgeOfLastAppliedOp(long timestamp) {
    lastTimestampForAge = timestamp;
    long age = System.currentTimeMillis() - lastTimestampForAge;
    rms.setGauge(SINK_AGE_OF_LAST_APPLIED_OP, age);
    return age;

In the following scenario:
1) at 7:00am a sink op is applied, and the SINK_AGE_OF_LAST_APPLIED_OP is
set for example 100ms;
2) and then NO new Sink op occur.
3) when a refreshAgeOfLastAppliedOp() is invoked at 8:00am. Instead of
return the 100ms, the AgeOfLastAppliedOp become 1hour + 100ms, which
doesn't make sense, right?

should we put a check for (lastTimestampForAge != timestamp) before refresh
the age?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message