Package org.apache.hadoop.hbase.slowlog
Class SlowLogTableAccessor
java.lang.Object
org.apache.hadoop.hbase.slowlog.SlowLogTableAccessor
Slowlog Accessor to record slow/large RPC log identified at each RegionServer RpcServer level.
This can be done only optionally to record the entire history of slow/large rpc calls since
RingBuffer can handle only limited latest records.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
static final TableName
hbase:slowlog table name - can be enabled with config - hbase.regionserver.slowlog.systable.enabled -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSlowLogRecords
(List<org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload> slowLogPayloads, Connection connection) Add slow/large log records to hbase:slowlog tableprivate static void
doPut
(Connection connection, List<Put> puts) private static byte[]
getRowKey
(org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload slowLogPayload) Create rowKey: currentTime APPEND slowLogPayload.hashcode Scan on slowlog table should keep records with sorted order of time, however records added at the very same time could be in random order.
-
Field Details
-
LOG
-
SLOW_LOG_TABLE_NAME
hbase:slowlog table name - can be enabled with config - hbase.regionserver.slowlog.systable.enabled
-
-
Constructor Details
-
SlowLogTableAccessor
public SlowLogTableAccessor()
-
-
Method Details
-
doPut
- Throws:
IOException
-
addSlowLogRecords
public static void addSlowLogRecords(List<org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload> slowLogPayloads, Connection connection) Add slow/large log records to hbase:slowlog table- Parameters:
slowLogPayloads
- List of SlowLogPayload to processconnection
- connection
-
getRowKey
private static byte[] getRowKey(org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload slowLogPayload) Create rowKey: currentTime APPEND slowLogPayload.hashcode Scan on slowlog table should keep records with sorted order of time, however records added at the very same time could be in random order.- Parameters:
slowLogPayload
- SlowLogPayload to process- Returns:
- rowKey byte[]
-