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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhash(DataOutput hasher, Key k) Subclass must override this method and hash some portion of the key.voidinit(SamplerConfiguration config) Subclasses with options should override this method and callsuper.init(config).protected booleanisValidOption(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:AbstractHashSamplerSubclasses with options should override this method and return true if the option is valid for the subclass or ifsuper.isValidOption(opt)returns true.- Overrides:
isValidOptionin classAbstractHashSampler
-
init
Description copied from class:AbstractHashSamplerSubclasses with options should override this method and callsuper.init(config).- Specified by:
initin interfaceSampler- Overrides:
initin classAbstractHashSampler- Parameters:
config- Configuration options for a sampler.
-
hash
Description copied from class:AbstractHashSamplerSubclass must override this method and hash some portion of the key.- Specified by:
hashin classAbstractHashSampler- Parameters:
hasher- Data written to this will be used to compute the hash for the key.- Throws:
IOException
-