org.apache.hadoop.chukwa.analysis.salsa.visualization
Class Heatmap

java.lang.Object
  extended by org.apache.hadoop.chukwa.analysis.salsa.visualization.Heatmap

public class Heatmap
extends Object

Static image rendering for heatmap visualization of spatial HDFS activity patterns for scalable rendering on front-end (web-browser) Handles database data retrieval, transforming data to form for visualization elements, and initializing and calling visualization elements


Nested Class Summary
protected static class Heatmap.HeatmapData
          Internal representation of all data needed to render heatmap; data-handling code populates this data structure
 
Field Summary
protected  String add_info_extra
           
protected  String cluster
           
protected  Rectangle2D dataBound
           
protected  prefuse.Display dis
           
protected  Rectangle2D labelBottomBound
           
protected  boolean offline_use
           
protected  HashMap<String,String> param_map
           
protected  boolean plot_additional_info
           
protected  boolean plot_legend
           
protected  HashMap<String,String> prettyStateNames
           
protected  String query_stat_type
           
protected  String query_state
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  boolean sort_nodes
           
protected  String table
           
protected  String timezone
           
protected  prefuse.Visualization viz
           
protected  Rectangle2D xlabBound
           
protected  Rectangle2D ylabBound
           
 
Constructor Summary
Heatmap()
           
Heatmap(javax.servlet.http.HttpServletRequest request)
           
Heatmap(String timezone, String cluster, String event_type, String query_stat_type, HashMap<String,String> valmap)
           
Heatmap(String timezone, String cluster, String query_state, String query_stat_type, HashMap<String,String> valmap, int w, int h)
           
Heatmap(String timezone, String cluster, String query_state, String query_stat_type, HashMap<String,String> valmap, String shuffles)
           
 
Method Summary
protected  void addAddlInfo(Heatmap.HeatmapData hd)
           
protected  void addHostLabels(Heatmap.HeatmapData hd)
           
protected  boolean checkDone(int[] clustId)
           
protected  long[][] doPermute(long[][] stat, int[] permute)
          Reorder rows (and columns) according to a given ordering Maintains same ordering along rows and columns
 Heatmap.HeatmapData getData()
          Interfaces with database to get data and populate data structures for rendering
 boolean getImage(OutputStream output, String img_fmt, double scale)
          Generates image in specified format, and writes image as binary output to supplied output stream
protected  int[] hClust(long[][] stat)
          Sort data for better visualization of patterns
protected  void initPrettyNames()
           
 void run()
          Actual code that calls data, generates heatmap, and saves it
 void setDimensions(int width, int height)
          Set dimensions of image to be generated Call before calling @see #run
 void setLegend(boolean legendopt)
          Specify whether to print labels of hosts along axes Call before calling @see #run
protected  Heatmap.HeatmapData setupDataTable()
           
protected  void setupHeatmap(prefuse.visual.VisualTable vtab, Heatmap.HeatmapData hd)
           
protected  void setupRenderer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offline_use

protected boolean offline_use

request

protected javax.servlet.http.HttpServletRequest request

param_map

protected HashMap<String,String> param_map

cluster

protected String cluster

timezone

protected String timezone

query_state

protected String query_state

query_stat_type

protected String query_stat_type

table

protected final String table

plot_legend

protected boolean plot_legend

sort_nodes

protected boolean sort_nodes

plot_additional_info

protected boolean plot_additional_info

add_info_extra

protected String add_info_extra

dis

protected prefuse.Display dis

viz

protected prefuse.Visualization viz

dataBound

protected Rectangle2D dataBound

xlabBound

protected Rectangle2D xlabBound

ylabBound

protected Rectangle2D ylabBound

labelBottomBound

protected Rectangle2D labelBottomBound

prettyStateNames

protected HashMap<String,String> prettyStateNames
Constructor Detail

Heatmap

public Heatmap()

Heatmap

public Heatmap(String timezone,
               String cluster,
               String event_type,
               String query_stat_type,
               HashMap<String,String> valmap)
Parameters:
timezone - Timezone string from environment
cluster - Cluster name from environment
event_type - Whether to display shuffles or not
valmap - HashMap of key/value pairs simulating parameters from a HttpRequest

Heatmap

public Heatmap(String timezone,
               String cluster,
               String query_state,
               String query_stat_type,
               HashMap<String,String> valmap,
               String shuffles)

Heatmap

public Heatmap(String timezone,
               String cluster,
               String query_state,
               String query_stat_type,
               HashMap<String,String> valmap,
               int w,
               int h)

Heatmap

public Heatmap(javax.servlet.http.HttpServletRequest request)
Method Detail

setDimensions

public void setDimensions(int width,
                          int height)
Set dimensions of image to be generated Call before calling @see #run


setLegend

public void setLegend(boolean legendopt)
Specify whether to print labels of hosts along axes Call before calling @see #run


getImage

public boolean getImage(OutputStream output,
                        String img_fmt,
                        double scale)
Generates image in specified format, and writes image as binary output to supplied output stream


setupRenderer

protected void setupRenderer()

setupDataTable

protected Heatmap.HeatmapData setupDataTable()

setupHeatmap

protected void setupHeatmap(prefuse.visual.VisualTable vtab,
                            Heatmap.HeatmapData hd)

addHostLabels

protected void addHostLabels(Heatmap.HeatmapData hd)

addAddlInfo

protected void addAddlInfo(Heatmap.HeatmapData hd)

initPrettyNames

protected void initPrettyNames()

run

public void run()
Actual code that calls data, generates heatmap, and saves it


checkDone

protected boolean checkDone(int[] clustId)

hClust

protected int[] hClust(long[][] stat)
Sort data for better visualization of patterns


doPermute

protected long[][] doPermute(long[][] stat,
                             int[] permute)
Reorder rows (and columns) according to a given ordering Maintains same ordering along rows and columns


getData

public Heatmap.HeatmapData getData()
Interfaces with database to get data and populate data structures for rendering



Copyright © ${year} The Apache Software Foundation