Package org.apache.cassandra.schema
Class Indexes
java.lang.Object
org.apache.cassandra.schema.Indexes
- All Implemented Interfaces:
Iterable<IndexMetadata>
For backwards compatibility, in the first instance an IndexMetadata must have
TargetType.COLUMN and its Set of target columns must contain only a single
ColumnIdentifier. Hence, this is what is enforced by the public factory methods
on IndexMetadata.
These constraints, along with the internal datastructures here will be relaxed as
support is added for multiple target columns per-index and for indexes with
TargetType.ROW
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Indexes.Builderbuilder()booleanGet the index with the specified nameGet the index with the specified idbooleanAnswer true if contains an index with the specified name.booleanAnswer true if contains an index with the specified id.inthashCode()booleanisEmpty()iterator()static Indexesnone()static Indexesof(Iterable<IndexMetadata> indexes) static Indexesof(IndexMetadata... indexes) replace(IndexMetadata index) Creates a SecondaryIndexes instance which contains an updated index definitionintsize()stream()toString()voidvalidate(TableMetadata table) with(IndexMetadata index) Create a SecondaryIndexes instance with the provided index addedCreates a SecondaryIndexes instance with the index with the provided name removedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
builder
-
none
-
of
-
of
-
iterator
- Specified by:
iteratorin interfaceIterable<IndexMetadata>
-
stream
-
size
public int size() -
isEmpty
public boolean isEmpty() -
get
Get the index with the specified name- Parameters:
name- a non-qualified index name- Returns:
- an empty
Optionalif the named index is not found; a non-empty optional ofIndexMetadataotherwise
-
has
Answer true if contains an index with the specified name.- Parameters:
name- a non-qualified index name.- Returns:
- true if the named index is found; false otherwise
-
get
Get the index with the specified id- Parameters:
id- a UUID which identifies an index- Returns:
- an empty
Optionalif no index with the specified id is found; a non-empty optional ofIndexMetadataotherwise
-
has
Answer true if contains an index with the specified id.- Parameters:
id- a UUID which identifies an index.- Returns:
- true if an index with the specified id is found; false otherwise
-
with
Create a SecondaryIndexes instance with the provided index added -
without
Creates a SecondaryIndexes instance with the index with the provided name removed -
replace
Creates a SecondaryIndexes instance which contains an updated index definition -
equals
-
validate
-
hashCode
public int hashCode() -
toString
-