Exception in Tutorial

2014-06-28 Thread darkchanter
Hello there
sorry to bother you guys with this totally noob question...

I am trying to run the tutorial "Tast of Riak" in eclipse. I have a cluster
running made of 3 joined dev-nodes, from which I can get the stats via
browser. The "all in one client" jar is referenced by the java project.

However I receive a "java.io.EOFException"  when trying to fetch any bucket:

Bucket myBucket = client.fetchBucket("test").execute();

(as far I know they should be created/managed automatically when not
existing)

Since the exception occures at this line, I assume that the connection
itself was successfully established:

IRiakClient client = RiakFactory.pbcClient("127.0.0.1", 10018);

I set up (and started) Riak under root, while I am working in KDE with
another user. Could this cause the problem?

Thanks
Roger



--
View this message in context: 
http://riak-users.197444.n3.nabble.com/Exception-in-Tutorial-tp4031300.html
Sent from the Riak Users mailing list archive at Nabble.com.

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


Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi there,

Can somebody help me understand a bit better the bucket quorums? I will use
the Python API to write code examples:

Imagine we are building a web app like twitter, and we want fast read
(although not need to be consistent) and safe writings, this R/W
combination is appropriate?

bucket = client.bucket('twits')

bucket.r = 1
bucket.w = 3

# OR

bucket.set_property('r', 1)
bucket.set_property('w', 3)

Which method is better to use? or are just exactly the same?

Imagine that in this new case, we want to focus on writing fast (normally
we will write more "twits" than read them)... which would be the most
appropriate/suggested quorums?

Also, what's really the difference between "r" and "pr"? what is a "primary
replica"?

If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
background but will reply "true" once 1 copy is saved, right?

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


Re: Exception in Tutorial

2014-06-28 Thread Alex Moore
Try port 10017 instead. 10018 is usually the HTTP port for the dev1 devrel node.

Thanks,
Alex

> On Jun 28, 2014, at 5:03 AM, darkchanter  wrote:
> 
> Hello there
> sorry to bother you guys with this totally noob question...
> 
> I am trying to run the tutorial "Tast of Riak" in eclipse. I have a cluster
> running made of 3 joined dev-nodes, from which I can get the stats via
> browser. The "all in one client" jar is referenced by the java project.
> 
> However I receive a "java.io.EOFException"  when trying to fetch any bucket:
> 
> Bucket myBucket = client.fetchBucket("test").execute();
> 
> (as far I know they should be created/managed automatically when not
> existing)
> 
> Since the exception occures at this line, I assume that the connection
> itself was successfully established:
> 
> IRiakClient client = RiakFactory.pbcClient("127.0.0.1", 10018);
> 
> I set up (and started) Riak under root, while I am working in KDE with
> another user. Could this cause the problem?
> 
> Thanks
> Roger
> 
> 
> 
> --
> View this message in context: 
> http://riak-users.197444.n3.nabble.com/Exception-in-Tutorial-tp4031300.html
> Sent from the Riak Users mailing list archive at Nabble.com.
> 
> ___
> riak-users mailing list
> 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: Exception in Tutorial

2014-06-28 Thread darkchanter
cool - that did the trick ;-)

Roger



--
View this message in context: 
http://riak-users.197444.n3.nabble.com/Exception-in-Tutorial-tp4031300p4031303.html
Sent from the Riak Users mailing list archive at Nabble.com.

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


Re: Help on bucket quorums

2014-06-28 Thread Brett Hazen
Alex —

Have you already checked out the documentation about eventual consistency?

http://docs.basho.com/riak/latest/theory/concepts/Eventual-Consistency/

Also there is a great series of blog posts which John Daily wrote about Riak’s 
configuration:

http://basho.com/understanding-riaks-configurable-behaviors-part-1/

Brett

On June 28, 2014 at 4:56:26 AM, Alex De la rosa (alex.rosa@gmail.com) wrote:

Hi there,

Can somebody help me understand a bit better the bucket quorums? I will use the 
Python API to write code examples:

Imagine we are building a web app like twitter, and we want fast read (although 
not need to be consistent) and safe writings, this R/W combination is 
appropriate?

bucket = client.bucket('twits')

bucket.r = 1
bucket.w = 3

# OR

bucket.set_property('r', 1)
bucket.set_property('w', 3)

Which method is better to use? or are just exactly the same?

Imagine that in this new case, we want to focus on writing fast (normally we 
will write more "twits" than read them)... which would be the most 
appropriate/suggested quorums?

Also, what's really the difference between "r" and "pr"? what is a "primary 
replica"?

If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the 
background but will reply "true" once 1 copy is saved, right?

Thanks,
Alex
___  
riak-users mailing list  
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: Help on bucket quorums

2014-06-28 Thread John Daily
I don't have time at the moment to respond in more detail, I'm afraid, but
you should find this blog series quite useful.

http://basho.com/understanding-riaks-configurable-behaviors-part-1/


Sent from my iPhone

On Jun 28, 2014, at 5:56 AM, Alex De la rosa 
wrote:

Hi there,

Can somebody help me understand a bit better the bucket quorums? I will use
the Python API to write code examples:

Imagine we are building a web app like twitter, and we want fast read
(although not need to be consistent) and safe writings, this R/W
combination is appropriate?

bucket = client.bucket('twits')

bucket.r = 1
bucket.w = 3

# OR

bucket.set_property('r', 1)
bucket.set_property('w', 3)

Which method is better to use? or are just exactly the same?

Imagine that in this new case, we want to focus on writing fast (normally
we will write more "twits" than read them)... which would be the most
appropriate/suggested quorums?

Also, what's really the difference between "r" and "pr"? what is a "primary
replica"?

If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
background but will reply "true" once 1 copy is saved, right?

Thanks,
Alex

___
riak-users mailing list
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: Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi John, Hi Brett,

Thanks for the links! I will take a look and see if I figure it out ;)

Greetings,
Alex


On Sat, Jun 28, 2014 at 6:20 PM, John Daily  wrote:

> I don't have time at the moment to respond in more detail, I'm afraid, but
> you should find this blog series quite useful.
>
> http://basho.com/understanding-riaks-configurable-behaviors-part-1/
>
>
> Sent from my iPhone
>
> On Jun 28, 2014, at 5:56 AM, Alex De la rosa 
> wrote:
>
> Hi there,
>
> Can somebody help me understand a bit better the bucket quorums? I will
> use the Python API to write code examples:
>
> Imagine we are building a web app like twitter, and we want fast read
> (although not need to be consistent) and safe writings, this R/W
> combination is appropriate?
>
> bucket = client.bucket('twits')
>
> bucket.r = 1
> bucket.w = 3
>
> # OR
>
> bucket.set_property('r', 1)
> bucket.set_property('w', 3)
>
> Which method is better to use? or are just exactly the same?
>
> Imagine that in this new case, we want to focus on writing fast (normally
> we will write more "twits" than read them)... which would be the most
> appropriate/suggested quorums?
>
> Also, what's really the difference between "r" and "pr"? what is a
> "primary replica"?
>
> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
> background but will reply "true" once 1 copy is saved, right?
>
> Thanks,
> Alex
>
> ___
>
> riak-users mailing list
> 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: Help on bucket quorums

2014-06-28 Thread Sean Cribbs
On Sat, Jun 28, 2014 at 4:55 AM, Alex De la rosa 
wrote:

> Hi there,
>
> Can somebody help me understand a bit better the bucket quorums? I will
> use the Python API to write code examples:
>
> Imagine we are building a web app like twitter, and we want fast read
> (although not need to be consistent) and safe writings, this R/W
> combination is appropriate?
>
> bucket = client.bucket('twits')
>
> bucket.r = 1
> bucket.w = 3
>
> # OR
>
> bucket.set_property('r', 1)
> bucket.set_property('w', 3)
>
> Which method is better to use? or are just exactly the same?
>
>
The pseudo-properties in the first example are exactly the same as the
set_property() calls in the second, just a convenience. Generally I
wouldn't recommend W=3 because it will tend to create false negatives under
heavy load, W=2 (the default) should be sufficient. Keep in mind that R=1
with notfound_ok = true (the default) can tend to result in false negative
responses as well.


> Imagine that in this new case, we want to focus on writing fast (normally
> we will write more "twits" than read them)... which would be the most
> appropriate/suggested quorums?
>
> Also, what's really the difference between "r" and "pr"? what is a
> "primary replica"?
>
>
Primaries are the replicas (nodes) that are the canonical owners the data,
but Riak will let you read and write even if they are not available. If
they are not available, fallback replicas (non-owner nodes) will take over
in their place. Setting PR or PW > 0 will result in failures if that many
primaries are not available (the node is down or partitioned from the node
that receives the request).


> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
> background but will reply "true" once 1 copy is saved, right?
>
>
Yes. Keep in mind W is a fast-path response, i.e. "I received the request
to write", whereas DW is a "I saved the key to the storage engine". There
is no practical reason for DW ever to be 0, in fact I think it is
disallowed (or silently upgraded to 1).


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


-- 
Sean Cribbs 
Software Engineer
Basho Technologies, Inc.
http://basho.com/
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi Sean,

Thank you very much for your explanation :) looks much clearer now.

So... is not viable to set anything to 0 as it would make no sense and
fail, and also is not appropriate to set anything to the same value as
"n_value" (in this case 3) as there would be false negatives... so the
adjustments should be between 1 and 2 (the default)... meaning that we can
only increase its speed a bit setting some value to 1 (r = 1 if we want to
read fast, w = 1 if we want to write fast)

For what I see, makes no much sense to change PR and PW... and DW only if
we really really really want strong consistency. Leaving again just the
real need to set "r" and "w" if we want to speed up any of the processes.

Am I right?

Cheers,
Alex


On Sat, Jun 28, 2014 at 8:41 PM, Sean Cribbs  wrote:

>
> On Sat, Jun 28, 2014 at 4:55 AM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> Can somebody help me understand a bit better the bucket quorums? I will
>> use the Python API to write code examples:
>>
>> Imagine we are building a web app like twitter, and we want fast read
>> (although not need to be consistent) and safe writings, this R/W
>> combination is appropriate?
>>
>> bucket = client.bucket('twits')
>>
>> bucket.r = 1
>> bucket.w = 3
>>
>> # OR
>>
>> bucket.set_property('r', 1)
>> bucket.set_property('w', 3)
>>
>> Which method is better to use? or are just exactly the same?
>>
>>
> The pseudo-properties in the first example are exactly the same as the
> set_property() calls in the second, just a convenience. Generally I
> wouldn't recommend W=3 because it will tend to create false negatives under
> heavy load, W=2 (the default) should be sufficient. Keep in mind that R=1
> with notfound_ok = true (the default) can tend to result in false negative
> responses as well.
>
>
>> Imagine that in this new case, we want to focus on writing fast (normally
>> we will write more "twits" than read them)... which would be the most
>> appropriate/suggested quorums?
>>
>> Also, what's really the difference between "r" and "pr"? what is a
>> "primary replica"?
>>
>>
> Primaries are the replicas (nodes) that are the canonical owners the data,
> but Riak will let you read and write even if they are not available. If
> they are not available, fallback replicas (non-owner nodes) will take over
> in their place. Setting PR or PW > 0 will result in failures if that many
> primaries are not available (the node is down or partitioned from the node
> that receives the request).
>
>
>> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
>> background but will reply "true" once 1 copy is saved, right?
>>
>>
> Yes. Keep in mind W is a fast-path response, i.e. "I received the request
> to write", whereas DW is a "I saved the key to the storage engine". There
> is no practical reason for DW ever to be 0, in fact I think it is
> disallowed (or silently upgraded to 1).
>
>
>> Thanks,
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com