Re: Network traffic patterns

2011-11-17 Thread Philippe
Hi Todd
Yes all equal hardware. Nearly no CPU usage and no memory issues.
Repairs are running in tens of minutes so i don't understand why
replication would be backed up.

Any other ideas?
Le 17 nov. 2011 02:33, "Todd Burruss"  a écrit :

> Are all of your machines equal hardware?  Since those machines are sending
> data somewhere, maybe they are behind in replicating and are continuously
> catching up?
>
> Use a tool like tcpdump to find out where the data is going
>
> From: Philippe 
> Reply-To: "user@cassandra.apache.org" 
> Date: Tue, 15 Nov 2011 13:22:38 -0800
> To: user 
> Subject: Re: Network traffic patterns
>
> Sorry about the previous message, I've enabled keyboard shortcuts on
> gmail...*sigh*...
>
> Hello,
> I'm trying to understand the network usage I am seeing in my cluster, can
> anyone shed some light?
> It's an RF=3, 12-node, cassandra 0.8.6 cluster. repair is performed on
> each node once a week, with a rolling schedule.
> The nodes are p13,p14,p15...p24 and are consecutive in that order on the
> ring. Each node is only a cassandra database. I am hitting the cluster from
> another server (p4).
>
> p4 is doing this with 20 threads in parallel
>
>1. read a lot of data (some columns for hundreds to tens of thousands
>of keys, split into 512-key multigets)
>2. process the data
>3. write back a byte array to cassandra (average size is 400 bytes)
>4. go back to 1
>
> According to my munin graphs, network usage is about as follows. I am not
> surprised at the bias towards p13-p15 as p4 is getting & storing data
> mainly for keys located on one of those nodes.
>
>- p4 : 1.5Mb/s in and out
>- p13-p15 : 15Mb/s in and 80Mb/s out
>- p16-p24 : 45Mb/s in and 5Mb/s out
>
> What I don't understand is why p4 is only seeing 1.5Mb/s while I see
> 80Mb/s on p13 & p15.
>
> The way I understand this:
>
>- p4 makes a multiget to the cluster, electing to use any node in the
>cluster (IN traffic for describe the query)
>- coordinator node replays the query on all 3 replicas (so 3 servers
>each get the IN traffic, mostly p13-p15)
>- each server replies to coordinator
>- coordinator chooses matching values and sends back data to p4
>
> So if p13-p15 are outputting 80Mb/s why am I not seeing 80Mb/s coming into
> p4 which is on the receiving end ?
>
> Thanks
>
> 2011/11/15 Philippe 
>
>> Hello,
>> I'm trying to understand the network usage I am seeing in my cluster, can
>> anyone shed some light?
>> It's an RF=3, 12-node, cassandra 0.8.6 cluster. The nodes are
>> p13,p14,p15...p24 and are consecutive in that order on the ring.
>> Each node is only a cassandra database. I am hitting the cluster from
>> another server (p4).
>>
>> The pattern on p4 is the pattern is to
>>
>>1. read a lot of data (some columns for hundreds to tens of thousands
>>of keys, split into 512-key multigets)
>>2. process the data
>>3. write back a byte array to cassandra (average size is 400 bytes)
>>
>>
>> p4 reads as
>>
>
>


split large sstable

2011-11-17 Thread Radim Kolar
Is there some simple way how to split large sstable into several smaller 
ones? I increased  min_compaction_threshold (smaller tables seems to get 
better file offset caching from OS) and now i need to reshuffle data to 
smaller sstables, running several cluster wide repairs worked well just 
largest table was left. I have 80 GB sstable and need to split it to 
about 10 GB ones.


Re: Second Cassandra users survey

2011-11-17 Thread Boris Yen
I was wondering if it is possible to provide a funtion like "delete  from
cf where column='value'  "

I think this shold be useful for people who use secondary index a lot.

On Nov 15, 2011 11:05 AM, "Edward Ribeiro"  wrote:
>
> +1 on co-processors.
>
>
> Edward


Quick DataStax OpsCenter question

2011-11-17 Thread Alexandru Dan Sicoe
Hi,

 I'm using the community version of OpsCenter to monitor my clutster. At
the moment I'm interested in storage space. In the performance metrics
page, if I choose to see the graph of a the metric "CF: SSTable Size" for a
certain CF of interest,  two things are plotted on the graph: Total disk
used (Total) and Live disk used (Total). Does anyone know what they mean?
And what is the difference? "Total disk used" gives me the same value as
the size on disk of the files corresponding to the CF in the data directory
(all files starting with CF name and having Statistics, Data, Filter, Index
or Compacted). But what is the "Live disk used"? I thought it is just the
raw data on disk (column names and values) without any SSTable overhead,
but this is not true because it reports a lower value than if I see the
disk usage of just the "CFName-..-Data.db" files.
 I'm always confused about what all the metrics in the OpsCenter mean and
how they are calculated. Is there a reference explaining all of them? Most
are mapped to the JMX attributes exposed...but even for those, I've never
found a reference explaining them in detail. Any suggestions?

Cheers,
Alexandru

P.S.  I'm using Cassandra 0.8.5


building a new email-like inbox service with cassandra

2011-11-17 Thread Dotan N.
Hi all,
New to cassandra, i'm about to embrak on building a scalable user inbox
service on top of cassandra.
I've done the preliminary googling and got some more info on bluerunner
(IBM's project on the subject),
and now looking for more information in this specific topic.

If anyone can point me to researches/articles that would nudge me in the
right direction i'd be tremendously thankful!

Thanks!

--
Dotan, @jondot 


Re: building a new email-like inbox service with cassandra

2011-11-17 Thread Edward Capriolo
On Thu, Nov 17, 2011 at 9:17 AM, Dotan N.  wrote:

> Hi all,
> New to cassandra, i'm about to embrak on building a scalable user inbox
> service on top of cassandra.
> I've done the preliminary googling and got some more info on bluerunner
> (IBM's project on the subject),
> and now looking for more information in this specific topic.
>
> If anyone can point me to researches/articles that would nudge me in the
> right direction i'd be tremendously thankful!
>
> Thanks!
>
> --
> Dotan, @jondot 
>
>
Why would you want to do inbox search with cassandra? (Just Kidding after
all that was it's first use case at Facebook). I would say your best best
is to research solandra or those doing full text search in Cassandra.


Re: building a new email-like inbox service with cassandra

2011-11-17 Thread Dotan N.
I'm sorry if I misrepresented the domain. it is not inbox search, but
implementation of inbox. that is: write messages for users, get messages
for a user, get unread messages for a user, mark messages as read for a
user.
basically this is it.
although (and due to) the use cases are simple we're aiming at cassandra
due to the large amount of users we expect.

--
Dotan, @jondot 



On Thu, Nov 17, 2011 at 5:26 PM, Edward Capriolo wrote:

>
>
> On Thu, Nov 17, 2011 at 9:17 AM, Dotan N.  wrote:
>
>> Hi all,
>> New to cassandra, i'm about to embrak on building a scalable user inbox
>> service on top of cassandra.
>> I've done the preliminary googling and got some more info on bluerunner
>> (IBM's project on the subject),
>> and now looking for more information in this specific topic.
>>
>> If anyone can point me to researches/articles that would nudge me in the
>> right direction i'd be tremendously thankful!
>>
>> Thanks!
>>
>> --
>> Dotan, @jondot 
>>
>>
> Why would you want to do inbox search with cassandra? (Just Kidding after
> all that was it's first use case at Facebook). I would say your best best
> is to research solandra or those doing full text search in Cassandra.
>


Re: building a new email-like inbox service with cassandra

2011-11-17 Thread Rustam Aliyev

Hi Dotan,

We have already built something similar and were planning to open source 
it. It will be available under http://www.elasticinbox.com/.


We haven't followed exactly IBM's paper, we believe our Cassandra model 
design is more robust. It's written in Java and provides LMTP and REST 
interfaces. ElasticInbox also stores original messages outside of the 
Cassandra, in the blob store.


Let me know if you are interested, I will need some time to do cleanup.

Regards,
Rustam.

On 17/11/2011 14:17, Dotan N. wrote:

Hi all,
New to cassandra, i'm about to embrak on building a scalable user 
inbox service on top of cassandra.
I've done the preliminary googling and got some more info on 
bluerunner (IBM's project on the subject),

and now looking for more information in this specific topic.

If anyone can point me to researches/articles that would nudge me in 
the right direction i'd be tremendously thankful!


Thanks!

--
Dotan, @jondot 



Re: building a new email-like inbox service with cassandra

2011-11-17 Thread Norman Maurer
I would be very interested in this. I wrote a prototype for JAMES which
uses cassandra to store emails and provide them via IMAP and POP3 so it
would be nice to see your impl.

thanks
norman

Am Donnerstag, 17. November 2011 schrieb Rustam Aliyev :
> Hi Dotan,
>
> We have already built something similar and were planning to open source
it. It will be available under http://www.elasticinbox.com/.
>
> We haven't followed exactly IBM's paper, we believe our Cassandra model
design is more robust. It's written in Java and provides LMTP and REST
interfaces. ElasticInbox also stores original messages outside of the
Cassandra, in the blob store.
>
> Let me know if you are interested, I will need some time to do cleanup.
>
> Regards,
> Rustam.
>
> On 17/11/2011 14:17, Dotan N. wrote:
>
> Hi all,
> New to cassandra, i'm about to embrak on building a scalable user inbox
service on top of cassandra.
> I've done the preliminary googling and got some more info on bluerunner
(IBM's project on the subject),
> and now looking for more information in this specific topic.
> If anyone can point me to researches/articles that would nudge me in the
right direction i'd be tremendously thankful!
> Thanks!
> --
> Dotan, @jondot
>


java lib used in cli to provide auto-completion

2011-11-17 Thread S Ahmed
Hi folks,

I'm curious what java lib is used to provide auto-completion in the cli?
 Or is it all custom code?


Re: Quick DataStax OpsCenter question

2011-11-17 Thread Nick Bailey
Live Disk Space indicates all sstables that are currently valid. Total
Disk Space will include sstables that have been compacted but not yet
deleted (because a full GC hasn't run yet).

Also the 1.3 release of OpsCenter includes an inline help section. You
can find more specific information about performance metrics under the
Performance section of the help.

On Thu, Nov 17, 2011 at 7:35 AM, Alexandru Dan Sicoe
 wrote:
> Hi,
>
>  I'm using the community version of OpsCenter to monitor my clutster. At the
> moment I'm interested in storage space. In the performance metrics page, if
> I choose to see the graph of a the metric "CF: SSTable Size" for a certain
> CF of interest,  two things are plotted on the graph: Total disk used
> (Total) and Live disk used (Total). Does anyone know what they mean? And
> what is the difference? "Total disk used" gives me the same value as the
> size on disk of the files corresponding to the CF in the data directory (all
> files starting with CF name and having Statistics, Data, Filter, Index or
> Compacted). But what is the "Live disk used"? I thought it is just the raw
> data on disk (column names and values) without any SSTable overhead, but
> this is not true because it reports a lower value than if I see the disk
> usage of just the "CFName-..-Data.db" files.
>  I'm always confused about what all the metrics in the OpsCenter mean and
> how they are calculated. Is there a reference explaining all of them? Most
> are mapped to the JMX attributes exposed...but even for those, I've never
> found a reference explaining them in detail. Any suggestions?
>
> Cheers,
> Alexandru
>
> P.S.  I'm using Cassandra 0.8.5


RE: split large sstable

2011-11-17 Thread Dan Hendry
What do you mean by ' better file offset caching'? Presumably you mean
'better page cache hit rate'? Out of curiosity, why do you think this? What
data are you seeing which makes you think it's better? I am certainly not
even close to a virtual memory or page caching expert but I am pretty sure
file size does not matter (assuming file sizes are significantly greater
than the page size which I believe is 4k). 

Perhaps what you are actually seeing is row fragmentation across your
SSTables? Easy to check with nodetool cfhistograms (SSTables column).

To answer your question, I know of no tools to split SSTables. If you want
to switch compaction strategies, levelled compaction (1.0.x) creates many
smaller sstables instead of fewer, bigger ones. Although it is workload
dependent, increasing min_compaction_threshold for size tiered compaction is
probably a bad idea since it will increase row fragmentation across SSTables
and therefore increase io/seeking requirements for reads (particularly for
column ranges or non named-column queries). The only reason to do so is to
reduce the frequency of compaction (disk io considerations). 

Dan

-Original Message-
From: Radim Kolar [mailto:h...@sendmail.cz] 
Sent: November-17-11 5:02
To: user@cassandra.apache.org
Subject: split large sstable

Is there some simple way how to split large sstable into several smaller 
ones? I increased  min_compaction_threshold (smaller tables seems to get 
better file offset caching from OS) and now i need to reshuffle data to 
smaller sstables, running several cluster wide repairs worked well just 
largest table was left. I have 80 GB sstable and need to split it to 
about 10 GB ones.
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.920 / Virus Database: 271.1.1/4020 - Release Date: 11/16/11
02:34:00



Help with Pig Script

2011-11-17 Thread Aaron Griffith
I am trying to do the following with a PIG script and am having trouble finding 
the correct syntax.

- I want to use the LOAD function to load a single key/value "row" into a pig 
object.
- The contents of that row is then flattened into a list of keys.
- I then want to use that list of keys for another load function to select the 
key/value pairs from another column family.

The only way I can get this to work is by using a generic load function then 
applying filters to get at the data I want. Then joining the two pig objects 
together to filter the second column family.

I want to avoid having to pull the entire column familys into pig, it is way 
too 
much data.

Any suggestions?

Thanks!



A Cassandra CLI question: null vs 0 rows

2011-11-17 Thread Maxim Potekhin

Hello everyone,

I run a query on a secondary index. For some queries, I get 0 rows 
returned. In other cases,

I just get a string that reads "null".

What's going on?

TIA

Maxim



Re: Dropped request...

2011-11-17 Thread K.Tomita
Hello, Jeesoo.

I was investigating it exactly.

It means,when RPC service does not return a status
for a defined period of time,
the value is incremented.
(cassandra.yaml:rpc_timeout_in_ms)
(default:1)

Therefore,
The Drop is assumed that,
there is a possibility that distribution node is completed processing,
and there is a possibility of having failed.

So, I recommend checking the data on a distribution node.


** I hope tomorrow will be a good day **

              Tomita Kazutaka

mailto : tomitakazut...@intheforest.jp
blog   : http://www.intheforest.jp/blog/
twitter: http://twitter.com/railute
*       



2011/11/17 Jeesoo Shin :
> Hello.
> I'm using cassandra 0.8.6
> with nodetool tpstats, dropped statistics are shown.
>
> when drop happens... what can I do?
> are there ways to turn on debug messages or to look into?
>
> thanks.
>


Re: A Cassandra CLI question: null vs 0 rows

2011-11-17 Thread Jonathan Ellis
If CLI returns null it means there was an error -- run with --debug to
check the exception.

On Thu, Nov 17, 2011 at 11:20 AM, Maxim Potekhin  wrote:
> Hello everyone,
>
> I run a query on a secondary index. For some queries, I get 0 rows returned.
> In other cases,
> I just get a string that reads "null".
>
> What's going on?
>
> TIA
>
> Maxim
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com


Re: A Cassandra CLI question: null vs 0 rows

2011-11-17 Thread Maxim Potekhin
Thanks Jonathan. I get the bellow error. Don't have a clue as to what it 
means.



null
java.lang.RuntimeException
at 
org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
at 
org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)

at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
Caused by: java.lang.RuntimeException
at 
org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:814)
at 
org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)

... 2 more


On 11/17/2011 12:28 PM, Jonathan Ellis wrote:

If CLI returns null it means there was an error -- run with --debug to
check the exception.

On Thu, Nov 17, 2011 at 11:20 AM, Maxim Potekhin  wrote:

Hello everyone,

I run a query on a secondary index. For some queries, I get 0 rows returned.
In other cases,
I just get a string that reads "null".

What's going on?

TIA

Maxim









What sort of load do the tombstones create on the cluster?

2011-11-17 Thread Maxim Potekhin
In view of my unpleasant discovery last week that deletions in Cassandra 
lead to a very real

and serious performance loss, I'm working on a strategy of moving forward.

If the tombstones do cause such problem, where should I be looking for 
performance bottlenecks?
Is it disk, CPU or something else? Thing is, I don't see anything 
outstanding in my Ganglia plots.


TIA,

Maxim



Austin Hacker Dojo - Big Data Machine Learning

2011-11-17 Thread David Boney
I am interested in starting a hacker dojo in Austin for big data machine 
learning. We would meet one evening a week to work on coding up Hadoop based 
machine learning and statistical analysis problems for big data systems. This 
would be a hacker dojo where the focus is on coding. I can teach and/or provide 
papers on any algorithms we want to study. I am interested in working with 
Hadoop, Mahout, and Hama but also I am interested in coding algorithms from 
scratch to learn about the algorithm implementation issues. Drop me a line if 
you are interested. If at least three or four people are interested we can have 
an organization meeting to discuss the group name, finding a location to meet, 
development environment, setting up a web site, and the agenda for the first 
couple of months.

Sincerely,
David G. Boney
l...@semanticartifacts.com

Re: Help with Pig Script

2011-11-17 Thread Jeremy Hanna
If you are only interested in loading one row, why do you need to use Pig?  Is 
it an extremely wide row?

Unless you are using an ordered partitioner, you can't limit the rows you 
mapreduce over currently - you have to mapreduce over the whole column family.  
That will change probably in 1.1.  However, again, if you're only after 1 row, 
why don't you just use a regular cassandra client and get that row and operate 
on it that way?

I suppose you *could* use pig and filter by the ID or something.  If you *do* 
have an ordered partitioner in your cluster, it's just a matter of specifying 
the key range.

On Nov 17, 2011, at 11:16 AM, Aaron Griffith wrote:

> I am trying to do the following with a PIG script and am having trouble 
> finding 
> the correct syntax.
> 
> - I want to use the LOAD function to load a single key/value "row" into a pig 
> object.
> - The contents of that row is then flattened into a list of keys.
> - I then want to use that list of keys for another load function to select 
> the 
> key/value pairs from another column family.
> 
> The only way I can get this to work is by using a generic load function then 
> applying filters to get at the data I want. Then joining the two pig objects 
> together to filter the second column family.
> 
> I want to avoid having to pull the entire column familys into pig, it is way 
> too 
> much data.
> 
> Any suggestions?
> 
> Thanks!
> 



Re: Help with Pig Script

2011-11-17 Thread Aaron Griffith
Jeremy Hanna  gmail.com> writes:

> 
> If you are only interested in loading one row, why do you need to use Pig?  
> Is 
it an extremely wide row?
> 
> Unless you are using an ordered partitioner, you can't limit the rows you 
mapreduce over currently - you
> have to mapreduce over the whole column family.  That will change probably in 
1.1.  However, again, if
> you're only after 1 row, why don't you just use a regular cassandra client 
> and 
get that row and operate on it
> that way?
> 
> I suppose you *could* use pig and filter by the ID or something.  If you *do* 
have an ordered partitioner in
> your cluster, it's just a matter of specifying the key range.
> 
> On Nov 17, 2011, at 11:16 AM, Aaron Griffith wrote:
> 
> > I am trying to do the following with a PIG script and am having trouble 
finding 
> > the correct syntax.
> > 
> > - I want to use the LOAD function to load a single key/value "row" into a 
pig 
> > object.
> > - The contents of that row is then flattened into a list of keys.
> > - I then want to use that list of keys for another load function to select 
the 
> > key/value pairs from another column family.
> > 
> > The only way I can get this to work is by using a generic load function 
> > then 
> > applying filters to get at the data I want. Then joining the two pig 
> > objects 
> > together to filter the second column family.
> > 
> > I want to avoid having to pull the entire column familys into pig, it is 
> > way 
too 
> > much data.
> > 
> > Any suggestions?
> > 
> > Thanks!
> > 
> 
> 


It is a very wide row, with nested keys to another column family.  Pig makes it 
easy convert it into a list of keys.

It also makes it easy to write out the results into Hadoop.

I then want to take that list of keys to go get rows from whatever column 
family 
they are for.

Thanks for you response.




Datastructure time tracking

2011-11-17 Thread RobinUs2
We're currently developing a system with a time tracking part. We need to
store following details:
- user
- time (in minutes)
- description
- billable
- project
- task ID

What would be a proper data structure for this in Cassandra?

--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Datastructure-time-tracking-tp7005672p7005672.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.


Data Model Design for Login Servie

2011-11-17 Thread Maciej Miklas
Hallo all,

I need your help to design structure for simple login service. It contains
about 100.000.000 customers and each one can have about 10 different logins
- this results 1.000.000.000 different logins.

Each customer contains following data:
- one to many login names as string, max 20 UTF-8 characters long
- ID as long - one customer has only one ID
- gender
- birth date
- name
- password as MD5

Login process needs to find user by login name.
Data in Cassandra is replicated - this is necessary to obtain all required
login data in single call. Also usually we expect low write traffic and
heavy read traffic - round trips for reading data should be avoided.
Below I've described two possible cassandra data models based on example:
we have two users, first user has two logins and second user has three
logins

A) Skinny rows
 - row key contains login name - this is the main search criteria
 - login data is replicated - each possible login is stored as single row
which contains all user data - 10 logins for single customer create 10
rows, where each row has different key and the same content

// first 3 rows has different key and the same replicated data
alfred.tes...@xyz.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
alf...@aad.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
a...@dd.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},

// two following rows has again the same data for second customer
manf...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
},
rober...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
}

B) Rows grouped by alphabetical prefix
- Number of rows is limited - for example first letter from login name
- Each row contains all logins which benign with row key - row with key 'a'
contains all logins which begin with 'a'
- Data might be unbalanced, but we avoid skinny rows - this might have
positive performance impact (??)
- to avoid super columns each row contains directly columns, where column
name is the user login and column value is corresponding data in kind of
serialized form (I would like to have is human readable)

a {
alfred.tes...@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

alf...@aad.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

a...@dd.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa"
  },

m {
manf...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"
  },

r {
rober...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"

  }

Which solution is better, especially for better read performance? Do you
have better idea?

Thanks,
Maciej


Re: Help with Pig Script

2011-11-17 Thread Jeremy Hanna

On Nov 17, 2011, at 1:44 PM, Aaron Griffith wrote:

> Jeremy Hanna  gmail.com> writes:
> 
>> 
>> If you are only interested in loading one row, why do you need to use Pig?  
>> Is 
> it an extremely wide row?
>> 
>> Unless you are using an ordered partitioner, you can't limit the rows you 
> mapreduce over currently - you
>> have to mapreduce over the whole column family.  That will change probably 
>> in 
> 1.1.  However, again, if
>> you're only after 1 row, why don't you just use a regular cassandra client 
>> and 
> get that row and operate on it
>> that way?
>> 
>> I suppose you *could* use pig and filter by the ID or something.  If you 
>> *do* 
> have an ordered partitioner in
>> your cluster, it's just a matter of specifying the key range.
>> 
>> On Nov 17, 2011, at 11:16 AM, Aaron Griffith wrote:
>> 
>>> I am trying to do the following with a PIG script and am having trouble 
> finding 
>>> the correct syntax.
>>> 
>>> - I want to use the LOAD function to load a single key/value "row" into a 
> pig 
>>> object.
>>> - The contents of that row is then flattened into a list of keys.
>>> - I then want to use that list of keys for another load function to select 
> the 
>>> key/value pairs from another column family.
>>> 
>>> The only way I can get this to work is by using a generic load function 
>>> then 
>>> applying filters to get at the data I want. Then joining the two pig 
>>> objects 
>>> together to filter the second column family.
>>> 
>>> I want to avoid having to pull the entire column familys into pig, it is 
>>> way 
> too 
>>> much data.
>>> 
>>> Any suggestions?
>>> 
>>> Thanks!
>>> 
>> 
>> 
> 
> 
> It is a very wide row, with nested keys to another column family.  Pig makes 
> it 
> easy convert it into a list of keys.
> 
> It also makes it easy to write out the results into Hadoop.
> 
> I then want to take that list of keys to go get rows from whatever column 
> family 
> they are for.
> 
> Thanks for you response.
> 
> 

Okay.  Makes sense.  There is work being done to support wide rows with 
mapreduce - https://issues.apache.org/jira/browse/CASSANDRA-3264 which is now 
being worked on as part of transposition - 
https://issues.apache.org/jira/browse/CASSANDRA-2474.  Transposition would make 
it so each wide row would turn into several transposed rows - (key, column, 
value) combinations.

I think the easiest way to do what you're trying to do is to use a client to 
page through the row and get the whole thing, then you can copy that up to hdfs 
or whatever else you want to do with it.

RE: Data Model Design for Login Servie

2011-11-17 Thread Dan Hendry
Your first approach, skinny rows, will almost certainly be a better solution 
although it never hurts to experiment for yourself. Even for low end hardware 
(for sake of argument, EC2 m1.smalls), a few million rows is basically nothing 
(again though, I encourage you to verify for yourself). For read heavy 
workloads, skinny rows allow for more effective use of the key cache and 
possibly row cache. I advise caution when using the row cache however – I have 
never found it useful (in 0.7 and 0.8 at least) as it introduces too much 
memory pressure for generally random read workloads, benchmark against your 
specific case.

 

Dan

 

From: Maciej Miklas [mailto:mac.mik...@googlemail.com] 
Sent: November-17-11 16:08
To: user@cassandra.apache.org
Subject: Data Model Design for Login Servie

 

Hallo all,

I need your help to design structure for simple login service. It contains 
about 100.000.000 customers and each one can have about 10 different logins - 
this results 1.000.000.000 different logins.

Each customer contains following data:
- one to many login names as string, max 20 UTF-8 characters long
- ID as long - one customer has only one ID
- gender
- birth date
- name
- password as MD5

Login process needs to find user by login name.
Data in Cassandra is replicated - this is necessary to obtain all required 
login data in single call. Also usually we expect low write traffic and heavy 
read traffic - round trips for reading data should be avoided.
Below I've described two possible cassandra data models based on example: we 
have two users, first user has two logins and second user has three logins
   
A) Skinny rows
 - row key contains login name - this is the main search criteria
 - login data is replicated - each possible login is stored as single row which 
contains all user data - 10 logins for single customer create 10 rows, where 
each row has different key and the same content

// first 3 rows has different key and the same replicated data
alfred.tes...@xyz.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa  
},
alf...@aad.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa  
},
a...@dd.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa  
},

// two following rows has again the same data for second customer
manf...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda  
},
rober...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda  
}

B) Rows grouped by alphabetical prefix
- Number of rows is limited - for example first letter from login name
- Each row contains all logins which benign with row key - row with key 'a' 
contains all logins which begin with 'a'
- Data might be unbalanced, but we avoid skinny rows - this might have positive 
performance impact (??)
- to avoid super columns each row contains directly columns, where column name 
is the user login and column value is corresponding data in kind of serialized 
form (I would like to have is human readable)

a {
alfred.tes...@xyz.de:"1122;MALE;1987.11.09;
 Alfred 
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

alf...@aad.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred 
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

a...@dd.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred Tester;e72c504dc16c8fcd2fe8c74bb492affa"
  },

m {
manf...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"
  },

r {
rober...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"

  }

Which solution is better, especially for better read performance? Do you have 
better idea?

Thanks,
Maciej

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.920 / Virus Database: 271.1.1/4020 - Release Date: 11/17/11 
02:34:00



Varying number of rows coming from same query on same database

2011-11-17 Thread Maxim Potekhin

Hello,

I'm running the same query repeatedly. It's a secondary index query,
done from a Pycassa client. I see that when I iterate the "result" object,
I get slightly different number of entries when running the test serially.
There is no deletions in the database, and no writes, it's static for now.

Any comments will be appreciated.

Maxim



ParNew and caching

2011-11-17 Thread Todd Burruss
I'm using cassandra 1.0.  Been doing some testing on using cass's cache.  When 
I turn it on (using the CLI) I see ParNew jump from 3-4ms to 200-300ms.  This 
really screws with response times, which jump from ~25-30ms to 1300+ms.  I've 
increase new gen and that helps, but still this is suprising to me, especially 
since 1.0 defaults to the SerializingCacheProvider – off heap.

The interesting tid bit is that I have wide rows.  70k+ columns per row, ~50 
bytes per column value.  The cache only must be about 400 rows to catch all the 
data per node and JMX is reporting 100% cache hits.  Nodetool ring reports < 
2gb per node, my heap is 6gb and total RAM is 16gb.

Thoughts?


Re: Data Model Design for Login Servie

2011-11-17 Thread Maxim Potekhin

1122: {
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
  alias1: alfred.tes...@xyz.de 
  alias2: alf...@aad.de 
  alias3: a...@dd.de 
 }

...and you can use secondary indexes to query on anything.

Maxim


On 11/17/2011 4:08 PM, Maciej Miklas wrote:

Hallo all,

I need your help to design structure for simple login service. It 
contains about 100.000.000 customers and each one can have about 10 
different logins - this results 1.000.000.000 different logins.


Each customer contains following data:
- one to many login names as string, max 20 UTF-8 characters long
- ID as long - one customer has only one ID
- gender
- birth date
- name
- password as MD5

Login process needs to find user by login name.
Data in Cassandra is replicated - this is necessary to obtain all 
required login data in single call. Also usually we expect low write 
traffic and heavy read traffic - round trips for reading data should 
be avoided.
Below I've described two possible cassandra data models based on 
example: we have two users, first user has two logins and second user 
has three logins


A) Skinny rows
 - row key contains login name - this is the main search criteria
 - login data is replicated - each possible login is stored as single 
row which contains all user data - 10 logins for single customer 
create 10 rows, where each row has different key and the same content


// first 3 rows has different key and the same replicated data
alfred.tes...@xyz.de  {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
alf...@aad.de  {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
a...@dd.de  {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},

// two following rows has again the same data for second customer
manf...@xyz.de  {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
},
rober...@xyz.de  {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
}

B) Rows grouped by alphabetical prefix
- Number of rows is limited - for example first letter from login name
- Each row contains all logins which benign with row key - row with 
key 'a' contains all logins which begin with 'a'
- Data might be unbalanced, but we avoid skinny rows - this might have 
positive performance impact (??)
- to avoid super columns each row contains directly columns, where 
column name is the user login and column value is corresponding data 
in kind of serialized form (I would like to have is human readable)


a {
alfred.tes...@xyz.de :"1122;MALE;1987.11.09;
 Alfred 
Tester;e72c504dc16c8fcd2fe8c74bb492affa",


alf...@aad.de@xyz.de :"1122;MALE;1987.11.09;
 Alfred 
Tester;e72c504dc16c8fcd2fe8c74bb492affa",


a...@dd.de@xyz.de :"1122;MALE;1987.11.09;
 Alfred 
Tester;e72c504dc16c8fcd2fe8c74bb492affa"

  },

m {
manf...@xyz.de :"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"
  },

r {
rober...@xyz.de :"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"

  }

Which solution is better, especially for better read performance? Do 
you have better idea?


Thanks,
Maciej




Re: building a new email-like inbox service with cassandra

2011-11-17 Thread Andrey V. Panov
I'm also interesting in your project and will be glad to follow you on
twitter if I can.

On 18 November 2011 00:37, Rustam Aliyev  wrote:

>  Hi Dotan,
>
> We have already built something similar and were planning to open source
> it. It will be available under http://www.elasticinbox.com/.
>
> We haven't followed exactly IBM's paper, we believe our Cassandra model
> design is more robust. It's written in Java and provides LMTP and REST
> interfaces. ElasticInbox also stores original messages outside of the
> Cassandra, in the blob store.
>
> Let me know if you are interested, I will need some time to do cleanup.
>
> Regards,
> Rustam.
>
> On 17/11/2011 14:17, Dotan N. wrote:
>
> Hi all,
> New to cassandra, i'm about to embrak on building a scalable user inbox
> service on top of cassandra.
> I've done the preliminary googling and got some more info on bluerunner
> (IBM's project on the subject),
> and now looking for more information in this specific topic.
>
>  If anyone can point me to researches/articles that would nudge me in the
> right direction i'd be tremendously thankful!
>
>  Thanks!
>
> --
> Dotan, @jondot 
>
>


Re: A Cassandra CLI question: null vs 0 rows

2011-11-17 Thread Maxim Potekhin
Should I file a ticket? I consistently see this behavior after a mass 
delete.


On 11/17/2011 12:46 PM, Maxim Potekhin wrote:
Thanks Jonathan. I get the bellow error. Don't have a clue as to what 
it means.



null
java.lang.RuntimeException
at 
org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:310)
at 
org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)

at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)
Caused by: java.lang.RuntimeException
at 
org.apache.cassandra.cli.CliClient.executeGetWithConditions(CliClient.java:814)
at 
org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:208)

... 2 more


On 11/17/2011 12:28 PM, Jonathan Ellis wrote:

If CLI returns null it means there was an error -- run with --debug to
check the exception.

On Thu, Nov 17, 2011 at 11:20 AM, Maxim Potekhin  
wrote:

Hello everyone,

I run a query on a secondary index. For some queries, I get 0 rows 
returned.

In other cases,
I just get a string that reads "null".

What's going on?

TIA

Maxim









Re: Dropped request...

2011-11-17 Thread Jeesoo Shin
Thank you for your reply, Tomita.

So the node may have failed to response in time,
but other nodes might have completed it's request. (in QUORUM)
This helps my mind that it's not a definite failure. ;-)

However, I do not understand what you meant to check data.
Checking data of dropped request... is not easy,
since I do not know which request was dropped.
Are there some options to turn on?


Best wishes


On 11/18/11, K.Tomita  wrote:
> Hello, Jeesoo.
>
> I was investigating it exactly.
>
> It means,when RPC service does not return a status
> for a defined period of time,
> the value is incremented.
> (cassandra.yaml:rpc_timeout_in_ms)
> (default:1)
>
> Therefore,
> The Drop is assumed that,
> there is a possibility that distribution node is completed processing,
> and there is a possibility of having failed.
>
> So, I recommend checking the data on a distribution node.
>
>
> ** I hope tomorrow will be a good day **
>
>   Tomita Kazutaka
>
> mailto : tomitakazut...@intheforest.jp
> blog   : http://www.intheforest.jp/blog/
> twitter: http://twitter.com/railute
> *       
>
>
>
> 2011/11/17 Jeesoo Shin :
>> Hello.
>> I'm using cassandra 0.8.6
>> with nodetool tpstats, dropped statistics are shown.
>>
>> when drop happens... what can I do?
>> are there ways to turn on debug messages or to look into?
>>
>> thanks.
>>
>


Re: mmap I/O and shared memory

2011-11-17 Thread Tyler Hobbs
This FAQ entry and the linked document provide a pretty good explanation:
http://wiki.apache.org/cassandra/FAQ#mmap

By the way, you should almost always turn off swap.

On Thu, Nov 17, 2011 at 1:16 AM, Jaesung Lee  wrote:

>  I am running 7 nodes cassandra(v1.0.2) cluster.
> I am putting 20K rows per sec to the cluster.
> This cluster has 1 KS, 3CFs.
> Each CF has 4-5 secondary indices.
>
> After I'v run for 1 week, nodes use swap memory.
> I changed disk-access-mode to index_only or standard.
> I got strange memory results.
>
> using mmap:
> VIRT: 566g  RES: 36g  SHR:12g
> standard disk access mode
> VIRT:24.7g  RES: 24g  SHR:68m
>
>
> I allocated 24g memory for JVM heap.
>
> I have some questions about mmap.
> It is easy to analyze standard disk access mode's memory result.
>
> I know cassandra use huge virtual memory for mmap I/O and each mmaped
> addresses are mapped to indexed file not swap memory.
>
> But, I don't understand why cassandra use shared memory, if using mmap I/O.
>
> Are there some documents that explain this situation?
>
> --
> Jaesung Lee
> Sent with Sparrow 
>
>


-- 
Tyler Hobbs
DataStax 


Re: java lib used in cli to provide auto-completion

2011-11-17 Thread Tyler Hobbs
JLine.  You can see the usage here:
https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/cli/CliCompleter.java

On Thu, Nov 17, 2011 at 10:21 AM, S Ahmed  wrote:

> Hi folks,
>
> I'm curious what java lib is used to provide auto-completion in the cli?
>  Or is it all custom code?




-- 
Tyler Hobbs
DataStax 


Re: Datastructure time tracking

2011-11-17 Thread Tyler Hobbs
On Thu, Nov 17, 2011 at 2:36 PM, RobinUs2  wrote:

> We're currently developing a system with a time tracking part. We need to
> store following details:
> - user
> - time (in minutes)
> - description
> - billable
> - project
> - task ID
>
> What would be a proper data structure for this in Cassandra?


 How do you need to be able to query the data? Specific details matter.
For example, do you just need to know what happened for a specific user
during a given time period?  Or do you need to know what happened across
all users during a given time period?  All users of a given project?

These details matter because in Cassandra you tend to have one column
family per type of query that you need to be able to answer efficiently
(i.e. in real time).  Ad-hoc queries aren't efficient on large, distributed
data sets like you tend to use Cassandra for; you need to know what your
reads will look like to know how to model your data.

-- 
Tyler Hobbs
DataStax 


Re: Data Model Design for Login Servie

2011-11-17 Thread Maciej Miklas
but secondary index is limited only to repeating values like enums. In my
case I would have performance issue. right?

On 18.11.2011, at 02:08, Maxim Potekhin  wrote:

 1122: {
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
  alias1: alfred.tes...@xyz.de
  alias2: alf...@aad.de
  alias3: a...@dd.de
 }

...and you can use secondary indexes to query on anything.

Maxim


On 11/17/2011 4:08 PM, Maciej Miklas wrote:

Hallo all,

I need your help to design structure for simple login service. It contains
about 100.000.000 customers and each one can have about 10 different logins
- this results 1.000.000.000 different logins.

Each customer contains following data:
- one to many login names as string, max 20 UTF-8 characters long
- ID as long - one customer has only one ID
- gender
- birth date
- name
- password as MD5

Login process needs to find user by login name.
Data in Cassandra is replicated - this is necessary to obtain all required
login data in single call. Also usually we expect low write traffic and
heavy read traffic - round trips for reading data should be avoided.
Below I've described two possible cassandra data models based on example:
we have two users, first user has two logins and second user has three
logins

A) Skinny rows
 - row key contains login name - this is the main search criteria
 - login data is replicated - each possible login is stored as single row
which contains all user data - 10 logins for single customer create 10
rows, where each row has different key and the same content

// first 3 rows has different key and the same replicated data
alfred.tes...@xyz.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
alf...@aad.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},
a...@dd.de {
  id: 1122
  gender: MALE
  birthdate: 1987.11.09
  name: Alfred Tester
  pwd: e72c504dc16c8fcd2fe8c74bb492affa
},

// two following rows has again the same data for second customer
manf...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
},
rober...@xyz.de {
  id: 1133
  gender: MALE
  birthdate: 1997.02.01
  name: Manfredus Maximus
  pwd: e44c504ff16c8fcd2fe8c74bb492adda
}

B) Rows grouped by alphabetical prefix
- Number of rows is limited - for example first letter from login name
- Each row contains all logins which benign with row key - row with key 'a'
contains all logins which begin with 'a'
- Data might be unbalanced, but we avoid skinny rows - this might have
positive performance impact (??)
- to avoid super columns each row contains directly columns, where column
name is the user login and column value is corresponding data in kind of
serialized form (I would like to have is human readable)

a {
alfred.tes...@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

alf...@aad.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa",

a...@dd.de@xyz.de:"1122;MALE;1987.11.09;
 Alfred
Tester;e72c504dc16c8fcd2fe8c74bb492affa"
  },

m {
manf...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"
  },

r {
rober...@xyz.de:"1133;MALE;1997.02.01;
  Manfredus Maximus;e44c504ff16c8fcd2fe8c74bb492adda"

  }

Which solution is better, especially for better read performance? Do you
have better idea?

Thanks,
Maciej