Example usage for org.apache.hadoop.io Text getBytes

List of usage examples for org.apache.hadoop.io Text getBytes

Introduction

In this page you can find the example usage for org.apache.hadoop.io Text getBytes.

Prototype

@Override
public byte[] getBytes() 

Source Link

Document

Returns the raw bytes; however, only data up to #getLength() is valid.

Usage

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, empty column family, empty column qualifier, empty column visibility, timestamp {@link Long#MAX_VALUE}, and delete
 * marker false./*from   w  w w.  j  ava2 s .com*/
 *
 * @param row
 *          row ID
 */
public Key(Text row) {
    init(row.getBytes(), 0, row.getLength(), EMPTY_BYTES, 0, 0, EMPTY_BYTES, 0, 0, EMPTY_BYTES, 0, 0,
            Long.MAX_VALUE, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, empty column qualifier, empty column visibility, timestamp {@link Long#MAX_VALUE}, and
 * delete marker false.//from   w  w w . j  a v a  2s. co  m
 */
public Key(Text row, Text cf) {
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), EMPTY_BYTES, 0, 0, EMPTY_BYTES,
            0, 0, Long.MAX_VALUE, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, the specified column qualifier, empty column visibility, timestamp
 * {@link Long#MAX_VALUE}, and delete marker false.
 *//*  w w  w  . j  av a2  s. com*/
public Key(Text row, Text cf, Text cq) {
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), cq.getBytes(), 0, cq.getLength(),
            EMPTY_BYTES, 0, 0, Long.MAX_VALUE, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, the specified column qualifier, the specified column visibility, timestamp
 * {@link Long#MAX_VALUE}, and delete marker false.
 *///from   ww  w.  ja  v  a2 s  .c  o m
public Key(Text row, Text cf, Text cq, Text cv) {
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), cq.getBytes(), 0, cq.getLength(),
            cv.getBytes(), 0, cv.getLength(), Long.MAX_VALUE, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, the specified column qualifier, empty column visibility, the specified timestamp, and
 * delete marker false.//from  w ww .  j  av  a2 s.c  o m
 */
public Key(Text row, Text cf, Text cq, long ts) {
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), cq.getBytes(), 0, cq.getLength(),
            EMPTY_BYTES, 0, 0, ts, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, the specified column qualifier, the specified column visibility, the specified
 * timestamp, and delete marker false./* w  ww.  j a  va2  s .  com*/
 */
public Key(Text row, Text cf, Text cq, Text cv, long ts) {
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), cq.getBytes(), 0, cq.getLength(),
            cv.getBytes(), 0, cv.getLength(), ts, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Creates a key with the specified row, the specified column family, the specified column qualifier, the specified column visibility, the specified
 * timestamp, and delete marker false.// w  w w .j a  v  a 2 s  . co m
 */
public Key(Text row, Text cf, Text cq, ColumnVisibility cv, long ts) {
    byte[] expr = cv.getExpression();
    init(row.getBytes(), 0, row.getLength(), cf.getBytes(), 0, cf.getLength(), cq.getBytes(), 0, cq.getLength(),
            expr, 0, expr.length, ts, false, true);
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Compares this key's row ID with another.
 *
 * @param r/*from   w  ww  .  j  a v  a  2 s  .  c o m*/
 *          row ID to compare
 * @return same as {@link #getRow()}.compareTo(r)
 */
public int compareRow(Text r) {
    return WritableComparator.compareBytes(row, 0, row.length, r.getBytes(), 0, r.getLength());
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Compares this key's column family with another.
 *
 * @param cf//from www. java2  s  .  c om
 *          column family to compare
 * @return same as {@link #getColumnFamily()}.compareTo(cf)
 */

public int compareColumnFamily(Text cf) {
    return WritableComparator.compareBytes(colFamily, 0, colFamily.length, cf.getBytes(), 0, cf.getLength());
}

From source file:org.apache.accumulo.core.data.Key.java

License:Apache License

/**
 * Compares this key's column qualifier with another.
 *
 * @param cq//from  www.  java2  s  . c  o m
 *          column qualifier to compare
 * @return same as {@link #getColumnQualifier()}.compareTo(cq)
 */
public int compareColumnQualifier(Text cq) {
    return WritableComparator.compareBytes(colQualifier, 0, colQualifier.length, cq.getBytes(), 0,
            cq.getLength());
}