org.apache.cassandra.db.marshal
Class DynamicCompositeType
java.lang.Object
org.apache.cassandra.db.marshal.AbstractType<java.nio.ByteBuffer>
org.apache.cassandra.db.marshal.AbstractCompositeType
org.apache.cassandra.db.marshal.DynamicCompositeType
- All Implemented Interfaces:
- java.util.Comparator<java.nio.ByteBuffer>
public class DynamicCompositeType
- extends AbstractCompositeType
Method Summary |
protected AbstractType<?> |
getAndAppendNextComparator(int i,
java.nio.ByteBuffer bb,
java.lang.StringBuilder sb)
|
static DynamicCompositeType |
getInstance(java.util.Map<java.lang.Byte,AbstractType<?>> aliases)
|
static DynamicCompositeType |
getInstance(TypeParser parser)
|
protected AbstractType<?> |
getNextComparator(int i,
java.nio.ByteBuffer bb)
|
protected AbstractType<?> |
getNextComparator(int i,
java.nio.ByteBuffer bb1,
java.nio.ByteBuffer bb2)
|
boolean |
isCompatibleWith(AbstractType<?> previous)
Returns true if this comparator is compatible with the provided
previous comparator, that is if previous can safely be replaced by this. |
protected AbstractCompositeType.ParsedComparator |
parseNextComparator(int i,
java.lang.String part)
|
java.lang.String |
toString()
This must be overriden by subclasses if necessary so that for any
AbstractType, this == TypeParser.parse(toString()). |
protected AbstractType<?> |
validateNextComparator(int i,
java.nio.ByteBuffer bb)
|
Methods inherited from class org.apache.cassandra.db.marshal.AbstractCompositeType |
compare, compose, decompose, deconstruct, fromString, getBytes, getShortLength, getString, getWithShortLength, putShortLength, split, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
getInstance
public static DynamicCompositeType getInstance(TypeParser parser)
throws ConfigurationException
- Throws:
ConfigurationException
getInstance
public static DynamicCompositeType getInstance(java.util.Map<java.lang.Byte,AbstractType<?>> aliases)
getNextComparator
protected AbstractType<?> getNextComparator(int i,
java.nio.ByteBuffer bb)
- Specified by:
getNextComparator
in class AbstractCompositeType
getNextComparator
protected AbstractType<?> getNextComparator(int i,
java.nio.ByteBuffer bb1,
java.nio.ByteBuffer bb2)
- Specified by:
getNextComparator
in class AbstractCompositeType
getAndAppendNextComparator
protected AbstractType<?> getAndAppendNextComparator(int i,
java.nio.ByteBuffer bb,
java.lang.StringBuilder sb)
- Specified by:
getAndAppendNextComparator
in class AbstractCompositeType
parseNextComparator
protected AbstractCompositeType.ParsedComparator parseNextComparator(int i,
java.lang.String part)
- Specified by:
parseNextComparator
in class AbstractCompositeType
validateNextComparator
protected AbstractType<?> validateNextComparator(int i,
java.nio.ByteBuffer bb)
throws MarshalException
- Specified by:
validateNextComparator
in class AbstractCompositeType
- Throws:
MarshalException
isCompatibleWith
public boolean isCompatibleWith(AbstractType<?> previous)
- Description copied from class:
AbstractType
- Returns true if this comparator is compatible with the provided
previous comparator, that is if previous can safely be replaced by this.
A comparator cn should be compatible with a previous one cp if forall columns c1 and c2,
if cn.validate(c1) and cn.validate(c2) and cn.compare(c1, c2) == v,
then cp.validate(c1) and cp.validate(c2) and cp.compare(c1, c2) == v.
Note that a type should be compatible with at least itself and when in
doubt, keep the default behavior of not being compatible with any other comparator!
- Overrides:
isCompatibleWith
in class AbstractType<java.nio.ByteBuffer>
toString
public java.lang.String toString()
- Description copied from class:
AbstractType
- This must be overriden by subclasses if necessary so that for any
AbstractType, this == TypeParser.parse(toString()).
Note that for backwards compatibility this includes the full classname.
For CQL purposes the short name is fine.
- Overrides:
toString
in class AbstractType<java.nio.ByteBuffer>
Copyright © 2013 The Apache Software Foundation