public class BigIntIndexQuery extends SecondaryIndexQuery<BigInteger,BigIntIndexQuery.Response,BigIntIndexQuery>
A BigIntIndexQuery is used when you are using integers for your 2i keys. The parameters are provided as BigInteger values. Use this query if your 2i key values exceed that which can be stored in a (64 bit) long,
Namespace ns = new Namespace("my_type", "my_bucket");
BigInteger key = new BigInteger(someReallyLongNumber);
BigIntIndexQuery q = new BigIntIndexQuery.Builder(ns, "my_index", key).build();
BigIntIndexQuery.Response resp = client.execute(q);
You can also stream the results back before the operation is fully complete.
This reduces the time between executing the operation and seeing a result,
and reduces overall memory usage if the iterator is consumed quickly enough.
The result iterable can only be iterated once though.
If the thread is interrupted while the iterator is polling for more results,
a RuntimeException
will be thrown.
Namespace ns = new Namespace("my_type", "my_bucket");
BigInteger key = new BigInteger(someReallyLongNumber);
BigIntIndexQuery q = new BigIntIndexQuery.Builder(ns, "my_index", key).build();
RiakFuture<BigIntIndexQuery.StreamingResponse, BigIntIndexQuery> streamingFuture =
client.executeAsyncStreaming(q, 200);
BigIntIndexQuery.StreamingResponse streamingResponse = streamingFuture.get();
for (BigIntIndexQuery.Response.Entry e : streamingResponse)
{
System.out.println(e.getRiakObjectLocation().getKey().toString());
}
// Wait for the command to fully finish.
streamingFuture.await();
// The StreamingResponse will also contain the continuation, if the operation returned one.
streamingResponse.getContinuation();
Modifier and Type | Class and Description |
---|---|
static class |
BigIntIndexQuery.Builder
Builder used to construct a BigIntIndexQuery.
|
protected static class |
BigIntIndexQuery.Init<S,T extends BigIntIndexQuery.Init<S,T>> |
static class |
BigIntIndexQuery.Response |
SecondaryIndexQuery.GatherableResponseCreator<T,R extends SecondaryIndexQuery.Response<T,?>>, SecondaryIndexQuery.IndexConverter<T>, SecondaryIndexQuery.StreamableResponseCreator<T,R extends SecondaryIndexQuery.Response<T,?>>, SecondaryIndexQuery.Type
StreamableRiakCommand.StreamableResponse<T,S>, StreamableRiakCommand.StreamableRiakCommandWithSameInfo<R extends StreamableRiakCommand.StreamableResponse,I,CoreR>
GenericRiakCommand.GenericRiakCommandWithSameInfo<R,I,CoreR>
continuation, coverageContext, end, indexName, match, maxResults, namespace, paginationSort, returnBody, returnTerms, start, termFilter, timeout
Modifier | Constructor and Description |
---|---|
protected |
BigIntIndexQuery(BigIntIndexQuery.Init<BigInteger,?> builder) |
Modifier and Type | Method and Description |
---|---|
protected SecondaryIndexQuery.IndexConverter<BigInteger> |
getConverter() |
buildCoreOperation, convertInfo, convertResponse, createResponse, equals, getContinuation, getIndexName, getMatchValue, getMaxResults, getNamespace, getPaginationSort, getRangeEnd, getRangeStart, getReturnKeyAndIndex, getTermFilter, getTimeout, hashCode, toString
buildCoreOperation, executeAsyncStreaming
executeAsync
execute, execute
protected BigIntIndexQuery(BigIntIndexQuery.Init<BigInteger,?> builder)
protected SecondaryIndexQuery.IndexConverter<BigInteger> getConverter()
getConverter
in class SecondaryIndexQuery<BigInteger,BigIntIndexQuery.Response,BigIntIndexQuery>
Copyright © 2016. All rights reserved.