This project has retired. For details please refer to its
Attic page.
Protos (Apache Crunch 0.8.0 API)
org.apache.crunch.types
Class Protos
java.lang.Object
org.apache.crunch.types.Protos
public class Protos
- extends Object
Utility functions for working with protocol buffers in Crunch.
Method Summary |
static
<M extends com.google.protobuf.Message,K>
MapFn<M,K> |
|
extractKey(String fieldName)
|
static
<M extends com.google.protobuf.Message>
M |
|
getDefaultInstance(Class<M> clazz)
Utility function for creating a default PB Messgae from a Class object that
works with both protoc 2.3.0 and 2.4.x. |
static
<M extends com.google.protobuf.Message>
DoFn<String,M> |
|
lineParser(String sep,
Class<M> msgClass)
|
Protos
public Protos()
getDefaultInstance
public static <M extends com.google.protobuf.Message> M getDefaultInstance(Class<M> clazz)
- Utility function for creating a default PB Messgae from a Class object that
works with both protoc 2.3.0 and 2.4.x.
- Parameters:
clazz
- The class of the protocol buffer to create
- Returns:
- An instance of a protocol buffer
extractKey
public static <M extends com.google.protobuf.Message,K> MapFn<M,K> extractKey(String fieldName)
lineParser
public static <M extends com.google.protobuf.Message> DoFn<String,M> lineParser(String sep,
Class<M> msgClass)
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.