Class ColumnIdentifier

  • All Implemented Interfaces:
    java.lang.Comparable<ColumnIdentifier>, IMeasurableMemory

    public class ColumnIdentifier
    extends java.lang.Object
    implements IMeasurableMemory, java.lang.Comparable<ColumnIdentifier>
    Represents an identifer for a CQL column definition. TODO : should support light-weight mode without text representation for when not interned
    • Field Detail

      • bytes

        public final java.nio.ByteBuffer bytes
      • prefixComparison

        public final long prefixComparison
        since these objects are compared frequently, we stash an efficiently compared prefix of the bytes, in the expectation that the majority of comparisons can be answered by this value only
    • Constructor Detail

      • ColumnIdentifier

        public ColumnIdentifier​(java.lang.String rawText,
                                boolean keepCase)
      • ColumnIdentifier

        public ColumnIdentifier​(java.nio.ByteBuffer bytes,
                                AbstractType<?> type)
      • ColumnIdentifier

        public ColumnIdentifier​(java.nio.ByteBuffer bytes,
                                java.lang.String text)
    • Method Detail

      • getInterned

        public static ColumnIdentifier getInterned​(java.lang.String rawText,
                                                   boolean keepCase)
      • isInterned

        public boolean isInterned()
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toCQLString

        public java.lang.String toCQLString()
        Returns a string representation of the identifier that is safe to use directly in CQL queries. If necessary, the string will be double-quoted, and any quotes inside the string will be escaped.
      • unsharedHeapSize

        public long unsharedHeapSize()
        Specified by:
        unsharedHeapSize in interface IMeasurableMemory
        Returns:
        the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
      • unsharedHeapSizeExcludingData

        public long unsharedHeapSizeExcludingData()
      • maybeQuote

        public static java.lang.String maybeQuote​(java.lang.String text)