com.basho.riak.client.api.commands.indexes.BucketIndexQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of riak-client Show documentation
Show all versions of riak-client Show documentation
HttpClient-based client for Riak
package com.basho.riak.client.api.commands.indexes;
import com.basho.riak.client.core.operations.SecondaryIndexQueryOperation;
import com.basho.riak.client.core.query.Namespace;
import com.basho.riak.client.core.query.indexes.IndexNames;
import com.basho.riak.client.core.util.BinaryValue;
/**
* Performs a 2i query across the special $bucket index, for a known bucket, and returns the keys in that bucket.
*
*
* A BucketIndexQuery is used when you want to fetch all the keys for a bucket. Only a namespace is needed.
*
*
* {@code
* Namespace ns = new Namespace("my_type", "my_bucket");
* BucketIndexQuery q = new BucketIndexQuery.Builder(ns).build();
* RawIndexquery.Response resp = client.execute(q);}
*
* @author Alex Moore
* @since 2.0.7
*/
public class BucketIndexQuery extends BinIndexQuery
{
private BucketIndexQuery(Init builder)
{
super(builder);
}
public static class Builder extends BinIndexQuery.Init
{
public Builder(Namespace namespace)
{
super(namespace, IndexNames.BUCKET, namespace.getBucketName().toStringUtf8());
}
public Builder(Namespace namespace, byte[] coverContext)
{
super(namespace, IndexNames.BUCKET, coverContext);
}
@Override
protected Builder self()
{
return this;
}
public BucketIndexQuery build()
{
return new BucketIndexQuery(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy