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
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( Map.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
-
-
Field Summary
-
Fields inherited from class org.apache.accumulo.core.client.sample.AbstractHashSampler
REQUIRED_SAMPLER_OPTIONS
-
-
Constructor Summary
Constructors Constructor Description RowColumnSampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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)
.void
validateOptions(Map<String,String> config)
Subclasses with options should override this method to validate subclass options while also callingsuper.validateOptions(config)
to validate base class options.-
Methods inherited from class org.apache.accumulo.core.client.sample.AbstractHashSampler
accept, isValidOption
-
-
-
-
Method Detail
-
validateOptions
public void validateOptions(Map<String,String> config)
Description copied from class:AbstractHashSampler
Subclasses with options should override this method to validate subclass options while also callingsuper.validateOptions(config)
to validate base class options.- Specified by:
validateOptions
in interfaceSampler
- Overrides:
validateOptions
in classAbstractHashSampler
- Parameters:
config
- Sampler options configuration to validate. Validates option and value.
-
init
public void init(SamplerConfiguration config)
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
protected void hash(DataOutput hasher, Key k) throws IOException
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
-
-