public class StringBinIndex extends RiakIndex<String>
RiakIndex
implementation used to access a Riak _bin
Secondary Index using String
values.
Data in Riak including secondary indexes is stored as bytes. This implementation
of RiakIndex
provides access to those bytes by converting to
and from String
values. Its type is IndexType.BIN
One of the key features of 2i is the ability to do range queries. As previously noted the values are stored in Riak as bytes. Comparison is done byte-by-byte. UTF-8 lends itself well to this as its byte ordering is the same as its lexical ordering.
If you are using a character asSet whose byte ordering differs from its lexical ordering, range queries will be affected.
RiakIndexes
,
RiakObject
Modifier and Type | Class and Description |
---|---|
static class |
StringBinIndex.Name
Encapsulates the name, character asSet, and
IndexType for a StringBinIndex |
Modifier and Type | Method and Description |
---|---|
protected String |
convert(BinaryValue value)
Convert bytes to a value type.
|
protected BinaryValue |
convert(String value)
Convert a value to a BinaryValue.
|
static StringBinIndex.Name |
named(String name) |
static StringBinIndex.Name |
named(String name,
Charset charset) |
add, add, equals, getFullname, getName, getType, hashCode, hasValue, isEmpty, iterator, rawValues, remove, remove, removeAll, size, toString, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected BinaryValue convert(String value)
RiakIndex
Index values are stored internally as bytes. Concrete classes implement this method to convert values to bytes.
protected String convert(BinaryValue value)
RiakIndex
Index values are stored internally as bytes. Concrete classes implement this method to convert bytes to values.
public static StringBinIndex.Name named(String name)
public static StringBinIndex.Name named(String name, Charset charset)
Copyright © 2016. All rights reserved.