org.apache.hadoop.hbase.mapreduce
Class ImportTsv.TsvParser

java.lang.Object
  extended by org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser
Enclosing class:
ImportTsv

public static class ImportTsv.TsvParser
extends Object


Nested Class Summary
static class ImportTsv.TsvParser.BadTsvLineException
           
 
Field Summary
static String ATTRIBUTES_COLUMN_SPEC
           
static String CELL_TTL_COLUMN_SPEC
           
static String CELL_VISIBILITY_COLUMN_SPEC
           
static int DEFAULT_ATTRIBUTES_COLUMN_INDEX
           
static int DEFAULT_CELL_TTL_COLUMN_INDEX
           
static int DEFAULT_CELL_VISIBILITY_COLUMN_INDEX
           
static int DEFAULT_TIMESTAMP_COLUMN_INDEX
           
static String ROWKEY_COLUMN_SPEC
           
static String TIMESTAMPKEY_COLUMN_SPEC
           
 
Constructor Summary
ImportTsv.TsvParser(String columnsSpecification, String separatorStr)
           
 
Method Summary
 int getAttributesKeyColumnIndex()
           
 int getCellTTLColumnIndex()
           
 int getCellVisibilityColumnIndex()
           
 byte[] getFamily(int idx)
           
 byte[] getQualifier(int idx)
           
 int getRowKeyColumnIndex()
           
 int getTimestampKeyColumnIndex()
           
 boolean hasAttributes()
           
 boolean hasCellTTL()
           
 boolean hasCellVisibility()
           
 boolean hasTimestamp()
           
 org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine parse(byte[] lineBytes, int length)
           
 Pair<Integer,Integer> parseRowKey(byte[] lineBytes, int length)
          Return starting position and length of row key from the specified line bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMESTAMP_COLUMN_INDEX

public static final int DEFAULT_TIMESTAMP_COLUMN_INDEX
See Also:
Constant Field Values

ROWKEY_COLUMN_SPEC

public static final String ROWKEY_COLUMN_SPEC
See Also:
Constant Field Values

TIMESTAMPKEY_COLUMN_SPEC

public static final String TIMESTAMPKEY_COLUMN_SPEC
See Also:
Constant Field Values

ATTRIBUTES_COLUMN_SPEC

public static final String ATTRIBUTES_COLUMN_SPEC
See Also:
Constant Field Values

CELL_VISIBILITY_COLUMN_SPEC

@InterfaceStability.Unstable
public static final String CELL_VISIBILITY_COLUMN_SPEC
See Also:
Constant Field Values

CELL_TTL_COLUMN_SPEC

@InterfaceStability.Unstable
public static final String CELL_TTL_COLUMN_SPEC
See Also:
Constant Field Values

DEFAULT_ATTRIBUTES_COLUMN_INDEX

public static final int DEFAULT_ATTRIBUTES_COLUMN_INDEX
See Also:
Constant Field Values

DEFAULT_CELL_VISIBILITY_COLUMN_INDEX

@InterfaceStability.Unstable
public static final int DEFAULT_CELL_VISIBILITY_COLUMN_INDEX
See Also:
Constant Field Values

DEFAULT_CELL_TTL_COLUMN_INDEX

@InterfaceStability.Unstable
public static final int DEFAULT_CELL_TTL_COLUMN_INDEX
See Also:
Constant Field Values
Constructor Detail

ImportTsv.TsvParser

public ImportTsv.TsvParser(String columnsSpecification,
                           String separatorStr)
Parameters:
columnsSpecification - the list of columns to parser out, comma separated. The row key should be the special token TsvParser.ROWKEY_COLUMN_SPEC
separatorStr -
Method Detail

hasTimestamp

public boolean hasTimestamp()

getTimestampKeyColumnIndex

public int getTimestampKeyColumnIndex()

hasAttributes

public boolean hasAttributes()

hasCellVisibility

@InterfaceStability.Unstable
public boolean hasCellVisibility()

hasCellTTL

@InterfaceStability.Unstable
public boolean hasCellTTL()

getAttributesKeyColumnIndex

public int getAttributesKeyColumnIndex()

getCellVisibilityColumnIndex

@InterfaceStability.Unstable
public int getCellVisibilityColumnIndex()

getCellTTLColumnIndex

@InterfaceStability.Unstable
public int getCellTTLColumnIndex()

getRowKeyColumnIndex

public int getRowKeyColumnIndex()

getFamily

public byte[] getFamily(int idx)

getQualifier

public byte[] getQualifier(int idx)

parse

public org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine parse(byte[] lineBytes,
                                                                              int length)
                                                                       throws ImportTsv.TsvParser.BadTsvLineException
Throws:
ImportTsv.TsvParser.BadTsvLineException

parseRowKey

public Pair<Integer,Integer> parseRowKey(byte[] lineBytes,
                                         int length)
                                  throws ImportTsv.TsvParser.BadTsvLineException
Return starting position and length of row key from the specified line bytes.

Parameters:
lineBytes -
length -
Returns:
Pair of row key offset and length.
Throws:
ImportTsv.TsvParser.BadTsvLineException


Copyright © 2015 The Apache Software Foundation. All rights reserved.