Package com.hazelcast.config
Class IndexConfig
java.lang.Object
com.hazelcast.config.IndexConfig
- All Implemented Interfaces:
- DataSerializable,- IdentifiedDataSerializable,- com.hazelcast.nio.serialization.impl.Versioned
public class IndexConfig
extends Object
implements IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned
Configuration of an index. Hazelcast support three types of indexes: sorted index, hash index
 and bitmap index.
 Sorted indexes could be used with equality and range predicates and have logarithmic search time.
 Hash indexes could be used with equality predicates and have constant search time assuming the hash
 function of the indexed field disperses the elements properly.
 Bitmap indexes are similar to hash index. They are able to achieve a much higher memory efficiency
 for low cardinality attributes at the cost of reduced query performance.
 
Index could be created on one or more attributes.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionIndexConfig(IndexConfig other) IndexConfig(IndexType type) Creates an index configuration of the given type.IndexConfig(IndexType type, String... attributes) Creates an index configuration of the given type with provided attributes.
- 
Method SummaryModifier and TypeMethodDescriptionaddAttribute(String attribute) Adds an index attribute with the given.voidaddAttributeInternal(String attribute) booleanGets index attributes.Provides access to index options specific to bitmap indexes.Provides access to index options specific to B-Tree indexes.intReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.getName()Gets name of the index.getType()Gets type of the index.inthashCode()voidReads fields from the input streamsetAttributes(List<String> attributes) Sets index attributes.setBitmapIndexOptions(BitmapIndexOptions bitmapIndexOptions) Sets bitmap index options of this index config to the given ones.setBTreeIndexConfig(BTreeIndexConfig bTreeIndexConfig) Sets B-Tree config of this index to the specified configuration.Sets name of the index.Sets type of the index.toString()voidWrites object fields to output stream
- 
Field Details- 
DEFAULT_TYPEDefault index type.
 
- 
- 
Constructor Details- 
IndexConfigpublic IndexConfig()
- 
IndexConfigCreates an index configuration of the given type.- Parameters:
- type- Index type.
 
- 
IndexConfigCreates an index configuration of the given type with provided attributes.- Parameters:
- type- Index type.
- attributes- Attributes to be indexed.
 
- 
IndexConfig
 
- 
- 
Method Details- 
getNameGets name of the index.- Returns:
- Name of the index or nullif index name should be generated automatically.
 
- 
setNameSets name of the index.- Parameters:
- name- Name of the index or- nullif index name should be generated automatically.
- Returns:
- This instance for chaining.
 
- 
getTypeGets type of the index.Defaults to IndexType.SORTED.- Returns:
- Type of the index.
 
- 
setTypeSets type of the index.Defaults to IndexType.SORTED.- Parameters:
- type- Type of the index.
- Returns:
- This instance for chaining.
 
- 
getAttributesGets index attributes.- Returns:
- Index attributes.
 
- 
addAttributeAdds an index attribute with the given.- Parameters:
- attribute- Attribute name.
- Returns:
- This instance for chaining.
 
- 
addAttributeInternal
- 
setAttributesSets index attributes.- Parameters:
- attributes- Index attributes.
- Returns:
- This instance for chaining.
 
- 
getBitmapIndexOptionsProvides access to index options specific to bitmap indexes.- Returns:
- the bitmap index options associated with this index config.
 
- 
setBitmapIndexOptionsSets bitmap index options of this index config to the given ones.- Parameters:
- bitmapIndexOptions- the bitmap index options to set.
- Returns:
- this index config instance.
 
- 
getBTreeIndexConfigProvides access to index options specific to B-Tree indexes.- Returns:
- the b-tree index configuration associated with this config.
 
- 
setBTreeIndexConfigSets B-Tree config of this index to the specified configuration.- Parameters:
- bTreeIndexConfig- new b-tree index configuration to set.
 
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-