public class FSStatsPublisher extends Object implements StatsPublisher
Constructor and Description |
---|
FSStatsPublisher() |
Modifier and Type | Method and Description |
---|---|
boolean |
closeConnection(StatsCollectionContext context)
This method closes the connection to the temporary storage.
|
boolean |
connect(StatsCollectionContext context)
This method connects to the intermediate statistics database.
|
boolean |
init(StatsCollectionContext context)
This method does the necessary one-time initializations, possibly creating the tables and
database (if not exist).
|
boolean |
publishStat(String partKV,
Map<String,String> stats)
This method publishes a given statistic into a disk storage, possibly HBase or MySQL.
|
public boolean init(StatsCollectionContext context)
StatsPublisher
init
in interface StatsPublisher
public boolean connect(StatsCollectionContext context)
StatsPublisher
connect
in interface StatsPublisher
public boolean publishStat(String partKV, Map<String,String> stats)
StatsPublisher
publishStat
in interface StatsPublisher
partKV
- : a string identification the statistics to be published by all mappers/reducers
and then gathered. The statID is unique per output partition per task, e.g.,:
the output directory name (uniq per FileSinkOperator) +
the partition specs (only for dynamic partitions) +
taskID (last component of task file)stats
- : a map containing key-value pairs, where key is a string representing the statistic
to be published,
and value is a string representing the value for the given statisticpublic boolean closeConnection(StatsCollectionContext context)
StatsPublisher
closeConnection
in interface StatsPublisher
Copyright © 2017 The Apache Software Foundation. All rights reserved.