public class PigJrubyLibrary
extends java.lang.Object
implements org.jruby.runtime.load.Library
Constructor and Description |
---|
PigJrubyLibrary() |
Modifier and Type | Method and Description |
---|---|
static org.jruby.runtime.builtin.IRubyObject |
enumeratorize(org.jruby.Ruby runtime,
org.jruby.runtime.builtin.IRubyObject obj,
java.lang.String name)
This is a hack to get around the fact that in JRuby 1.6.7, the enumeratorize method
isn't public.
|
void |
load(org.jruby.Ruby runtime,
boolean wrap)
This method is called from JRuby to register any classes in
the library.
|
static org.jruby.RubyBoolean |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Boolean object)
A type specific conversion routine.
|
static RubyDataBag |
pigToRuby(org.jruby.Ruby ruby,
DataBag object)
A type specific conversion routine.
|
static RubyDataByteArray |
pigToRuby(org.jruby.Ruby ruby,
DataByteArray object)
A type specific conversion routine.
|
static org.jruby.RubyFloat |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Double object)
A type specific conversion routine.
|
static org.jruby.RubyFloat |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Float object)
A type specific conversion routine.
|
static org.jruby.RubyFixnum |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Integer object)
A type specific conversion routine.
|
static org.jruby.RubyFixnum |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Long object)
A type specific conversion routine.
|
static <T> org.jruby.RubyHash |
pigToRuby(org.jruby.Ruby ruby,
java.util.Map<T,?> object)
A type specific conversion routine for Pig Maps.
|
static org.jruby.runtime.builtin.IRubyObject |
pigToRuby(org.jruby.Ruby ruby,
java.lang.Object object)
This is the method which provides conversion from Pig to Ruby.
|
static RubySchema |
pigToRuby(org.jruby.Ruby ruby,
Schema object)
A type specific conversion routine.
|
static org.jruby.RubyString |
pigToRuby(org.jruby.Ruby ruby,
java.lang.String object)
A type specific conversion routine.
|
static org.jruby.RubyArray |
pigToRuby(org.jruby.Ruby ruby,
Tuple object)
A type specific conversion routine.
|
static java.lang.Object |
rubyToPig(org.jruby.runtime.builtin.IRubyObject rbObject)
This method facilitates conversion from Ruby objects to Pig objects.
|
static Tuple |
rubyToPig(org.jruby.RubyArray rbObject)
A type specific conversion routine.
|
static java.lang.Long |
rubyToPig(org.jruby.RubyBignum rbObject)
A type specific conversion routine.
|
static java.lang.Boolean |
rubyToPig(org.jruby.RubyBoolean rbObject)
A type specific conversion routine.
|
static DataBag |
rubyToPig(RubyDataBag rbObject)
A type specific conversion routine.
|
static DataByteArray |
rubyToPig(RubyDataByteArray rbObject)
A type specific conversion routine.
|
static java.lang.Long |
rubyToPig(org.jruby.RubyFixnum rbObject)
A type specific conversion routine.
|
static java.lang.Double |
rubyToPig(org.jruby.RubyFloat rbObject)
A type specific conversion routine.
|
static java.util.Map<java.lang.String,?> |
rubyToPig(org.jruby.RubyHash rbObject)
A type specific conversion routine.
|
static java.lang.Integer |
rubyToPig(org.jruby.RubyInteger rbObject)
A type specific conversion routine.
|
static java.lang.Object |
rubyToPig(org.jruby.RubyNil rbObject)
A type specific conversion routine.
|
static Schema |
rubyToPig(RubySchema rbObject)
A type specific conversion routine.
|
static java.lang.String |
rubyToPig(org.jruby.RubyString rbObject)
A type specific conversion routine.
|
public void load(org.jruby.Ruby runtime, boolean wrap) throws java.io.IOException
load
in interface org.jruby.runtime.load.Library
runtime
- the current Ruby runtimewrap
- ignoredjava.io.IOException
public static java.lang.Object rubyToPig(org.jruby.runtime.builtin.IRubyObject rbObject) throws ExecException
rbObject
- a Ruby object to convertExecException
- if rbObject is not of a known type that can be convertedpublic static Tuple rubyToPig(org.jruby.RubyArray rbObject) throws ExecException
rbObject
- object to convertExecException
public static java.util.Map<java.lang.String,?> rubyToPig(org.jruby.RubyHash rbObject) throws ExecException
rbObject
- object to convertExecException
public static java.lang.Boolean rubyToPig(org.jruby.RubyBoolean rbObject)
rbObject
- object to convertpublic static Schema rubyToPig(RubySchema rbObject)
rbObject
- object to convertpublic static java.lang.String rubyToPig(org.jruby.RubyString rbObject)
rbObject
- object to convertpublic static java.lang.Long rubyToPig(org.jruby.RubyBignum rbObject)
rbObject
- object to convertpublic static java.lang.Long rubyToPig(org.jruby.RubyFixnum rbObject)
rbObject
- object to convertpublic static java.lang.Double rubyToPig(org.jruby.RubyFloat rbObject)
rbObject
- object to convertpublic static java.lang.Integer rubyToPig(org.jruby.RubyInteger rbObject)
rbObject
- object to convertpublic static DataBag rubyToPig(RubyDataBag rbObject)
rbObject
- object to convertpublic static DataByteArray rubyToPig(RubyDataByteArray rbObject)
rbObject
- object to convertpublic static java.lang.Object rubyToPig(org.jruby.RubyNil rbObject)
rbObject
- object to convertpublic static org.jruby.runtime.builtin.IRubyObject pigToRuby(org.jruby.Ruby ruby, java.lang.Object object) throws ExecException
ruby
- the Ruby runtime to create objects inobject
- the Pig object to convert to RubyExecException
- object is not a convertible Pig typepublic static org.jruby.RubyArray pigToRuby(org.jruby.Ruby ruby, Tuple object) throws ExecException
ruby
- the Ruby runtime to create objects inobject
- object to convertExecException
- object contained an object that could not convertpublic static org.jruby.RubyBoolean pigToRuby(org.jruby.Ruby ruby, java.lang.Boolean object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static RubyDataBag pigToRuby(org.jruby.Ruby ruby, DataBag object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static RubySchema pigToRuby(org.jruby.Ruby ruby, Schema object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static <T> org.jruby.RubyHash pigToRuby(org.jruby.Ruby ruby, java.util.Map<T,?> object) throws ExecException
ruby
- the Ruby runtime to create objects inobject
- map to convert. In Pig, only maps with String keys are
supportedExecException
- object contains a key that can't be convert to a Ruby typepublic static RubyDataByteArray pigToRuby(org.jruby.Ruby ruby, DataByteArray object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.RubyString pigToRuby(org.jruby.Ruby ruby, java.lang.String object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.RubyFixnum pigToRuby(org.jruby.Ruby ruby, java.lang.Integer object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.RubyFixnum pigToRuby(org.jruby.Ruby ruby, java.lang.Long object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.RubyFloat pigToRuby(org.jruby.Ruby ruby, java.lang.Float object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.RubyFloat pigToRuby(org.jruby.Ruby ruby, java.lang.Double object)
ruby
- the Ruby runtime to create objects inobject
- object to convertpublic static org.jruby.runtime.builtin.IRubyObject enumeratorize(org.jruby.Ruby runtime, org.jruby.runtime.builtin.IRubyObject obj, java.lang.String name)
runtime
- the Ruby runtime to create objects inobj
- the Enumerable object to wrapname
- the name of the method that still needs a block (ie each or flatten)Copyright © 2007-2017 The Apache Software Foundation