Class SummarizerConfiguration
- java.lang.Object
-
- org.apache.accumulo.core.client.summary.SummarizerConfiguration
-
public class SummarizerConfiguration extends Object
This class encapsulates the configuration needed to instantiate aSummarizer. It also provides methods and documentation for setting the table properties that configure a Summarizer.- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSummarizerConfiguration.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SummarizerConfiguration.Builderbuilder(Class<? extends Summarizer> clazz)static SummarizerConfiguration.Builderbuilder(String className)Call this method to initiate a chain of fluent method calls to a create an immutableSummarizerConfigurationbooleanequals(Object o)Compares the classname and options to determine equality.static Collection<SummarizerConfiguration>fromTableProperties(Iterable<Map.Entry<String,String>> props)static Collection<SummarizerConfiguration>fromTableProperties(Map<String,String> props)Decodes table properties with the prefixtable.summarizerintoSummarizerConfigurationobjects.StringgetClassName()Map<String,String>getOptions()StringgetPropertyId()The propertyId is used to when creating table properties for a summarizer.inthashCode()Hashes the classname and options to create a hashcode.StringtoString()Map<String,String>toTableProperties()Converts this configuration to Accumulo per table properties.static Map<String,String>toTableProperties(Collection<SummarizerConfiguration> configurations)Encodes each configuration in the same way astoTableProperties().static Map<String,String>toTableProperties(SummarizerConfiguration... configurations)Encodes each configuration in the same way astoTableProperties().
-
-
-
Method Detail
-
getClassName
public String getClassName()
- Returns:
- the name of a class that implements @link
Summarizer.
-
getPropertyId
public String getPropertyId()
The propertyId is used to when creating table properties for a summarizer. Its not used for equality or hashCode for this class.
-
equals
public boolean equals(Object o)
Compares the classname and options to determine equality.
-
hashCode
public int hashCode()
Hashes the classname and options to create a hashcode.
-
toTableProperties
public Map<String,String> toTableProperties()
Converts this configuration to Accumulo per table properties. The returned map has the following key values. The<configId>below is fromgetPropertyId(). The<optionKey>and<optionValue>below are derived from the key values ofgetOptions().table.summarizer.<configId>=<classname> table.summarizer.<configId>.opt.<optionKey1>=<optionValue1> table.summarizer.<configId>.opt.<optionKey2>=<optionValue2> . . . table.summarizer.<configId>.opt.<optionKeyN>=<optionValueN>
-
toTableProperties
public static Map<String,String> toTableProperties(SummarizerConfiguration... configurations)
Encodes each configuration in the same way astoTableProperties().- Throws:
IllegalArgumentException- when there are duplicate values forgetPropertyId()
-
toTableProperties
public static Map<String,String> toTableProperties(Collection<SummarizerConfiguration> configurations)
Encodes each configuration in the same way astoTableProperties().- Throws:
IllegalArgumentException- when there are duplicate values forgetPropertyId()
-
fromTableProperties
public static Collection<SummarizerConfiguration> fromTableProperties(Map<String,String> props)
Decodes table properties with the prefixtable.summarizerintoSummarizerConfigurationobjects. Table properties with prefixes other thantable.summarizerare ignored.
-
fromTableProperties
public static Collection<SummarizerConfiguration> fromTableProperties(Iterable<Map.Entry<String,String>> props)
- See Also:
fromTableProperties(Map)
-
builder
public static SummarizerConfiguration.Builder builder(String className)
Call this method to initiate a chain of fluent method calls to a create an immutableSummarizerConfiguration- Parameters:
className- The fully qualified name of a class that implementsSummarizer.
-
builder
public static SummarizerConfiguration.Builder builder(Class<? extends Summarizer> clazz)
- See Also:
builder(String)
-
-