org.apache.storm.hdfs.bolt.format
Class DelimitedRecordFormat
java.lang.Object
org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat
- All Implemented Interfaces:
- Serializable, RecordFormat
public class DelimitedRecordFormat
- extends Object
- implements RecordFormat
RecordFormat implementation that uses field and record delimiters.
By default uses a comma (",") as the field delimiter and a
newline ("\n") as the record delimiter.
Also by default, this implementation will output all the
field values in the tuple in the order they were declared. To
override this behavior, call withFields()
to
specify which tuple fields to output.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_FIELD_DELIMITER
public static final String DEFAULT_FIELD_DELIMITER
- See Also:
- Constant Field Values
DEFAULT_RECORD_DELIMITER
public static final String DEFAULT_RECORD_DELIMITER
- See Also:
- Constant Field Values
DelimitedRecordFormat
public DelimitedRecordFormat()
withFields
public DelimitedRecordFormat withFields(Fields fields)
- Only output the specified fields.
- Parameters:
fields
-
- Returns:
withFieldDelimiter
public DelimitedRecordFormat withFieldDelimiter(String delimiter)
- Overrides the default field delimiter.
- Parameters:
delimiter
-
- Returns:
withRecordDelimiter
public DelimitedRecordFormat withRecordDelimiter(String delimiter)
- Overrides the default record delimiter.
- Parameters:
delimiter
-
- Returns:
format
public byte[] format(Tuple tuple)
- Specified by:
format
in interface RecordFormat
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.