
com.basho.riak.client.api.commands.DeleteSearchIndex 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;
import com.basho.riak.client.api.RiakCommand;
import com.basho.riak.client.core.RiakCluster;
import com.basho.riak.client.core.RiakFuture;
import com.basho.riak.client.core.operations.YzDeleteIndexOperation;
/**
* @author Dave Rusek
* @since 2.0
*/
public final class DeleteSearchIndex extends RiakCommand
{
private final String index;
DeleteSearchIndex(Builder builder)
{
this.index = builder.index;
}
@Override
protected final RiakFuture executeAsync(RiakCluster cluster)
{
RiakFuture coreFuture =
cluster.execute(buildCoreOperation());
CoreFutureAdapter future =
new CoreFutureAdapter(coreFuture)
{
@Override
protected Void convertResponse(Void coreResponse)
{
return coreResponse;
}
@Override
protected String convertQueryInfo(String coreQueryInfo)
{
return coreQueryInfo;
}
};
coreFuture.addListener(future);
return future;
}
private YzDeleteIndexOperation buildCoreOperation()
{
return new YzDeleteIndexOperation.Builder(index).build();
}
public static class Builder
{
private final String index;
public Builder(String index)
{
this.index = index;
}
public DeleteSearchIndex build()
{
return new DeleteSearchIndex(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy