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.ByteBuffer
bytes
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 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 ColumnIdentifier
clone(ByteBufferCloner cloner)
int
compareTo(ColumnIdentifier that)
boolean
equals(java.lang.Object o)
static ColumnIdentifier
getInterned(java.lang.String rawText, boolean keepCase)
static ColumnIdentifier
getInterned(java.nio.ByteBuffer bytes, AbstractType<?> type)
static ColumnIdentifier
getInterned(AbstractType<?> type, java.nio.ByteBuffer bytes, java.lang.String text)
int
hashCode()
boolean
isInterned()
static java.lang.String
maybeQuote(java.lang.String text)
java.lang.String
toCQLString()
Returns a string representation of the identifier that is safe to use directly in CQL queries.java.lang.String
toString()
long
unsharedHeapSize()
long
unsharedHeapSizeExcludingData()
-
-
-
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:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
unsharedHeapSize
in 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:
compareTo
in interfacejava.lang.Comparable<ColumnIdentifier>
-
maybeQuote
public static java.lang.String maybeQuote(java.lang.String text)
-
-