Class RowColumnSampler
java.lang.Object
org.apache.accumulo.core.client.sample.AbstractHashSampler
org.apache.accumulo.core.client.sample.RowColumnSampler
- All Implemented Interfaces:
Sampler
This sampler can hash any subset of a Key's fields. The fields that hashed for the sample are
determined by the configuration options passed in
init(SamplerConfiguration)
. The
following key values are valid options.
- row=true|false
- family=true|false
- qualifier=true|false
- visibility=true|false
If not specified in the options, fields default to false.
To determine what options are valid for hashing see AbstractHashSampler
To configure Accumulo to generate sample data on one thousandth of the column qualifiers, the following SamplerConfiguration could be created and used to configure a table.
new SamplerConfiguration(RowColumnSampler.class.getName()).setOptions(
ImmutableMap.of("hasher","murmur3_32","modulus","1009","qualifier","true"));
With this configuration, if a column qualifier is selected then all key values contains that column qualifier will end up in the sample data.
- Since:
- 1.8.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
hash
(DataOutput hasher, Key k) Subclass must override this method and hash some portion of the key.void
init
(SamplerConfiguration config) Subclasses with options should override this method and callsuper.init(config)
.protected boolean
isValidOption
(String option) Subclasses with options should override this method and return true if the option is valid for the subclass or ifsuper.isValidOption(opt)
returns true.Methods inherited from class org.apache.accumulo.core.client.sample.AbstractHashSampler
accept
-
Constructor Details
-
RowColumnSampler
public RowColumnSampler()
-
-
Method Details
-
isValidOption
Description copied from class:AbstractHashSampler
Subclasses with options should override this method and return true if the option is valid for the subclass or ifsuper.isValidOption(opt)
returns true.- Overrides:
isValidOption
in classAbstractHashSampler
-
init
Description copied from class:AbstractHashSampler
Subclasses with options should override this method and callsuper.init(config)
.- Specified by:
init
in interfaceSampler
- Overrides:
init
in classAbstractHashSampler
- Parameters:
config
- Configuration options for a sampler.
-
hash
Description copied from class:AbstractHashSampler
Subclass must override this method and hash some portion of the key.- Specified by:
hash
in classAbstractHashSampler
- Parameters:
hasher
- Data written to this will be used to compute the hash for the key.- Throws:
IOException
-