Package org.apache.cassandra.cql3
Class ColumnIdentifier
- java.lang.Object
-
- org.apache.cassandra.cql3.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 Summary
Fields Modifier and Type Field Description java.nio.ByteBufferbyteslongprefixComparisonsince 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 Summary
Constructors Constructor Description ColumnIdentifier(java.lang.String rawText, boolean keepCase)ColumnIdentifier(java.nio.ByteBuffer bytes, java.lang.String text)ColumnIdentifier(java.nio.ByteBuffer bytes, AbstractType<?> type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnIdentifierclone(ByteBufferCloner cloner)intcompareTo(ColumnIdentifier that)booleanequals(java.lang.Object o)static ColumnIdentifiergetInterned(java.lang.String rawText, boolean keepCase)static ColumnIdentifiergetInterned(java.nio.ByteBuffer bytes, AbstractType<?> type)static ColumnIdentifiergetInterned(AbstractType<?> type, java.nio.ByteBuffer bytes, java.lang.String text)inthashCode()booleanisInterned()static java.lang.StringmaybeQuote(java.lang.String text)java.lang.StringtoCQLString()Returns a string representation of the identifier that is safe to use directly in CQL queries.java.lang.StringtoString()longunsharedHeapSize()longunsharedHeapSizeExcludingData()
-
-
-
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.nio.ByteBuffer bytes, AbstractType<?> type)
-
getInterned
public static ColumnIdentifier getInterned(java.lang.String rawText, boolean keepCase)
-
getInterned
public static ColumnIdentifier getInterned(AbstractType<?> type, java.nio.ByteBuffer bytes, java.lang.String text)
-
isInterned
public boolean isInterned()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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:
unsharedHeapSizein interfaceIMeasurableMemory- 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()
-
clone
public ColumnIdentifier clone(ByteBufferCloner cloner)
-
compareTo
public int compareTo(ColumnIdentifier that)
- Specified by:
compareToin interfacejava.lang.Comparable<ColumnIdentifier>
-
maybeQuote
public static java.lang.String maybeQuote(java.lang.String text)
-
-