Author: olga
Date: Tue Apr 13 20:40:21 2010
New Revision: 933774

URL: http://svn.apache.org/viewvc?rev=933774&view=rev
Log:
PIG-1376: Pig 060 Docs - ILLUSTRATE and Passing Configurations to UDFs (chandec 
via olgan)

Modified:
    hadoop/pig/branches/branch-0.6/CHANGES.txt
    
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/piglatin_ref2.xml
    
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/udf.xml

Modified: hadoop/pig/branches/branch-0.6/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.6/CHANGES.txt?rev=933774&r1=933773&r2=933774&view=diff
==============================================================================
--- hadoop/pig/branches/branch-0.6/CHANGES.txt (original)
+++ hadoop/pig/branches/branch-0.6/CHANGES.txt Tue Apr 13 20:40:21 2010
@@ -26,6 +26,8 @@ PIG-922: Logical optimizer: push up proj
 
 IMPROVEMENTS
 
+PIG-1376: Pig 060 Docs - ILLUSTRATE and Passing Configurations to UDFs 
(chandec via olgan)
+
 PIG-1214: Pig 0.6 Docs fixes (chandec via olgan)
 
 PIG-1197: TextLoader updated to match changes to PigStorage (gates)

Modified: 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/piglatin_ref2.xml
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/piglatin_ref2.xml?rev=933774&r1=933773&r2=933774&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/piglatin_ref2.xml
 (original)
+++ 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/piglatin_ref2.xml
 Tue Apr 13 20:40:21 2010
@@ -7105,6 +7105,7 @@ Local Rearrange[tuple]{chararray}(false)
    
    <section>
    <title>ILLUSTRATE</title>
+   <para>(Note! This feature is NOT maintained at the momemt. We are looking 
for someone to adopt it.)</para>
    <para>Displays a step-by-step execution of a sequence of statements.</para>
    
    <section>

Modified: 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/udf.xml
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/udf.xml?rev=933774&r1=933773&r2=933774&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/udf.xml 
(original)
+++ 
hadoop/pig/branches/branch-0.6/src/docs/src/documentation/content/xdocs/udf.xml 
Tue Apr 13 20:40:21 2010
@@ -1111,14 +1111,19 @@ public class RangeSlicer implements Slic
 <source>
 LOAD '27' USING RangeSlicer();
 </source>
-
 </section>
-
 </section>
 
+<section>
+<title>Passing Configurations to UDFs</title>
+<p>The singleton UDFContext class provides two features to UDF writers. First, 
on the backend, it allows UDFs to get access to the JobConf object, by calling 
getJobConf. This is only available on the backend (at run time) as the JobConf 
has not yet been constructed on the front end (during planning time).</p>
 
+<p>Second, it allows UDFs to pass configuration information between 
instantiations of the UDF on the front and backends. UDFs can store information 
in a configuration object when they are constructed on the front end, or during 
other front end calls such as describeSchema. They can then read that 
information on the backend when exec (for EvalFunc) or getNext (for LoadFunc) 
is called. Note that information will not be passed between instantiations of 
the function on the backend. The communication channel only works from front 
end to back end.</p>
+
+<p>To store information, the UDF calls getUDFProperties. This returns a 
Properties object which the UDF can record the information in or read the 
information from. To avoid name space conflicts UDFs are required to provide a 
signature when obtaining a Properties object. This can be done in two ways. The 
UDF can provide its Class object (via this.getClass()). In this case, every 
instantiation of the UDF will be given the same Properties object. The UDF can 
also provide its Class plus an array of Strings. The UDF can pass its 
constructor arguments, or some other identifying strings. This allows each 
instantiation of the UDF to have a different properties object thus avoiding 
name space collisions between instantiations of the UDF.</p>
 </section>
 
+</section>
 </body>
 </document>
 


Reply via email to