Example usage for org.apache.hadoop.util.bloom Key Key

List of usage examples for org.apache.hadoop.util.bloom Key Key

Introduction

In this page you can find the example usage for org.apache.hadoop.util.bloom Key Key.

Prototype

public Key(byte[] value, double weight) 

Source Link

Document

Constructor.

Usage

From source file:org.apache.accumulo.core.file.keyfunctor.ColumnFamilyFunctor.java

License:Apache License

@Override
public Key transform(org.apache.accumulo.core.data.Key acuKey) {

    byte keyData[];

    ByteSequence row = acuKey.getRowData();
    ByteSequence cf = acuKey.getColumnFamilyData();
    keyData = new byte[row.length() + cf.length()];
    System.arraycopy(row.getBackingArray(), row.offset(), keyData, 0, row.length());
    System.arraycopy(cf.getBackingArray(), cf.offset(), keyData, row.length(), cf.length());

    return new Key(keyData, 1.0);
}

From source file:org.apache.accumulo.core.file.keyfunctor.RowFunctor.java

License:Apache License

@Override
public Key transform(org.apache.accumulo.core.data.Key acuKey) {
    byte keyData[];

    ByteSequence row = acuKey.getRowData();
    keyData = new byte[row.length()];
    System.arraycopy(row.getBackingArray(), 0, keyData, 0, row.length());

    return new Key(keyData, 1.0);
}