riak

How to mock riak java client?

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to unit test code that uses com.basho.riak:riak-client:2.0.0. I mocked all riak client classes and was hoping to get a useless but working test. However, this fails with a null pointer: java.lang.NullPointerException at com.basho.riak.client.api.commands.kv.KvResponseBase.convertValues(KvResponseBase.java:243) at com.basho.riak.client.api.commands.kv.KvResponseBase.getValue(KvResponseBase.java:150) at com.basho.riak.client.api.commands.kv.FetchValue$Response.getValue(FetchValue.java:171) My test looks like this: @Test public void

Java Riak Connection Problems

帅比萌擦擦* 提交于 2019-12-02 21:06:11
问题 trying to connect my Java Eclipse to a Riak server on Linux Ubuntu. Followed up some guides but still don't working. Using: - Riak-Client-2.0.2 - Eclipse Oxygen.1a Release (4.7.1a) - Ubuntu 16.04.3 - openjdk version "1.8.0_151" Have had some problems before with slf4j so i added a external jar: slf4j-jdk14-1.7.25-sources to solve it. My code: import com.basho.riak.client.api.RiakClient; import com.basho.riak.client.api.commands.kv.FetchValue; import com.basho.riak.client.api.commands.kv

Explain Merkle Trees for use in Eventual Consistency

旧时模样 提交于 2019-12-02 13:55:37
Merkle Trees are used as an anti-entropy mechanism in several distributed, replicated key/value stores: Dynamo Riak Cassandra No doubt an anti-entropy mechanism is A Good Thing - transient failures just happen, in production. I'm just not sure I understand why Merkle Trees are the popular approach. Sending a complete Merkle tree to a peer involves sending the local key-space to that peer, along with hashes of each key value, stored in the lowest levels of the tree. Diffing a Merkle tree sent from a peer requires having a Merkle tree of your own. Since both peers must already have a sorted key

Getting MapReduce results on RIAK (using the Java client)

空扰寡人 提交于 2019-12-02 04:18:53
I am storing Person POJOs (4 string fields - id, name, lastUpdate, Data) on RIAK, then trying to fetch these objects with MapReduce. I am doing it very similar to Basho documentation: BucketMapReduce m = riakClient.mapReduce("person"); m.addMapPhase(new NamedJSFunction("Riak.mapByFields"), true); MapReduceResult result = m.execute(); Collection<Person> tmp = result.getResult(Person.class); the Person's String constructor is invoked: public Person(String str){} (I must have this constructor, otherwise I get an exception for it is missing) In there I get the object as a String - the Object's

Links in Riak: what can they do/not do, compared to graph databases?

╄→гoц情女王★ 提交于 2019-11-30 14:29:14
The familiar Neo4j treats relationships as first class citizens; ad hoc queries/ traversals, integrity (if one node is deleted, the link is gone) etc. It also advertises as the only mechanism to denote relations as well as outperform joins of relational DBs. How powerful are Riak links to denote relationships? Can they be used to answer ad-hoc queries like "fetch a list of hobbies for each such person who earns more than x" or friend of a friend , assuming suitable features like secondary indexes? In general, can they simulate the output of a join in an RDBMS? Are they also meant for heavy use

Which clustered NoSQL DB for a Message Storing purpose?

青春壹個敷衍的年華 提交于 2019-11-29 00:03:17
Yet another question about which NoSQL to choose. However, I haven't found yet someone asking for this type of purpose, message storing... I have an Erlang Chat Server made, I'm already using MySQL for storing friend list, and "JOIN needed" informations. I would like to store Messages (That user has not receive because he was offline...) and retrieve them. I have made a pre-selection of NoSQL, I can't use things like MongoDB due to it's RAM oriented paradigm, and fail to cluster like others. I have down my list to 3 choices I guess : Hbase Riak Cassandra I know that their model are quit

How to structure data in Riak?

久未见 提交于 2019-11-28 23:30:30
I'm trying to figure out how to model data in Riak . Let's say you are building something like a CMS with two features, news and products. You need to be able to store this information for multiple clients X and Y. How would you typically structure this? One bucket per client and then two keys news and products . Store multiple objects under each key and then use map/reduce to order them. Store both the news and the products in the same bucket, but with a new autogenerated key for each news item and product item. That is, one bucket for X and one for Y. One bucket per client/feature

Good practices when developing an application in Erlang (and Riak)?

和自甴很熟 提交于 2019-11-28 15:25:43
问题 We are getting familiar with Erlang/OTP and Riak (Core, KV, Pipe, and so on) trying to build an open-source distributed application in turn. Our project is going to have a bunch of dependencies : tools like erlang_js, protobuffs, etc., but also services that we need to have running, such as Riak KV. In Python/Ruby/Node.js, if modules are placed in a standard subdirectory relative to your project's, you can reference them, and later package them in releases. You can fire up a shell in the

Run a service automatically in a docker container

你离开我真会死。 提交于 2019-11-27 17:18:16
I'm setting up a simple image: one that holds Riak (a NoSQL database). The image starts the Riak service with riak start as a CMD. Now, if I run it as a daemon with docker run -d quintenk/riak-dev , it does start the Riak process (I can see that in the logs). However, it closes automatically after a few seconds. If I run it using docker run -i -t quintenk/riak-dev /bin/bash the riak process is not started (UPDATE: see answers for an explanation for this). In fact, no services are running at all. I can start it manually using the terminal, but I would like Riak to start automatically. I figure

Which clustered NoSQL DB for a Message Storing purpose?

徘徊边缘 提交于 2019-11-27 15:11:26
问题 Yet another question about which NoSQL to choose. However, I haven't found yet someone asking for this type of purpose, message storing... I have an Erlang Chat Server made, I'm already using MySQL for storing friend list, and "JOIN needed" informations. I would like to store Messages (That user has not receive because he was offline...) and retrieve them. I have made a pre-selection of NoSQL, I can't use things like MongoDB due to it's RAM oriented paradigm, and fail to cluster like others.