# syntax: [prefix].[source|sink|jmx].[instance].[options]
# See package.html for org.apache.hadoop.metrics2 for details

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

#namenode.sink.file.filename=namenode-metrics.out

#datanode.sink.file.filename=datanode-metrics.out

#jobtracker.sink.file.filename=jobtracker-metrics.out

#tasktracker.sink.file.filename=tasktracker-metrics.out

#maptask.sink.file.filename=maptask-metrics.out

#reducetask.sink.file.filename=reducetask-metrics.out


#
# Below are for sending metrics to Ganglia
#
# for Ganglia 3.0 support
# *.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink30
#
# for Ganglia 3.1 support
*.sink.ganglia.class=<%= node['hadoop']['metrics2']['*.sink.ganglia.class'] %>

*.sink.ganglia.period=<%= node['hadoop']['metrics2']['*.sink.ganglia.period'] %>

# default for supportsparse is false
*.sink.ganglia.supportsparse=<%= node['hadoop']['metrics2']['*.sink.ganglia.supportsparse'] %>

*.sink.ganglia.slope=<%= node['hadoop']['metrics2']['*.sink.ganglia.slope'] %>
*.sink.ganglia.dmax=<%= node['hadoop']['metrics2']['*.sink.ganglia.dmax'] %>

<%
%w{
  namenode
  datanode
  jobtracker
  tasktracker
  maptask
  reducetask
}.each do |prefix|
  servers = node['hadoop']['metrics2']["#{prefix}.sink.ganglia.servers"]
  if !servers.nil? && !servers.empty? then
-%>
<%= prefix %>.sink.ganglia.servers=<%= servers %>

<%
  end
end
-%>
