Package org.apache.storm.stats
Class ClientStatsUtil
java.lang.Object
org.apache.storm.stats.ClientStatsUtil
Stats calculations needed by storm client code.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionconvertExecutor(List<Long> executor) Convert a List<Long> executor to java List<Integer>.static Map<List<Integer>,ExecutorStats> convertExecutorZkHbs(Map<List<Long>, ExecutorStats> executorBeats) Convert Long Executor Ids in ZkHbs to Integer ones structure to java maps.static <K,V> Map<K, V> getMapByKey(Map map, String key) Get a sub-map by a given key.static Map<List<Integer>,ExecutorStats> mkEmptyExecutorZkHbs(Set<List<Long>> executors) Make an map of executors to empty stats, in preparation for doing a heartbeat.mkZkWorkerHb(String topoId, Map<List<Integer>, ExecutorStats> executorStats, Integer uptime) Create a new worker heartbeat for zookeeper.static ClusterWorkerHeartbeatthriftifyZkWorkerHb(Map<String, Object> heartbeat) static <K1,K2> Map windowSetConverter(Map stats, org.apache.storm.stats.ClientStatsUtil.KeyTransformer<K2> secKeyFunc, org.apache.storm.stats.ClientStatsUtil.KeyTransformer<K1> firstKeyFunc) Converts stats to be over given windows of time.
- 
Field Details- 
SPOUT- See Also:
 
- 
BOLT- See Also:
 
- 
TIME_SECS- See Also:
 
- 
TO_GSIDpublic static final org.apache.storm.stats.ClientStatsUtil.ToGlobalStreamIdTransformer TO_GSID
- 
IDENTITYpublic static final org.apache.storm.stats.ClientStatsUtil.IdentityTransformer IDENTITY
 
- 
- 
Constructor Details- 
ClientStatsUtilpublic ClientStatsUtil()
 
- 
- 
Method Details- 
convertExecutorConvert a List<Long> executor to java List<Integer>.
- 
mkEmptyExecutorZkHbsMake an map of executors to empty stats, in preparation for doing a heartbeat.- Parameters:
- executors- the executors as keys of the map
- Returns:
- and empty map of executors to stats
 
- 
convertExecutorZkHbspublic static Map<List<Integer>,ExecutorStats> convertExecutorZkHbs(Map<List<Long>, ExecutorStats> executorBeats) Convert Long Executor Ids in ZkHbs to Integer ones structure to java maps.
- 
mkZkWorkerHbpublic static Map<String,Object> mkZkWorkerHb(String topoId, Map<List<Integer>, ExecutorStats> executorStats, Integer uptime) Create a new worker heartbeat for zookeeper.- Parameters:
- topoId- the topology id
- executorStats- the stats for the executors
- uptime- the uptime for the worker
- Returns:
- the heartbeat map
 
- 
getMapByKeyGet a sub-map by a given key.- Parameters:
- map- the original map
- key- the key to get it from
- Returns:
- the map stored under key
 
- 
thriftifyZkWorkerHb
- 
windowSetConverterpublic static <K1,K2> Map windowSetConverter(Map stats, org.apache.storm.stats.ClientStatsUtil.KeyTransformer<K2> secKeyFunc, org.apache.storm.stats.ClientStatsUtil.KeyTransformer<K1> firstKeyFunc) Converts stats to be over given windows of time.- Parameters:
- stats- the stats
- secKeyFunc- transform the sub-key
- firstKeyFunc- transform the main key
 
 
-