giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eli Reisman (JIRA)" <>
Subject [jira] [Commented] (GIRAPH-717) HiveJythonRunner with support for pure Jython value types.
Date Fri, 26 Jul 2013 20:45:48 GMT


Eli Reisman commented on GIRAPH-717:

> HiveJythonRunner with support for pure Jython value types.
> ----------------------------------------------------------
>                 Key: GIRAPH-717
>                 URL:
>             Project: Giraph
>          Issue Type: Bug
>            Reporter: Nitay Joffe
>            Assignee: Nitay Joffe
> This adds support for pure Jython jobs. Currently this runner is hooked up to work with
Hive. I'll make it more generic later.
> Running a Jython job is simply:
> $HIVE_HOME/bin/hive --service jar <giraph-hive-jar> org.apache.giraph.hive.jython.HiveJythonRunner [] ...
> You can pass in any number of scripts. They will be parsed in order and sent to all the
workers using DistributedCache.
> There are examples and tests in the diff. Here is one example:
> launcher:
> worker:
> There are a few pieces to a Jython job, I'll go over each part here.
> The HiveJythonRunner will call a function called "prepare(job)" from the Jython scripts.
This is the entry point for configuring your job.
> In this configuration you setup everything, such as your graph types (those IVEMM writables)
and sets up the Hive vertex/edge inputs and output. Each graph type is one of the following:
> 1) A Java type. For example the user can specify simply IntWritable
> 2) A Jython type that implements Writable. In the example above the message value implements
> 3) A pure Jython type. The Java code will wrap these objects in a Writable wrapper that
serializes Jython values using Pickle (jython IO framework).
> Your computation must implement JythonComputation. Note that this does not actually implement
Computation, but rather is a separate class so that we can wrap all the types passed in with
a wrapper that implements Writable. The methods are named the same so that the user does not
notice anything.
> For Hive usage - if your value type is a primitive e.g. IntWritable or LongWritable,
then you need not do anything. The Java code will automatically read/write the Hive table
specified and convert between Hive types and the primitive Writable. The vertex_id type in
the example works like this.
> If your value is a custom Jython type, you must create classes which implement JythonHiveReader/JythonHiveWriter
(or JythonHiveIO which is both). These objects read/write Jython types from Hive. There are
wrappers in the Java code which take HiveIO data normally used in giraph-hive and turns them
into Jython types. This means, for example, that getMap() will return a Jython dictionary
instead of a Java Map.
> There is also a PageRankBenchmark (from previous diff) implemented in Jython. Here's
a run for comparison / sanity check:
> PageRankBenchmark with 10 workers, 100M vertices, 10B edges, 10 compute threads
> trunk:
>   total time: 302466
> with this diff:
>   total time: 306517
> in jython:
>   total time: 434730
> So we see that existing things are not affected (is there something else I should test?)
and that Jython has around 40% overhead.
> ReviewBoard: (Sorry it's a big one, hard to split
up :/)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message