Re: Riak Java client API

2016-10-29 Thread AJAX DoneBy Jack
Hi Pratik,

>From exception msg you are missing joda time jar, download one and put in
your classpath.
If you use maven it will download the dependency for you automatically.

Hope this help.
Ajax

On Friday, 28 October 2016, Pratik Kulkarni  wrote:

> Hi All,
>
> I am working on a distributed file storage system using the Java Netty
> framework. For this purpose i have Raik KV as an in memory  storage
> solution.
> Following jar dependencies are present in my build path :
>
> jackson-all-1.8.5.jar
> netty-all-4.0.15.Final.jar
> slf4j-api-1.7.2.jar
> slf4j-simple-1.7.2.jar
> protobuf-java-2.6.1.jar
> json-20160212.jar
> riak-client-2.0.5.jar
>
> When i try initiate connection with the riak node. The connection attempt
> is successful but when i try to store the object in *Riak KV.* I keep
> getting the following NoClassDefFoundError. I am not sure why these errors
> arrive though i have included all the jars. Do we require apart from*
> riak-client X.X jar* any more dependencies. As per the terminal output I
> tried to add the dependencies by downloading the jars. But it just keeps
> giving me new dependencies error every time.  Kindly help ?
>
> *Please see the riak client code in java to store the file object *
>
>
> package gash.router.inmemory;
>
> import com.basho.riak.client.api.RiakClient;
> import com.basho.riak.client.api.commands.kv.DeleteValue;
> import com.basho.riak.client.api.commands.kv.FetchValue;
> import com.basho.riak.client.api.commands.kv.StoreValue;
> import com.basho.riak.client.core.RiakCluster;
> import com.basho.riak.client.core.RiakNode;
> import com.basho.riak.client.core.query.Location;
> import com.basho.riak.client.core.query.Namespace;
> import com.basho.riak.client.core.query.RiakObject;
> import com.basho.riak.client.core.util.BinaryValue;
>
> import java.net.UnknownHostException;
>
> public class RiakClientHandler {
> private static RiakCluster setUpCluster() throws UnknownHostException{
> // This example will use only one node listening on
> localhost:8098--default config
>
> RiakNode node = new RiakNode.Builder()
> .withRemoteAddress("127.0.0.1")
> .withRemotePort(8098)
> .build();
>  // This cluster object takes our one node as an argument
> RiakCluster cluster = new RiakCluster.Builder(node)
> .build();
>
> // The cluster must be started to work, otherwise you will see
> errors
> cluster.start();
>
> return cluster;
> }
> private static class RiakFile{
> public String filename;
> public byte[] byteData;
> }
> public static void saveFile(String filename,byte[] byteData)
> {
> try{
> System.out.println("Inside Riak handler");
> RiakCluster cluster = setUpCluster();
> RiakClient client = new RiakClient(cluster);
> RiakFile newFile = createRiakFile(filename, byteData);
> System.out.println("Riak file created");
> Namespace fileBucket = new Namespace("files");
> Location fileLocation = new Location(fileBucket, filename);
> StoreValue storeFile = new StoreValue.Builder(newFile).
> withLocation(fileLocation).build();
> client.execute(storeFile);
> System.out.println("File saved to riak ");
> cluster.shutdown();
> }
> catch(Exception e){
> e.printStackTrace();
> }
> }
> private static RiakFile createRiakFile(String filename, byte[] byteData)
> {
> RiakFile file=new RiakFile();
> file.filename=filename;
> file.byteData=byteData;
> return file;
> }
>
> }
>
>
> *The terminal Output error:*
>
>
>
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Riak_explorer stopped working after turn on security on cluster

2016-10-20 Thread AJAX DoneBy Jack
Hello Basho,

Today I turned on security on my cluster but riak_explorer stopped working
after that.
Anything I need to check on riak_explorer to make it works again?

Thanks,
Ajax
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: How to specify dismax related parameters like qf

2016-10-17 Thread AJAX DoneBy Jack
Hi Alex,

I did tried that in Java client using PB, but getting exception, I can
paste the error here tonight.

Thanks,
Ajax

On Monday, 17 October 2016, Alex Moore <amo...@basho.com> wrote:

> Hey Ajax,
>
> Have you tried adding those parameters to the LocalParameters {!dismax}
>  block?
>
> e.g.: {!type=dismax qf='myfield yourfield'}solr rocks
>
> http://wiki.apache.org/solr/LocalParams#Basic_Syntax
>
> Thanks,
> Alex
>
> On Fri, Oct 14, 2016 at 3:18 PM, AJAX DoneBy Jack <ajaxd...@gmail.com
> <javascript:_e(%7B%7D,'cvml','ajaxd...@gmail.com');>> wrote:
>
>> Hello Basho,
>>
>> I am very new on Riak Search, I know can add {!dismax}before query string
>> to use it, but don't know how to specify qf or other dismax related
>> parameters in Riak Java Client. Could you advise?
>>
>> Thanks,
>> Ajax
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> <javascript:_e(%7B%7D,'cvml','riak-users@lists.basho.com');>
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: How to specify dismax related parameters like qf

2016-10-17 Thread AJAX DoneBy Jack
Hi Magnus,

So you suggest to use http API right? That day I were thinking query the
internal Solr http by sending request. Could you advise what's the
difference between Riak http API and internal Solr http API? What's the
pros and cons to use them?

Thanks,
Ajax

On Monday, 17 October 2016, Magnus Kessler <mkess...@basho.com> wrote:

> On 14 October 2016 at 20:18, AJAX DoneBy Jack <ajaxd...@gmail.com
> <javascript:_e(%7B%7D,'cvml','ajaxd...@gmail.com');>> wrote:
>
>> Hello Basho,
>>
>> I am very new on Riak Search, I know can add {!dismax}before query string
>> to use it, but don't know how to specify qf or other dismax related
>> parameters in Riak Java Client. Could you advise?
>>
>> Thanks,
>> Ajax
>>
>
> Hi Ajax,
>
> The Riak Java Client, as most other Riak clients, uses the Protocol Buffer
> API to communicate with Riak. Yokozuna's implementation of the Protocol
> Buffer API allows only for a small set of query parameters [0], which have
> been chosen to support the standard query parser. As such, there is
> currently no easy way to use the extended set of query parameters through
> the java api.
>
> However, you may have better luck if you talk directly to HTTP API,
> exposed at http://:8098/search/query/. This will accept
> all queries supported by Solr 4.7. Please be aware, though, that some query
> results that require accumulating data from all Solr nodes (such as stats
> queries), may not work as expected. Yokozuna constructs a new coverage
> query very frequently, and the actual results returned depend on which
> nodes are chosen in this query.
>
> Kind Regards,
>
> Magnus
>
> [0]: https://github.com/basho/yokozuna/blob/develop/src/yz_
> pb_search.erl#L144-L150
>
>
>
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> <javascript:_e(%7B%7D,'cvml','riak-users@lists.basho.com');>
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Magnus Kessler
> Client Services Engineer
> Basho Technologies Limited
>
> Registered Office - 8 Lincoln’s Inn Fields London WC2A 3BP Reg 07970431
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


How to specify dismax related parameters like qf

2016-10-14 Thread AJAX DoneBy Jack
Hello Basho,

I am very new on Riak Search, I know can add {!dismax}before query string
to use it, but don't know how to specify qf or other dismax related
parameters in Riak Java Client. Could you advise?

Thanks,
Ajax
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com