org.apache.hadoop.chukwa.util
Class RecordConstants

java.lang.Object
  extended by org.apache.hadoop.chukwa.util.RecordConstants

public class RecordConstants
extends Object


Field Summary
static String DEFAULT_FIELD_SEPARATOR
           
static String DEFAULT_RECORD_SEPARATOR
           
static String RECORD_SEPARATOR_ESCAPE_SEQ
           
 
Constructor Summary
RecordConstants()
           
 
Method Summary
static String escapeAllButLastRecordSeparator(String recordSeparator, String record)
          Insert the default chukwa escape sequence in record before all occurances of recordSeparator except the final one if the final record separator occurs at the end of the record
static String escapeAllRecordSeparators(String recordSeparator, String record)
          Insert the default chukwa escape sequence in record before all occurances of recordSeparator.
static String recoverRecordSeparators(String recordSeparator, String record)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FIELD_SEPARATOR

public static final String DEFAULT_FIELD_SEPARATOR
See Also:
Constant Field Values

DEFAULT_RECORD_SEPARATOR

public static final String DEFAULT_RECORD_SEPARATOR
See Also:
Constant Field Values

RECORD_SEPARATOR_ESCAPE_SEQ

public static final String RECORD_SEPARATOR_ESCAPE_SEQ
Constructor Detail

RecordConstants

public RecordConstants()
Method Detail

escapeAllButLastRecordSeparator

public static String escapeAllButLastRecordSeparator(String recordSeparator,
                                                     String record)
Insert the default chukwa escape sequence in record before all occurances of recordSeparator except the final one if the final record separator occurs at the end of the record

Parameters:
recordSeparator - The record separator that we are escaping. This is chunk source application specific
record - The string representing the entire record, including the final record delimiter
Returns:
The string with appropriate recordSeparators escaped

escapeAllRecordSeparators

public static String escapeAllRecordSeparators(String recordSeparator,
                                               String record)
Insert the default chukwa escape sequence in record before all occurances of recordSeparator. This is assuming that you are not passing the final record separator in with the record, because it would be escaped too.

Parameters:
recordSeparator - The record separator that we are escaping. This is chunk source application specific
record - The string representing the entire record, including the final record delimiter
Returns:
The string with all recordSeparators escaped

recoverRecordSeparators

public static String recoverRecordSeparators(String recordSeparator,
                                             String record)


Copyright © ${year} The Apache Software Foundation