Re: SSTable structure

2015-03-30 Thread Kirk True
The tricky thing with documenting the SS tables is that there are a lot
of conditionals in the structure, so it makes for twisty reading. Just
for fun, here's a terrible start I made once:

https://github.com/mustardgrain/cassandra-notes/blob/master/SSTables.md


On Mon, Mar 30, 2015, at 05:12 PM, Robert Coli wrote:
 On Mon, Mar 30, 2015 at 5:07 PM, daemeon reiydelle
 daeme...@gmail.com wrote:



 why? Then there are 2 places 2 maintain or get jira'ed for a
 discrepancy.


 If you are asserting that code is capable of documenting itself, we
 will just have to agree to disagree.

 =Rob





10,000s of column families/keyspaces

2013-07-01 Thread Kirk True
Hi all,

I know it's an old topic, but I want to see if anything's changed on the
number of column families that C* supports, either in 1.2.x or 2.x.

For a number of reasons [1], we'd like to support multi-tenancy via
separate column families. The problem is that there are around 5,000
tenants to support and each one needs a small handful of column families
each.

The last I heard C* supports 'a couple of hundred' column families before
things start to bog down.

What will it take for C* to support 50,000 column families?

I'm about to dive into the code and run some tests, but I was curious about
how to quantify the overhead of a column family. Is the reason performance?
Memory? Does the off-heap work help here?

Thanks,
Kirk

[1] The main three reasons:


   1. ability to wholesale drop data for a given tenant via drop
   keyspace/drop CFs
   2. ability to have divergent schema for each tenant (partially effected
   by DSE Solr integration)
   3. secondary indexes per tenant (given requirement #2)


Re: read request distribution

2012-11-12 Thread Kirk True
Somewhat recently the Ownership column was changed to Effective
Ownership.



Previously the formula was essentially 100/nodes. Now it's
100*replication factor/nodes. So in previous releases of Cassandra
it would be 100/12 = 8.33, now it would be closer to 25% (8.33*3
(assuming a replication factor of three)).



Kirk



On Mon, Nov 12, 2012, at 03:52 PM, Ananth Gundabattula wrote:

Hi all,

On an unrelated observation of the below readings, it looks like all
the 3 nodes own 100% of the data. This confuses me a bit. We have a 12
node cluster with RF=3 but the effective ownership is shown as 8.33 %
.

So here is my question. How is the ownership calculated : Is Replica
factor considered in the ownership calculation ? ( If yes , then 8.33 %
ownership of a cluster seems wrong to me . If not 100% ownership for a
node cluster seems wrong to me. Am I missing something in the
calculation?

Regards,
Ananth

On Fri, Nov 9, 2012 at 4:37 PM, Wei Zhu [1]wz1...@yahoo.com wrote:

Hi All,
I am doing a benchmark on a Cassandra. I have a three node cluster with
RF=3. I generated 6M rows with sequence  number from 1 to 6m, so the
rows should be evenly distributed among the three nodes disregarding
the replicates.
I am doing a benchmark with read only requests, I generate read request
for randomly generated keys from 1 to 6M. Oddly, nodetool cfstats,
reports that one node has only half the requests as the other one and
the third node sits in the middle. So the ratio is like 2:3:4. The node
with the most read requests actually has the smallest latency and the
one with the least read requests reports the largest latency. The
difference is pretty big, the fastest is almost double the slowest.
All three nodes have the exactly the same hardware and the data size on
each node are the same since the RF is three and all of them have the
complete data. I am using Hector as client and the random read request
are in millions. I can't think of a reasonable explanation.  Can
someone please shed some lights?

Thanks.
-Wei

References

1. mailto:wz1...@yahoo.com


Re: Data Modeling: Comments with Voting

2012-09-26 Thread Kirk True
Depending on your needs, you could simply duplicate the comments in two 
separate CFs with the column names including time in one and the vote in 
the other. If you allow for updates to the comments, that would pose 
some issues you'd need to solve at the app level.


On 9/26/12 4:28 PM, Drew Kutcharian wrote:

Hi Guys,

Wondering what would be the best way to model a flat (no sub comments, i.e. 
twitter) comments list with support for voting (where I can sort by create time 
or votes) in Cassandra?

To demonstrate:

Sorted by create time:
- comment 1 (5 votes)
- comment 2 (1 votes)
- comment 3 (no votes)
- comment 4 (10 votes)

Sorted by votes:
- comment 4 (10 votes)
- comment 1 (5 votes)
- comment 2 (1 votes)
- comment 3 (no votes)

It's the sorted-by-votes that I'm having a bit of a trouble with. I'm looking 
for a roll-your-own approach and prefer not to use secondary indexes and CQL 
sorting.

Thanks,

Drew





Re: Batch update efficiency with composite key

2012-07-20 Thread Kirk True
I was aware of the read-then-write pattern for counters, but not 
secondary indexes. I'll have to take a look into that.


Thanks.

On 07/20/2012 02:32 AM, aaron morton wrote:
I'm assuming the logical row is in a CQL 3 CF  with composite 
PRIMARYKEY http://www.datastax.com/dev/blog/whats-new-in-cql-3-0


It will still be a no look write. The exception being secondary 
indexes and counters which include reads in the write path.


Cheers

-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 20/07/2012, at 10:26 AM, Kirk True wrote:

In Cassandra you don't read-then-write updates, you just write the 
updates.


Sorry for being dense, but can you clarify a logical vs. physical row?

Batching is useful for reducing round trips to the server.

On 07/18/2012 06:18 AM, Leonid Ilyevsky wrote:


I have a question about efficiency of updates to a CF with composite 
key.


Let say I have 100 of logical rows to update, and they all belong to 
the same physical wide row. In my naïve understanding (correct me if 
I am wrong), in order to update a logical row, Cassandra has to 
retrieve the whole physical row, add columns to it, and put it back. 
So I put all my 100 updates in a batch and send it over. Would 
Cassandra be smart enough to recognize that they all belong to one 
physical row, retrieve it once, do all the updates and put it back 
once? Is my batch thing even relevant in this case? What happens if 
I just send updates one by one?


I want to understand why I should use batches. I don’t really care 
about one timestamp for all records, I only care about efficiency. 
So I thought, I want to at least save on the number of remote calls, 
but I also wonder what happens on Cassandra side.




This email, along with any attachments, is confidential and may be 
legally privileged or otherwise protected from disclosure. Any 
unauthorized dissemination, copying or use of the contents of this 
email is strictly prohibited and may be in violation of law. If you 
are not the intended recipient, any disclosure, copying, forwarding 
or distribution of this email is strictly prohibited and this email 
and any attachments should be deleted immediately. This email and 
any attachments do not constitute an offer to sell or a solicitation 
of an offer to purchase any interest in any investment vehicle 
sponsored by Moon Capital Management LP (“Moon Capital”). Moon 
Capital does not provide legal, accounting or tax advice. Any 
statement regarding legal, accounting or tax matters was not 
intended or written to be relied upon by any person as advice. Moon 
Capital does not waive confidentiality or privilege as a result of 
this email.








Re: Inability to drop column families

2012-07-19 Thread Kirk

What does show schema show? Is the CF showing up?

Are the data files for the CF on disk?

If you poke around with the system CFs, is there any data still present?

On 07/17/2012 02:54 PM, sj.climber wrote:

Looking for ideas on how to diagnose this issue.  I have installed v1.1.2 on
a two-node cluster (the data files loaded, incidentally, were from an
earlier v1.1.1 2-node setup).  While initially I recall being able to
create/drop column families, I am no longer able to.

Let's say I have column family MyFamily in MyKeyspace.  Using cassandra-cli,
I issue:
[default@unknown] use MyKeyspace;
Authenticated to keyspace: MyKeyspace
[default@galaxy_lookups] drop column family MyFamily;
27f5c6bc-8cf3-3671-94e6-9f905be28c35
Waiting for schema agreement...
... schemas agree across the cluster

However, the column family is still there, either way using describe from
within cassandra-cli, or through nodetool cfstats.  Moreover, there are no
errors in the Cassandra logs.

Ideas on what to try next? Thanks!



--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Inability-to-drop-column-families-tp7581297.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.




Re: Replication factor - Consistency Questions

2012-07-19 Thread Kirk True

But isn't QUORUM on a 2-node cluster still 2 nodes?

On 07/17/2012 11:50 PM, Jason Tang wrote:
Yes, for ALL, it is not good for HA, and because we meet problem when 
use QUORAM, and current solution is switch Write:QUORAM / Read:QUORAM 
when got UnavailableException exception.


2012/7/18 Jay Parashar jparas...@itscape.com 
mailto:jparas...@itscape.com


Thanks..but write ALL will fail for any downed nodes. I am
thinking of QUORAM.

*From:*Jason Tang [mailto:ares.t...@gmail.com
mailto:ares.t...@gmail.com]
*Sent:* Tuesday, July 17, 2012 8:24 PM
*To:* user@cassandra.apache.org mailto:user@cassandra.apache.org
*Subject:* Re: Replication factor - Consistency Questions

Hi

I am starting using Cassandra for not a long time, and also have
problems in consistency.

Here is some thinking.

If you have Write:Any / Read:One, it will have consistency
problem, and if you want to repair, check your schema, and check
the parameter Read repair chance: 

http://wiki.apache.org/cassandra/StorageConfiguration

And if you want to get consistency result, my suggestion is to
have Write:ALL / Read:One, since for Cassandra, write is more
faster then read.

For performance impact, you need to test your traffic, and if your
memory can not cache all your data, or your network is not fast
enough, then yes, it will impact to write one more node.

BRs

2012/7/18 Jay Parashar jparas...@itscape.com
mailto:jparas...@itscape.com

Hello all,

There is a lot of material on Replication factor and Consistency
level but I
am a little confused by what is happening on my setup. (Cassandra
1.1.2). I
would appreciate any answers.

My Setup: A cluster of 2 nodes evenly balanced. My RF =2,
Consistency Level;
Write = ANY and Read = 1

I know that my consistency is Weak but since my RF = 2, I thought
data would
be just duplicated in both the nodes but sometimes, querying does
not give
me the correct (or gives partial) results. In other times, it
gives me the
right results
Is the Read Repair going on after the first query? But as RF = 2,
data is
duplicated then why the repair?
Note: My query is done a while after the Writes so data should
have been in
both the nodes. Or is this not the case (flushing not happening etc)?

I am thinking of making the Write as 1 and Read as QUORAM so R + W
 RF (1 +
2  2) to give strong consistency. Will that affect performance a lot
(generally speaking)?

Thanks in advance
Regards

Jay






Re: Batch update efficiency with composite key

2012-07-19 Thread Kirk True

In Cassandra you don't read-then-write updates, you just write the updates.

Sorry for being dense, but can you clarify a logical vs. physical row?

Batching is useful for reducing round trips to the server.

On 07/18/2012 06:18 AM, Leonid Ilyevsky wrote:


I have a question about efficiency of updates to a CF with composite key.

Let say I have 100 of logical rows to update, and they all belong to 
the same physical wide row. In my naïve understanding (correct me if I 
am wrong), in order to update a logical row, Cassandra has to retrieve 
the whole physical row, add columns to it, and put it back. So I put 
all my 100 updates in a batch and send it over. Would Cassandra be 
smart enough to recognize that they all belong to one physical row, 
retrieve it once, do all the updates and put it back once? Is my batch 
thing even relevant in this case? What happens if I just send updates 
one by one?


I want to understand why I should use batches. I don't really care 
about one timestamp for all records, I only care about efficiency. So 
I thought, I want to at least save on the number of remote calls, but 
I also wonder what happens on Cassandra side.




This email, along with any attachments, is confidential and may be 
legally privileged or otherwise protected from disclosure. Any 
unauthorized dissemination, copying or use of the contents of this 
email is strictly prohibited and may be in violation of law. If you 
are not the intended recipient, any disclosure, copying, forwarding or 
distribution of this email is strictly prohibited and this email and 
any attachments should be deleted immediately. This email and any 
attachments do not constitute an offer to sell or a solicitation of an 
offer to purchase any interest in any investment vehicle sponsored by 
Moon Capital Management LP (Moon Capital). Moon Capital does not 
provide legal, accounting or tax advice. Any statement regarding 
legal, accounting or tax matters was not intended or written to be 
relied upon by any person as advice. Moon Capital does not waive 
confidentiality or privilege as a result of this email.




Re: Errors with Cassandra 1.0.10, 1.1.0, 1.1.1-SNAPSHOT and 1.2.0-SNAPSHOT

2012-06-02 Thread Kirk True
Permissions problems on /var for the user running Cassandra?

Sent from my iPhone

On Jun 2, 2012, at 6:56 PM, Horacio G. de Oro hgde...@gmail.com wrote:

 Hi! While using Cassandra, I've seen this log messages when running some test 
 cases (which insert lots of columns in 4 rows).
 I've tryied Cassandra 1.0.10, 1.1.0, 1.1.1-SNAPSHOT and 1.2.0-SNAPSHOT (built 
 from git). I'm using the default configuration, Oracle jdk 1.6.0_32, Ubuntu 
 12.04 and pycassa.
 
 Since I'm very new to Cassandra (I'm just starting to learn it) I don't know 
 if I'm doing something wrong, or maybe there are some bugs in the several 
 versions of Cassandra I've tested.
 
 cassandra-1.0.10
 
  - IOException: unable to mkdirs
 
 cassandra-1.1.0
 
  - IOException: Unable to create directory
 
 cassandra-1.1.1-SNAPSHOT
 
  - IOException: Unable to create directory
 
 cassandra-1.2.0-SNAPSHOT
 
  - IOException: Unable to create directory
 
  - CLibrary.java (line 191) Unable to create hard link (...) 
   command output: ln: failed to create hard link 
 `(...)/lolog_tests-Logs_by_app-ia-3-Summary.db': File exists
 
 
 
 Thanks in advance!
 Horacio
 
 
 
 system-cassandra-1.0.10.log
 
 
 ERROR [MutationStage:1] 2012-06-02 20:37:41,115 AbstractCassandraDaemon.java 
 (line 139) Fatal exception in thread Thread[MutationStage:1,5,main]
 java.io.IOError: java.io.IOException: unable to mkdirs 
 /var/lib/cassandra/data/lolog_tests/snapshots/1338680261112-Logs_by_app
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1433)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1462)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.truncate(ColumnFamilyStore.java:1657)
   at 
 org.apache.cassandra.db.TruncateVerbHandler.doVerb(TruncateVerbHandler.java:50)
 
 ERROR [MutationStage:11] 2012-06-02 20:37:55,730 AbstractCassandraDaemon.java 
 (line 139) Fatal exception in thread Thread[MutationStage:11,5,main]
 java.io.IOError: java.io.IOException: unable to mkdirs 
 /var/lib/cassandra/data/lolog_tests/snapshots/1338680275729-Logs_by_app
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1433)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1462)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.truncate(ColumnFamilyStore.java:1657)
   at 
 org.apache.cassandra.db.TruncateVerbHandler.doVerb(TruncateVerbHandler.java:50)
 
 ERROR [MutationStage:19] 2012-06-02 20:37:57,395 AbstractCassandraDaemon.java 
 (line 139) Fatal exception in thread Thread[MutationStage:19,5,main]
 java.io.IOError: java.io.IOException: unable to mkdirs 
 /var/lib/cassandra/data/lolog_tests/snapshots/1338680277394-Logs_by_app
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1433)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1462)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.truncate(ColumnFamilyStore.java:1657)
   at 
 org.apache.cassandra.db.TruncateVerbHandler.doVerb(TruncateVerbHandler.java:50)
 
 ERROR [MutationStage:20] 2012-06-02 20:41:26,666 AbstractCassandraDaemon.java 
 (line 139) Fatal exception in thread Thread[MutationStage:20,5,main]
 java.io.IOError: java.io.IOException: unable to mkdirs 
 /var/lib/cassandra/data/lolog_tests/snapshots/133868048-Logs_by_app
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1433)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1462)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.truncate(ColumnFamilyStore.java:1657)
   at 
 org.apache.cassandra.db.TruncateVerbHandler.doVerb(TruncateVerbHandler.java:50)
 
 
 system-cassandra-1.1.0.log
 
 
 ERROR [MutationStage:1] 2012-06-02 20:45:15,609 AbstractCassandraDaemon.java 
 (line 134) Exception in thread Thread[MutationStage:1,5,main]
 java.io.IOError: java.io.IOException: Unable to create directory 
 /var/lib/cassandra/data/lolog_tests/Logs_by_app/snapshots/1338680715606-Logs_by_app
   at org.apache.cassandra.db.Directories.getOrCreate(Directories.java:384)
   at 
 org.apache.cassandra.db.Directories.getSnapshotDirectory(Directories.java:186)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:1440)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:1483)
 
 
 ERROR [MutationStage:9] 2012-06-02 20:45:30,728 AbstractCassandraDaemon.java 
 (line 134) Exception in thread Thread[MutationStage:9,5,main]
 java.io.IOError: java.io.IOException: Unable to create directory 
 

Re: How do I add a custom comparator class to a cassandra cluster ?

2012-05-14 Thread Kirk True
Disclaimer: I've never tried, but I'd imagine you can drop a JAR 
containing the class(es) into the lib directory and perform a rolling 
restart of the nodes.


On 5/14/12 11:11 AM, Ertio Lew wrote:
I need to add a custom comparator to a cluster, to sort columns in a 
certain customized fashion. How do I add the class to the cluster  ? 


Re: Two Random Ports in Private port range

2012-04-20 Thread Kirk True
Are these the dynamic JMX ports?

Sent from my iPad

On Apr 19, 2012, at 8:58 AM, W F amz...@gmail.com wrote:

 Hi All,
 
 I did a web search of the archives (hope I looked in the right place) and 
 could not find a request like this.
 
 When Cassandra is running, it seems to create to random tcp listen ports.
 
 For example: 50378 and 58692, 49952, 52792.
 
 What are are these for and is there documentation regarding this?
 
 Sorry if this is already in the archive!
 
 Thanks ~A


Re: Stress test using Java-based stress utility

2011-07-22 Thread Kirk True

  
  
Have you checked the logs on the nodes to see if there are any
errors?

On 7/21/11 10:43 PM, Nilabja Banerjee wrote:
Hi All,
  
  I am following this following link " http://www.datastax.com/docs/0.7/utilities/stress_java
  " for a stress test. I am getting this notification after
  running this command 
  
  xxx.xxx.xxx.xx= my ip
  contrib/stress/bin/stress
-d xxx.xxx.xxx.xx
  Created keyspaces. Sleeping 1s
for propagation.
total,interval_op_rate,interval_key_rate,avg_latency,elapsed_time
Operation [44] retried 10 times - error inserting key
044 ((UnavailableException))

Operation [49] retried 10 times - error inserting key
049 ((UnavailableException))

Operation [7] retried 10 times - error inserting key 007
((UnavailableException))

Operation [6] retried 10 times - error inserting key 006
((UnavailableException))
  
  
  
  Any idea why I am getting these
things?
  
  
  Thank You
  
  
  
  



-- 
  Kirk True
  
  Founder, Principal Engineer
  
  
  
  
  
  Expert Engineering Firepower
  
  
  About us: 
  

  



Re: 0.8.0 thrift api?

2011-04-23 Thread Kirk Peterson
The best documentation (imo) for the Thrift API, is the cassandra.thrift
file in the 'interface' subdirectory of the releas. Because cassandra.thrift
is used to generate client bindings, it is always up to date, and usually
well commented. The wiki lags behind, but sometimes will have more details
on a specific topic.

cheers,
-kirk



On Sat, Apr 23, 2011 at 11:38 AM, Michael Fortin mi...@m410.us wrote:

 Hi,
 Were can I find the thrift api documentation for 0.8?  What's in the wiki
 is only for =7.  I'm especially inserted in the new query and counter
 api's.  That's accessible via thrift, right?

 Thanks,
 Mike




-- 
⑆gmail.com⑆necrobious⑈


Re: Embedding Cassandra in Java code w/o using ports

2011-04-03 Thread Kirk Peterson
Not sure, but I've been playing with running cassandra in the same VM as an
HTTP server for a pet project of mine, using a similar technique as the one
found in the Solandra  project. It does use ports on localhost,
but hopefully gives you an idea of embedding cassandra (no clue if its a
good idea or not yet, still playing with it myself).

cheers,
-kirk

https://github.com/tjake/Solandra

On Fri, Apr 1, 2011 at 9:07 PM, Bob Futrelle bob.futre...@gmail.com wrote:

 Connecting via CLI to local host with a port number has never been
 successful for me in Snow Leopard.  No amount of reading suggestions and
 varying the approach has worked.  So I'm going to talk to Cassandra via its
 API, from Java.

 But I noticed that in some code samples that call the API from Java, ports
 are also in play.  In using Derby in Java I've never had to designate any
 ports.  Is such a  strategy available with Cassandra?

  - Bob Futrelle
Northeastern U.




-- 
⑆gmail.com⑆necrobious⑈


unsubcribe

2011-01-27 Thread Kirk Gilmore