Class RowColumnSampler
- java.lang.Object
-
- org.apache.accumulo.core.client.sample.AbstractHashSampler
-
- org.apache.accumulo.core.client.sample.RowColumnSampler
-
- All Implemented Interfaces:
Sampler
public class RowColumnSampler extends AbstractHashSampler
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 ininit(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
AbstractHashSamplerTo 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 Constructor Description RowColumnSampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
-
-
-
-
Method Detail
-
isValidOption
protected boolean isValidOption(String option)
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
public void init(SamplerConfiguration config)
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
protected void hash(DataOutput hasher, Key k) throws IOException
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
-
-