Package org.apache.cassandra.db
Class MultiCBuilder
java.lang.Object
org.apache.cassandra.db.MultiCBuilder
Builder that allow to build multiple Clustering/ClusteringBound at the same time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleantrueif the clusterings have been build,falseotherwise.protected final ClusteringComparatorThe table comparator.protected booleantrueif the clusterings contains somenullelements.protected booleantrueif the composites contains someunsetelements.protected booleantrueif some empty collection have been added.protected intThe number of clustering elements that have been added. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract MultiCBuilderaddAllElementsToAll(List<List<ByteBuffer>> values) Adds individually each of the specified list of elements to the end of all of the existing composites.abstract MultiCBuilderaddEachElementToAll(List<ByteBuffer> values) Adds individually each of the specified elements to the end of all of the existing clusterings.abstract MultiCBuilderaddElementToAll(ByteBuffer value) Adds the specified element to all the clusterings.abstract NavigableSet<Clustering<?>>build()Builds theclusterings.abstract NavigableSet<ClusteringBound<?>>buildBound(boolean isStart, boolean isInclusive) Builds theClusteringBoundsabstract NavigableSet<ClusteringBound<?>>buildBoundForSlice(boolean isStart, boolean isInclusive, boolean isOtherBoundInclusive, List<ColumnMetadata> columnDefs) Builds theClusteringBounds for slice restrictions.abstract intReturns the current number of results whenbuild()is calledprotected voidbooleanChecks if the clusterings contains null elements.booleanChecks if the clusterings contains unset elements.static MultiCBuildercreate(ClusteringComparator comparator, boolean forMultipleValues) Creates a new emptyMultiCBuilder.booleanChecks if some empty list of values have been addedbooleanChecks if some elements can still be added to the clusterings.intReturns the number of elements that can be added to the clusterings.
-
Field Details
-
comparator
The table comparator. -
size
protected int sizeThe number of clustering elements that have been added. -
built
protected boolean builttrueif the clusterings have been build,falseotherwise. -
containsNull
protected boolean containsNulltrueif the clusterings contains somenullelements. -
containsUnset
protected boolean containsUnsettrueif the composites contains someunsetelements. -
hasMissingElements
protected boolean hasMissingElementstrueif some empty collection have been added.
-
-
Constructor Details
-
MultiCBuilder
-
-
Method Details
-
create
Creates a new emptyMultiCBuilder. -
addElementToAll
Adds the specified element to all the clusterings.If this builder contains 2 clustering: A-B and A-C a call to this method to add D will result in the clusterings: A-B-D and A-C-D.
- Parameters:
value- the value of the next element- Returns:
- this
MulitCBuilder
-
addEachElementToAll
Adds individually each of the specified elements to the end of all of the existing clusterings.If this builder contains 2 clusterings: A-B and A-C a call to this method to add D and E will result in the 4 clusterings: A-B-D, A-B-E, A-C-D and A-C-E.
- Parameters:
values- the elements to add- Returns:
- this
CompositeBuilder
-
addAllElementsToAll
Adds individually each of the specified list of elements to the end of all of the existing composites.If this builder contains 2 composites: A-B and A-C a call to this method to add [[D, E], [F, G]] will result in the 4 composites: A-B-D-E, A-B-F-G, A-C-D-E and A-C-F-G.
- Parameters:
values- the elements to add- Returns:
- this
CompositeBuilder
-
checkUpdateable
protected void checkUpdateable() -
remainingCount
public int remainingCount()Returns the number of elements that can be added to the clusterings.- Returns:
- the number of elements that can be added to the clusterings.
-
buildSize
public abstract int buildSize()Returns the current number of results whenbuild()is called- Returns:
- the current number of build results
-
containsNull
public boolean containsNull()Checks if the clusterings contains null elements.- Returns:
trueif the clusterings containsnullelements,falseotherwise.
-
containsUnset
public boolean containsUnset()Checks if the clusterings contains unset elements.- Returns:
trueif the clusterings containsunsetelements,falseotherwise.
-
hasMissingElements
public boolean hasMissingElements()Checks if some empty list of values have been added- Returns:
trueif the clusterings have some missing elements,falseotherwise.
-
build
Builds theclusterings.- Returns:
- the clusterings
-
buildBoundForSlice
public abstract NavigableSet<ClusteringBound<?>> buildBoundForSlice(boolean isStart, boolean isInclusive, boolean isOtherBoundInclusive, List<ColumnMetadata> columnDefs) Builds theClusteringBounds for slice restrictions.- Parameters:
isStart- specify if the bound is a start oneisInclusive- specify if the bound is inclusive or notisOtherBoundInclusive- specify if the other bound is inclusive or notcolumnDefs- the columns of the slice restriction- Returns:
- the
ClusteringBounds
-
buildBound
Builds theClusteringBounds- Parameters:
isStart- specify if the bound is a start oneisInclusive- specify if the bound is inclusive or not- Returns:
- the
ClusteringBounds
-
hasRemaining
public boolean hasRemaining()Checks if some elements can still be added to the clusterings.- Returns:
trueif it is possible to add more elements to the clusterings,falseotherwise.
-