crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r927229 - in /websites/staging/crunch/trunk/content: ./ user-guide.html
Date Wed, 29 Oct 2014 03:07:30 GMT
Author: buildbot
Date: Wed Oct 29 03:07:30 2014
New Revision: 927229

Log:
Staging update by buildbot for crunch

Modified:
    websites/staging/crunch/trunk/content/   (props changed)
    websites/staging/crunch/trunk/content/user-guide.html

Propchange: websites/staging/crunch/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Oct 29 03:07:30 2014
@@ -1 +1 @@
-1625881
+1635029

Modified: websites/staging/crunch/trunk/content/user-guide.html
==============================================================================
--- websites/staging/crunch/trunk/content/user-guide.html (original)
+++ websites/staging/crunch/trunk/content/user-guide.html Wed Oct 29 03:07:30 2014
@@ -599,32 +599,32 @@ import java.util.Map;
 public class MyPipeline {
 
   // Common primitive types
-  PType<Integer> intType = ints();
-  PType<Long> longType = longs();
-  PType<Double> doubleType = doubles();
+  PType&lt;Integer&gt; intType = ints();
+  PType&lt;Long&gt; longType = longs();
+  PType&lt;Double&gt; doubleType = doubles();
   // Bytes are represented by java.nio.ByteBuffer
-  PType<ByteBuffer> bytesType = bytes();
+  PType&lt;ByteBuffer&gt; bytesType = bytes();
 
   // A PTableType: using tableOf will return a PTable instead of a
   // PCollection from a parallelDo call.
-  PTableType<String, Boolean> tableType = tableOf(strings(), booleans());
+  PTableType&lt;String, Boolean&gt; tableType = tableOf(strings(), booleans());
 
   // Pair types: 
-  PType<Pair<String, Boolean>> pairType = pairs(strings(), booleans()); 
-  PType<Pair<String, Pair<Long, Long>> nestedPairType = pairs(strings(), pairs(longs(),
longs()));
+  PType&lt;Pair&lt;String, Boolean&gt;&gt; pairType = pairs(strings(), booleans());

+  PType&lt;Pair&lt;String, Pair&lt;Long, Long&gt;&gt; nestedPairType
= pairs(strings(), pairs(longs(), longs()));
 
   // A triple
-  PType<Tuple3<Long, Float, Float>> tripType = trips(longs(), floats(), floats());
+  PType&lt;Tuple3&lt;Long, Float, Float&gt;&gt; tripType = trips(longs(),
floats(), floats());
   // An arbitrary length tuple-- note that we lose the generic type information
-  PType<TupleN> tupleType = tupleN(ints(), ints(), floats(), strings(), strings(),
ints());
+  PType&lt;TupleN&gt; tupleType = tupleN(ints(), ints(), floats(), strings(), strings(),
ints());
 
   // A Collection type
-  PType<Collection<Long>> longsType = collections(longs());
+  PType&lt;Collection&lt;Long&gt;&gt; longsType = collections(longs());
   // A Map Type-- note that the keys are always strings, we only specify the value.
-  PType<Map<String, Boolean>> mapType = maps(booleans());
+  PType&lt;Map&lt;String, Boolean&gt;&gt; mapType = maps(booleans());
 
   // A Pair of collections
-  PType<Pair<Collection<String>, Collection<Long>>> pairColType =
pairs(
+  PType&lt;Pair&lt;Collection&lt;String&gt;, Collection&lt;Long&gt;&gt;&gt;
pairColType = pairs(
       collections(strings()),
       collections(longs()));
 }
@@ -635,17 +635,17 @@ record format for each type family. For 
 interface, and for the AvroTypeFamily, the records method supports PTypes for implementations
of Avro's <code>IndexedRecord</code> interface, which
 includes both Avro generic and specific records:</p>
 <pre>
-  PType<FooWritable> fwType1 = Writables.records(FooWritable.class);
+  PType&lt;FooWritable&gt; fwType1 = Writables.records(FooWritable.class);
   // The more obvious "writables" method also works.
-  PType<FooWritable> fwType = Writables.writables(FooWritable.class);
+  PType&lt;FooWritable&gt; fwType = Writables.writables(FooWritable.class);
 
   // For a generated Avro class, this works:
-  PType<Person> personType1 = Avros.records(Person.class);
+  PType&lt;Person&gt; personType1 = Avros.records(Person.class);
   // As does this:
-  PType<Person> personType2 = Avros.containers(Person.class); 
+  PType&lt;Person&gt; personType2 = Avros.containers(Person.class); 
   // If you only have a schema, you can create a generic type, like this:
   org.apache.avro.Schema schema = ...;
-  PType<Record> avroGenericType = Avros.generics(schema);
+  PType&lt;Record&gt; avroGenericType = Avros.generics(schema);
 </pre>
 
 <p>The <a href="apidocs/0.10.0/org/apache/crunch/types/avro/Avros.html">Avros</a>
class also has a <code>reflects</code> method for creating PTypes
@@ -673,8 +673,8 @@ the POJO:</p>
     }
   }
 
-  PType<UrlData> urlDataType = Avros.reflects(UrlData.class);
-  PTableType<String, UrlData> pageRankType = Avros.tableOf(Avros.strings(), urlDataType);
+  PType&lt;UrlData&gt; urlDataType = Avros.reflects(UrlData.class);
+  PTableType&lt;String, UrlData&gt; pageRankType = Avros.tableOf(Avros.strings(),
urlDataType);
 </pre>
 
 <p>Avro reflection is a great way to define intermediate types for your Crunch pipelines;
not only is your logic clear
@@ -691,12 +691,12 @@ protocol buffers and Thrift records that
 <p>A common pattern in MapReduce programs is to define a Writable type that wraps a
regular Java POJO. You can use derived PTypes to make it
 easy to work with the POJO directly in your DoFns, while still taking advantage of the custom
serialization of your Writable implementation:</p>
 <pre>
-  PType<Foo> fooType = Writables.derived(
+  PType&lt;Foo&gt; fooType = Writables.derived(
       Foo.class,
-      new MapFn<FooWritable, Foo>() {
+      new MapFn&lt;FooWritable, Foo&gt;() {
         public Foo map(FooWritable fw) { return fw.get(); }
       },
-      new MapFn<Foo, FooWritable>() {
+      new MapFn&lt;Foo, FooWritable&gt;() {
         public FooWritable map(Foo foo) { return new FooWritable(foo); }
       },
       Writables.writable(FooWritable.class));



Mime
View raw message