cassandra

How to convert a Java Long to byte[] for Cassandra?

Lazy programmer alert. :) Cassandra stores column values as bytes (Java example). Specifying a LongType comparator compares those bytes as a long. I want the value of a long into a Cassandra-friendly byte[]. How? I poked around for awhile. I think you people can help me faster. EDIT: Both Alexander and Eli's answers agreed with t...

Unique user ID in a Pylons web application

What is the best way to create a unique user ID in Python, using UUID? ...

Cassandra: Using LongType

I'm trying to insert data into a ColumnFamily with "CompareWith" attribute "LongType". However, when trying to insert data under numerical keys, I get a thrift error. When attempting the same operation with the cassandra-cli program, I get the error "A long is exactly 8 bytes". How can I resolve this? Should I use a different comparison...

Migrating C# code from Cassandra .5 to .6

I have some some simple code derived from an example that is meant to form a quick write to the Cassandra db, then loop back and read all current entries, everything worked fine. When .6 came out, i upgraded Cassandra and thrift, which threw errors in my code (www[dot]copypastecode[dot]com/26760/) - i was able to iron out the errors by c...

How can i delete/drop entire keyspace using php: cassandra :thrift

How can i delete/drop entire keyspace using php: cassandra :thrift ...

How do I store and retrieve TimeUUIDType types with Net::Cassandra::Easy?

Doing the following: my $c = Net::Cassandra::Easy->new(server => 'localhost', port => '9160', keyspace => 'Keyspace1'); $c->connect(); my $uuid_bin = Data::UUID->new()->create_bin(); eval { $result = $c->mutate([$key], family => 'StandardByUUID1', insertions => { $uuid_bin => '123...

How do you store sets in Cassandra?

I'd like to convert this JSON to a data model in Cassandra, where each of the arrays is a set with no duplicates: var data = { "data1": { "100": [1, 2, 3], "200": [3, 4] }, "data2": { "k1", [1], "k2", [4, 5] } } I'd like to query like this: data["data1"]["100"] to retrieve the sets. Anyone know how you might m...

Expanding a Cassandra cluster with one additional node: what ports need to be open?

Assume a Cassandra cluster with hosts A and B. This cluster shall now be extended with another host C. Assume that Cis on a firewalled network were all packets are dropped by default. Which ports and protocols must be opened up between C <> A and C <> B for the new node C to function properly? ...

Complex Query on cassandra

I have heard on cassandra database engine few days ago and searching for a good documentation on it. after studying on cassandra I got cassandra is more scalable than other data engine. I also read on Amazon SimpleDB but as SimpleDB has a limitation 10GB/table and Google Datastore is slower than Amazon SimpleDB, I prefer not to use them ...

Database that consumes less disk space

I'm looking at solutions to store a massive quantity of information consuming the less possible disk space. The information structure is very simple and the queries will also be very simple. I've looked at solutions like Apache Cassandra and relations databases but couldn't find a comparison where disk usage is mentioned. Any ideas on ...

Which Cassandra API provides the highest level of abstraction?

There are a lot of Cassandra API:s available and usually the programming language preference determines the choice of API. However, if we take the programming language component out of the equation, what Cassandra API provides the highest level of abstraction? Definition of "level of abstraction" in this context: An API providing a lo...

Is there a stable Cassandra library for Erlang?

Is there a stable Cassandra library for Erlang? I can't seem to find one ...

Is there any documentation for the Cassandra Erlang interface?

I have looked everywhere, and to use Cassandra from Erlang you end up having to download (amongst others): boost thrift : and then you have generate the erlang library by hand, and then copy lib files and beams files. Once you have the whole thing working there is absolutely zero documentation anywhere. If anyone could show me some use...

How to get properties from Cassandra with get_slice in Erlang?

I am using Erlang to interface with Cassandra and I cannot get the get_slice command to return a list of all the columns of a row. I use: X = thrift_client:call( C, 'get_slice', [ "Keyspace1", K, #columnParent{column_family="KeyValue"}, #slicePredicate{}, 1 ...

Is there a simple way to generate the Erlang Thrift files for Cassandra on Windows?

It seems that these can only be generated on Unix and then copied over to Windows ...

How to translate complex sql into the equivalent Cassandra representation

Consider a table with the following table structure ... CREATE TABLE table1 ( id integer, name varchar(32), ts timestamp ); SELECT * FROM table1 WHERE id = xx and ts between '2010/04/01' and '2010/04/11' Given this query, how would you represent the given data-set using Cassandra? ...

How to use Cassandra's Map Reduce with or w/o Pig?

Can someone explain how MapReduce works with Cassandra .6? I've read through the word count example, but I don't quite follow what's happening on the Cassandra end vs. the "client" end. https://svn.apache.org/repos/asf/cassandra/trunk/contrib/word_count/ For instance, let's say I'm using Python and Pycassa, how would I load in a new ma...

Why are my Lucene Document results empty?

I'm running a simple test--trying to index something and then search for it. I index a simple document, but then when a search for a string in it, I get back what looks to be an empty document (it has no fields). Lucene seems to be doing something, because if I search for a word that's not in the document, it returns 0 results. Any reas...

cassandra thrift: append data

If I need to append data (not insert) into a particular super column, what should I do? For eg: Consider a existing record described below Kespace : test columFamily: testColum SuperColumn : testSuper column_name : email value : [email protected] Here if I want to add my phone number to the super column "testSuper". What should I...

Can I use Cassandra to store objects?

Hi, My application works like this. A database(Mysql) where there is a command. The command is an object(consists of fields many fields like ints ans strings). There is a webservice which interact with the database and get the command from the db and performs some operation. The way how I am storing the command into db is by strippin...