public class BinIndexQuery extends SecondaryIndexQuery<String,BinIndexQuery.Response,BinIndexQuery>
A RawIndexQuery is used when you are using strings for your 2i keys. The parameters are provided as String objects.
Namespace ns = new Namespace("my_type", "my_bucket");
String key = "some_key";
BinIndexQuery q = new BinIndexQuery.Builder(ns, "my_index", key).build();
BinIndexQuery.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");
String key = "some_key";
BinIndexQuery q = new BinIndexQuery.Builder(ns, "my_index", key).build();
RiakFuture<BinIndexQuery.StreamingResponse, BinIndexQuery> streamingFuture =
client.executeAsyncStreaming(q, 200);
BinIndexQuery.StreamingResponse streamingResponse = streamingFuture.get();
for (BinIndexQuery.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 |
BinIndexQuery.Builder
Builder used to construct a BinIndexQuery.
|
protected static class |
BinIndexQuery.Init<S,T extends BinIndexQuery.Init<S,T>> |
static class |
BinIndexQuery.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 |
BinIndexQuery(BinIndexQuery.Init<String,?> builder) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
protected SecondaryIndexQuery.IndexConverter<String> |
getConverter() |
int |
hashCode() |
buildCoreOperation, convertInfo, convertResponse, createResponse, getContinuation, getIndexName, getMatchValue, getMaxResults, getNamespace, getPaginationSort, getRangeEnd, getRangeStart, getReturnKeyAndIndex, getTermFilter, getTimeout, toString
buildCoreOperation, executeAsyncStreaming
executeAsync
execute, execute
protected BinIndexQuery(BinIndexQuery.Init<String,?> builder)
protected SecondaryIndexQuery.IndexConverter<String> getConverter()
getConverter
in class SecondaryIndexQuery<String,BinIndexQuery.Response,BinIndexQuery>
public boolean equals(Object o)
equals
in class SecondaryIndexQuery<String,BinIndexQuery.Response,BinIndexQuery>
public int hashCode()
hashCode
in class SecondaryIndexQuery<String,BinIndexQuery.Response,BinIndexQuery>
Copyright © 2016. All rights reserved.