Skip to content

Instantly share code, notes, and snippets.

View kbkaran's full-sized avatar

Kiru Pakkirisamy kbkaran

  • Cityblock, Inc.
  • New York, NY
View GitHub Profile
@kbkaran
kbkaran / JavaMapTest
Created September 22, 2013 01:58
Test program to show the performance characteristics of HashMap in Java.
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 {
[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
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)
# 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
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;