Package org.apache.cassandra.db.marshal
Class PartitionerDefinedOrder
- java.lang.Object
-
- org.apache.cassandra.db.marshal.AbstractType<java.nio.ByteBuffer>
-
- org.apache.cassandra.db.marshal.PartitionerDefinedOrder
-
- All Implemented Interfaces:
java.util.Comparator<java.nio.ByteBuffer>,AssignmentTestable
public class PartitionerDefinedOrder extends AbstractType<java.nio.ByteBuffer>
for sorting columns representing row keys in the row ordering as determined by a partitioner. Not intended for user-defined CFs, and will in fact error out if used with such.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.marshal.AbstractType
AbstractType.ComparisonType
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.db.marshal.AbstractType
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator
-
-
Constructor Summary
Constructors Constructor Description PartitionerDefinedOrder(IPartitioner partitioner)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <VL,VR>
intcompareCustom(VL left, ValueAccessor<VL> accessorL, VR right, ValueAccessor<VR> accessorR)Implement IFF ComparisonType is CUSTOM Compares the byte representation of two instances of this class, for types where this cannot be done by simple in-order comparison of the unsigned bytes Standard Java compare semantics<V> java.nio.ByteBuffercompose(V value, ValueAccessor<V> accessor)java.nio.ByteBufferdecompose(java.nio.ByteBuffer value)TermfromJSONObject(java.lang.Object parsed)Given a parsed JSON string, return a byte representation of the object.java.nio.ByteBufferfromString(java.lang.String source)get a byte representation of the given string.static AbstractType<?>getInstance(TypeParser parser)TypeSerializer<java.nio.ByteBuffer>getSerializer()<V> java.lang.StringgetString(V value, ValueAccessor<V> accessor)get a string representation of the bytes used for various identifier (NOT just for log messages)java.lang.StringtoJSONString(java.nio.ByteBuffer buffer, ProtocolVersion protocolVersion)Converts the specified value into its JSON representation.java.lang.StringtoString()This must be overriden by subclasses if necessary so that for any AbstractType, this == TypeParser.parse(toString()).voidvalidate(java.nio.ByteBuffer bytes)-
Methods inherited from class org.apache.cassandra.db.marshal.AbstractType
asCQL3Type, asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, decomposeUntyped, expandUserTypes, freeze, freezeNestedMulticellTypes, getComponents, getString, getString, isCollection, isCompatibleWith, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isReversed, isSerializationCompatibleWith, isTuple, isUDT, isValueCompatibleWith, isValueCompatibleWithInternal, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toCQLString, toJSONString, toString, udfType, unwrap, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, withUpdatedUserType, writeValue, writeValue, writtenLength, writtenLength
-
-
-
-
Constructor Detail
-
PartitionerDefinedOrder
public PartitionerDefinedOrder(IPartitioner partitioner)
-
-
Method Detail
-
getInstance
public static AbstractType<?> getInstance(TypeParser parser)
-
compose
public <V> java.nio.ByteBuffer compose(V value, ValueAccessor<V> accessor)- Overrides:
composein classAbstractType<java.nio.ByteBuffer>
-
decompose
public java.nio.ByteBuffer decompose(java.nio.ByteBuffer value)
- Overrides:
decomposein classAbstractType<java.nio.ByteBuffer>
-
getString
public <V> java.lang.String getString(V value, ValueAccessor<V> accessor)Description copied from class:AbstractTypeget a string representation of the bytes used for various identifier (NOT just for log messages)- Overrides:
getStringin classAbstractType<java.nio.ByteBuffer>
-
fromString
public java.nio.ByteBuffer fromString(java.lang.String source)
Description copied from class:AbstractTypeget a byte representation of the given string.- Specified by:
fromStringin classAbstractType<java.nio.ByteBuffer>
-
fromJSONObject
public Term fromJSONObject(java.lang.Object parsed)
Description copied from class:AbstractTypeGiven a parsed JSON string, return a byte representation of the object.- Specified by:
fromJSONObjectin classAbstractType<java.nio.ByteBuffer>- Parameters:
parsed- the result of parsing a json string
-
toJSONString
public java.lang.String toJSONString(java.nio.ByteBuffer buffer, ProtocolVersion protocolVersion)Description copied from class:AbstractTypeConverts the specified value into its JSON representation.The buffer position will stay the same.
- Overrides:
toJSONStringin classAbstractType<java.nio.ByteBuffer>- Parameters:
buffer- the value to convertprotocolVersion- the protocol version to use for the conversion- Returns:
- a JSON string representing the specified value
-
compareCustom
public <VL,VR> int compareCustom(VL left, ValueAccessor<VL> accessorL, VR right, ValueAccessor<VR> accessorR)Description copied from class:AbstractTypeImplement IFF ComparisonType is CUSTOM Compares the byte representation of two instances of this class, for types where this cannot be done by simple in-order comparison of the unsigned bytes Standard Java compare semantics- Overrides:
compareCustomin classAbstractType<java.nio.ByteBuffer>
-
validate
public void validate(java.nio.ByteBuffer bytes) throws MarshalException- Overrides:
validatein classAbstractType<java.nio.ByteBuffer>- Throws:
MarshalException
-
getSerializer
public TypeSerializer<java.nio.ByteBuffer> getSerializer()
- Specified by:
getSerializerin classAbstractType<java.nio.ByteBuffer>
-
toString
public java.lang.String toString()
Description copied from class:AbstractTypeThis 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:
toStringin classAbstractType<java.nio.ByteBuffer>
-
-