Ateeq
Ateeq

Reputation: 520

Riak KV 2.1.1 Java Client: No suitable method found for Client.execute ()

I am using Java client for Riak KV 2.1.1. After creating index and applying it to Namespace, I am getting the no suitable method found error even though I am following the documentation given on the website. What is the solution for this?

Thanks.

Please see the code and the full error below.

        YokozunaIndex famousIndex = new YokozunaIndex("famous", "_yz_default");
        StoreIndex storeIndex = new StoreIndex.Builder(famousIndex)
                .build();
        client.execute(storeIndex);    
        Namespace streets=new Namespace("streets");
        StoreBucketPropsOperation storePropsOp = new StoreBucketPropsOperation.Builder(streets)
                .withSearchIndex("famous")
                .build();
        client.execute(storePropsOp); // this is where I am getting error

Error Image

Upvotes: 1

Views: 91

Answers (1)

vempo
vempo

Reputation: 3153

This is a documentation bug. RiakClient.execute() accepts an instance of RiakCommand, while StoreBucketPropsOperation is a lower-level API.

Instead, use the StoreBucketProperties command as follows:

    StoreBucketProperties storePropsCommand = new StoreBucketProperties.Builder(streets)
            .withSearchIndex("famous")
            .build();
    client.execute(storePropsCommand);

Upvotes: 2

Related Questions