Class TokenRestriction

    • Field Detail

      • columnDefs

        protected final java.util.List<ColumnMetadata> columnDefs
        The definition of the columns to which apply the token restriction.
    • Constructor Detail

      • TokenRestriction

        public TokenRestriction​(TableMetadata metadata,
                                java.util.List<ColumnMetadata> columnDefs)
        Creates a new TokenRestriction that apply to the specified columns.
        Parameters:
        columnDefs - the definition of the columns to which apply the token restriction
    • Method Detail

      • hasIN

        public boolean hasIN()
        Description copied from interface: Restrictions
        Checks if any of the underlying restriction is an IN.
        Specified by:
        hasIN in interface Restrictions
        Returns:
        true if any of the underlying restriction is an IN, false otherwise
      • hasOnlyEqualityRestrictions

        public boolean hasOnlyEqualityRestrictions()
        Description copied from interface: Restrictions
        Checks if all of the underlying restrictions are EQ or IN restrictions.
        Specified by:
        hasOnlyEqualityRestrictions in interface Restrictions
        Returns:
        true if all of the underlying restrictions are EQ or IN restrictions, false otherwise
      • getRestrictions

        public java.util.Set<Restriction> getRestrictions​(ColumnMetadata columnDef)
        Description copied from interface: Restrictions
        Returns the restrictions applied to the specified column.
        Specified by:
        getRestrictions in interface Restrictions
        Parameters:
        columnDef - the column definition
        Returns:
        the restrictions applied to the specified column
      • needFiltering

        public boolean needFiltering​(TableMetadata table)
      • hasSlice

        public boolean hasSlice()
        Description copied from interface: Restrictions
        Checks if any of the underlying restrictions is a slice.
        Specified by:
        hasSlice in interface Restrictions
        Returns:
        true if any of the underlying restrictions is a slice, false otherwise
      • hasUnrestrictedPartitionKeyComponents

        public boolean hasUnrestrictedPartitionKeyComponents​(TableMetadata table)
      • getColumnDefs

        public java.util.List<ColumnMetadata> getColumnDefs()
        Description copied from interface: Restriction
        Returns the column definitions in position order.
        Specified by:
        getColumnDefs in interface Restriction
        Returns:
        the column definitions in position order.
      • getFirstColumn

        public ColumnMetadata getFirstColumn()
        Description copied from interface: Restriction
        Returns the definition of the first column.
        Specified by:
        getFirstColumn in interface Restriction
        Returns:
        the definition of the first column.
      • getLastColumn

        public ColumnMetadata getLastColumn()
        Description copied from interface: Restriction
        Returns the definition of the last column.
        Specified by:
        getLastColumn in interface Restriction
        Returns:
        the definition of the last column.
      • hasSupportingIndex

        public boolean hasSupportingIndex​(IndexRegistry indexRegistry)
        Description copied from interface: Restriction
        Check if the restriction is on indexed columns.
        Specified by:
        hasSupportingIndex in interface Restriction
        Parameters:
        indexRegistry - the index registry
        Returns:
        true if the restriction is on indexed columns, false
      • addToRowFilter

        public void addToRowFilter​(RowFilter filter,
                                   IndexRegistry indexRegistry,
                                   QueryOptions options)
        Description copied from interface: Restriction
        Adds to the specified row filter the expressions corresponding to this Restriction.
        Specified by:
        addToRowFilter in interface Restriction
        Parameters:
        filter - the row filter to add expressions to
        indexRegistry - the index registry
        options - the query options
      • needsFiltering

        public boolean needsFiltering​(Index.Group indexGroup)
        Description copied from interface: Restriction
        Returns whether this restriction would need filtering if the specified index group were used.
        Specified by:
        needsFiltering in interface Restriction
        Parameters:
        indexGroup - an index group
        Returns:
        true if this would need filtering if indexGroup were used, false otherwise
      • isEmpty

        public final boolean isEmpty()
        Description copied from interface: Restrictions
        Checks if this Restrictions is empty or not.
        Specified by:
        isEmpty in interface Restrictions
        Returns:
        true if this Restrictions is empty, false otherwise.
      • size

        public final int size()
        Description copied from interface: Restrictions
        Returns the number of columns that have a restriction.
        Specified by:
        size in interface Restrictions
        Returns:
        the number of columns that have a restriction.
      • getColumnNamesAsString

        protected final java.lang.String getColumnNamesAsString()
        Returns the column names as a comma separated String.
        Returns:
        the column names as a comma separated String.
      • doMergeWith

        protected abstract org.apache.cassandra.cql3.restrictions.PartitionKeyRestrictions doMergeWith​(TokenRestriction otherRestriction)
                                                                                                throws InvalidRequestException
        Merges this restriction with the specified TokenRestriction.
        Parameters:
        otherRestriction - the TokenRestriction to merge with.
        Throws:
        InvalidRequestException
      • values

        public abstract java.util.List<java.nio.ByteBuffer> values​(QueryOptions options,
                                                                   ClientState state)
      • bounds

        public abstract java.util.List<java.nio.ByteBuffer> bounds​(Bound b,
                                                                   QueryOptions options)
      • hasBound

        public abstract boolean hasBound​(Bound b)
        Checks if the specified bound is set or not.
        Parameters:
        b - the bound type
        Returns:
        true if the specified bound is set, false otherwise
      • isInclusive

        public abstract boolean isInclusive​(Bound b)
        Checks if the specified bound is inclusive or not.
        Parameters:
        b - the bound type
        Returns:
        true if the specified bound is inclusive, false otherwise