Package org.apache.hadoop.ruby

Examples of org.apache.hadoop.ruby.JRubyEvaluator


  public void reduce(Text key, Iterator<IntWritable> values,
      OutputCollector<Text, IntWritable> output, Reporter reporter)
      throws IOException {
    // invoke "reduce" method in ruby
    JRubyEvaluator evaluator = getJRubyEvaluator();
    try {
      evaluator.invoke("wrap_reduce", key, values, output, reporter);
    } catch (ScriptException e) {
      reporter.setStatus(e.getMessage());
    } finally {
      evaluator.checkResource();
    }
  }
View Full Code Here


  public JRubyEvaluator getJRubyEvaluator() {
    return this.evaluator;
  }

  public void configure(JobConf job) {
    evaluator = new JRubyEvaluator(job);
  }
View Full Code Here

  public void map(LongWritable key, Text value,
      OutputCollector<Text, IntWritable> output, Reporter reporter)
      throws IOException {
    // invoke "map" method in ruby
    JRubyEvaluator evaluator = getJRubyEvaluator();
    try {
      evaluator.invoke("wrap_map", key, value, output, reporter);
    } catch (ScriptException e) {
      reporter.setStatus(e.getMessage());
    } finally {
      evaluator.checkResource();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.ruby.JRubyEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.