public class RowHasher extends Object
<prefix>:<fixed len row hash>:<user row>
The recipe also provides code the help generate split points and configure balancing of the prefix.
The project documentation has more information.
A single instance of RowHasher is thread safe. Creating a single static instance and using it can result in good performance.
Modifier and Type | Class and Description |
---|---|
static class |
RowHasher.Optimizer |
Modifier and Type | Method and Description |
---|---|
org.apache.fluo.api.data.Bytes |
addHash(org.apache.fluo.api.data.Bytes row) |
org.apache.fluo.api.data.Bytes |
addHash(String row) |
static void |
configure(org.apache.fluo.api.config.FluoConfiguration fluoConfig,
String prefix,
int numTablets)
This method can be called to register table optimizations before initializing Fluo.
|
String |
getPrefix() |
org.apache.fluo.api.data.Bytes |
removeHash(org.apache.fluo.api.data.Bytes row) |
public RowHasher(String prefix)
public static void configure(org.apache.fluo.api.config.FluoConfiguration fluoConfig, String prefix, int numTablets)
RowHasher.Optimizer
with
TableOptimizations.registerOptimization(SimpleConfiguration, String, Class)
. See the
project level documentation for an example.fluoConfig
- The config that will be used to initialize Fluoprefix
- The prefix used for your Row Hasher. If you have a single instance, could call
getPrefix()
.numTablets
- Initial number of tablet to create.public String getPrefix()
public org.apache.fluo.api.data.Bytes addHash(String row)
public org.apache.fluo.api.data.Bytes addHash(org.apache.fluo.api.data.Bytes row)
public org.apache.fluo.api.data.Bytes removeHash(org.apache.fluo.api.data.Bytes row)
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.