Git Product home page Git Product logo

houdah's Introduction

houdah – Ruby lib for interacting with a Hadoop JobTracker / TaskTrackers

Houdah is a Ruby thrift lib for interfacing with a Hadoop jobtracker.

To install:

gem install houdah

Starting thrift server

Houdah expects that you have Cloudera’s Hue installed and working. As a part of the Hue installation, you will compile and install a thrift interface that runs when the jobtracker is running. To be clear, you do not have to run Hue in order for Houdah to work - you just need to make sure that the org.apache.hadoop.thriftfs.ThriftJobTrackerPlugin is working.

Houdah has been tested with Hue 1.1.0. If you have it working with a later version of Hue, patches are welcome.

Basic Usage

require 'rubygems'
require 'houdah'

# args are host, optional port (9290 default), optional username (default "houdah"), and optional timeout
client = Houdah::Client.new "192.168.1.1"

# get list of running jobs
client.jobs

# get a list of failed jobs
client.jobs(:failed)

# get jobtracker name
client.name

# get percent mapped / reduced for all running jobs
client.jobs.each { |j| puts "#{j.percent_mapped} mapped #{j.percent_reduced} reduced" }

# get percent done for the most recent job
client.jobs.first.percent_done

# print out info about each tracker
client.trackers.each { |t| puts "#{t.host}: #{t.failureCount} failures, #{t.tasks.length} active tasks" }

# get number of active / blacklisted trackers
client.status.numActiveTrackers
client.status.numBlacklistedTrackers

# get number of excluded nodes
client.status.numExcludedNodes

# get the mapred.local.dir config variable for the most recent job
puts client.jobs.first.config['mapred.local.dir']

# get the hive query for the hive job running
puts client.jobs.first.config['hive.query.string']

# kill all jobs
client.jobs.each { |j| j.kill! }

# close the client connection
client.close

# Quick and dirty way to get the number of killed jobs.  The run class method takes care of closing the client.
puts Houdah::Client.run("192.168.1.1") { |h| h.jobs(:killed).length }

Bugs / Contact

Bugs and patches welcome at github.com/livingsocial/houdah.

houdah's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

houdah's Issues

please add rake, thin as dependencies

I tried installing the gem and use a sample code and it seems the code simply fails until I install rack and thin gems which are seemingly the other dependencies for houdah.

how to get the job counters for a given jobid

Hi,

Could you please help through some sample code to get the job counters for a given jobID. Do I have to directly call up the thrift or are there any abstract methods to fetch the job counters for a given job, could you please help on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.