org.apache.accumulo.examples.simple.filedata
Class KeyUtil

java.lang.Object
  extended by org.apache.accumulo.examples.simple.filedata.KeyUtil

public class KeyUtil
extends Object

A utility for creating and parsing null-byte separated strings into/from Text objects.


Field Summary
static byte[] nullbyte
           
 
Constructor Summary
KeyUtil()
           
 
Method Summary
static org.apache.hadoop.io.Text buildNullSepText(String... s)
          Join some number of strings using a null byte separator into a text object.
static String[] splitNullSepText(org.apache.hadoop.io.Text t)
          Split a text object using a null byte separator into an array of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullbyte

public static final byte[] nullbyte
Constructor Detail

KeyUtil

public KeyUtil()
Method Detail

buildNullSepText

public static org.apache.hadoop.io.Text buildNullSepText(String... s)
Join some number of strings using a null byte separator into a text object.

Parameters:
s - strings
Returns:
a text object containing the strings separated by null bytes

splitNullSepText

public static String[] splitNullSepText(org.apache.hadoop.io.Text t)
Split a text object using a null byte separator into an array of strings.

Parameters:
t - null-byte separated text object
Returns:
an array of strings


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.