Support Questions

Find answers, ask questions, and share your expertise

Cloudera Manager HBase Trigger

avatar
New Contributor

Hi, 

we are trying to create an alert to get notification when no row was inserted into a given HBase table in given period of time. 

 

The following command was used: 

IF (SELECT total_write_requests_rate_across_regionservers WHERE serviceName=$SERVICENAME AND max(total_write_requests_rate_across_regionservers ) = 0 AND entityName = "hbase" AND category = "SERVICE") DO health:bad

but the name of HBase table is missing. 

The `htableName` property is mentioned under the https://docs.cloudera.com/documentation/enterprise/6/6.3/topics/cm_dg_tsquery.html#concept_d2g_k11_d... chapter, but it does not work - the command return empty results after putting the `htableName` attribute to WHERE condition. 

Could I please to an advice, how to get a notification when entities are not inserted to the HBase table?

1 ACCEPTED SOLUTION

avatar
Cloudera Employee

This metric is specific to the region server level and cannot be sorted or filtered based on the table name. However, You can leverage the timerange option with scan to check if there are any rows inserted between two timestamps. By default, the timestamp represents the time on the RegionServer when the data was written, so unless you specify a different timestamp value when you put data into the cell, you can leverage with the cell timestamps to check the insertion time.

for example,

scan 'NS:TableName', { TIMERANGE => [1589621394000, 1589637999999] }

You can get epoch time from HBase shell as well using this option.

SimpleDateFormat.new("yy/MM/dd HH:mm:ss").parse("08/08/16 20:56:29", ParsePosition.new(0)).getTime() => 1218920189000

 

View solution in original post

3 REPLIES 3

avatar
Community Manager

@skomar89 Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our HBase experts @pajoshi @ChrisGe  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Cloudera Employee

This metric is specific to the region server level and cannot be sorted or filtered based on the table name. However, You can leverage the timerange option with scan to check if there are any rows inserted between two timestamps. By default, the timestamp represents the time on the RegionServer when the data was written, so unless you specify a different timestamp value when you put data into the cell, you can leverage with the cell timestamps to check the insertion time.

for example,

scan 'NS:TableName', { TIMERANGE => [1589621394000, 1589637999999] }

You can get epoch time from HBase shell as well using this option.

SimpleDateFormat.new("yy/MM/dd HH:mm:ss").parse("08/08/16 20:56:29", ParsePosition.new(0)).getTime() => 1218920189000

 

avatar
Community Manager

@skomar89 Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: