@Private
public class RollingWindowManager
extends java.lang.Object
RollingWindows. This class is the
interface of metrics system to the RollingWindows to retrieve the
current top metrics.
Thread-safety is provided by each RollingWindow being thread-safe as
well as ConcurrentHashMap for the collection of them.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
RollingWindowManager.Op |
Represents an operation within a TopWindow.
|
static class |
RollingWindowManager.TopWindow |
Represents a snapshot of the rolling window.
|
static class |
RollingWindowManager.User |
Represents a user who called an Op within a TopWindow.
|
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
|
java.util.concurrent.ConcurrentHashMap<java.lang.String,org.apache.hadoop.hdfs.server.namenode.top.window.RollingWindowManager.RollingWindowMap> |
metricMap |
A mapping from each reported metric to its
RollingWindowManager.RollingWindowMap that
maintains the set of RollingWindows for the users that have
operated on that metric. |
| Constructor | Description |
|---|---|
RollingWindowManager(org.apache.hadoop.conf.Configuration conf,
int reportingPeriodMs) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
recordMetric(long time,
java.lang.String command,
java.lang.String user,
long delta) |
Called when the metric command is changed by "delta" units at time "time"
via user "user"
|
RollingWindowManager.TopWindow |
snapshot(long time) |
Take a snapshot of current top users in the past period.
|
public static final org.slf4j.Logger LOG
public java.util.concurrent.ConcurrentHashMap<java.lang.String,org.apache.hadoop.hdfs.server.namenode.top.window.RollingWindowManager.RollingWindowMap> metricMap
RollingWindowManager.RollingWindowMap that
maintains the set of RollingWindows for the users that have
operated on that metric.public RollingWindowManager(org.apache.hadoop.conf.Configuration conf,
int reportingPeriodMs)
public void recordMetric(long time,
java.lang.String command,
java.lang.String user,
long delta)
time - the time of the eventcommand - the metric that is updated, e.g., the operation nameuser - the user that updated the metricdelta - the amount of change in the metric, e.g., +1public RollingWindowManager.TopWindow snapshot(long time)
time - the current timeCopyright © 2008–2025 Apache Software Foundation. All rights reserved.