Skip to content

Instantly share code, notes, and snippets.

Kiru Pakkirisamy kbkaran

  • Splunk, Inc.
  • San Francisco
View GitHub Profile
@kbkaran
kbkaran / JavaMapTest
Created Sep 22, 2013
Test program to show the performance characteristics of HashMap in Java.
View JavaMapTest
package com.serendio.test;
import gnu.trove.map.hash.THashMap;
import gnu.trove.map.hash.TIntIntHashMap;
import java.util.HashMap;
import java.util.Map;
public class JavaMapTest {
View clouderamanagerapp-macros.conf
[cloudera_mapred_server]
definition = index="cmmon_index" TYPE="JOBTRACKER" | stats latest(HOST) as INSTANCE by CLUSTER, SERVICE | table CLUSTER, SERVICE, INSTANCE
iseval = 0
[cloudera_hdfs_server]
definition = index="cmmon_index" TYPE="NAMENODE" | stats latest(HOST) as INSTANCE by CLUSTER, SERVICE | table CLUSTER, SERVICE,INSTANCE
iseval = 0
[cloudera_hue_server]
definition = index="cmmon_index" TYPE="HUE_SERVER" | stats latest(HOST) as INSTANCE by CLUSTER, SERVICE | table CLUSTER, SERVICE, INSTANCE
View cm_mon.py
import os
import sys
sys.path.append('/home/kiru/cloudera-cm_api-cc9eac0/python/dist/cm_api-2.0.0-py2.7.egg')
from cm_api.api_client import ApiResource
api = ApiResource('localhost', username='admin', password='admin')
myclusters = api.get_all_clusters()
for cluster in myclusters:
thiscluster = api.get_cluster(cluster.name)
View example.conf
# Name the components on this agent
agent1.sources = source1
agent1.sinks = sink1 hdfssink1
agent1.channels = channel1 channel2
# Describe/configure source1
agent1.sources.source1.type = netcat
agent1.sources.source1.bind = localhost
agent1.sources.source1.port = 44444
View SplunkSink.java
package com.kiru.flume.sink.splunk;
import java.io.IOException;
import org.apache.flume.Channel;
import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.Transaction;
import org.apache.flume.conf.Configurable;
import org.apache.flume.sink.AbstractSink;
You can’t perform that action at this time.