twitter/cassandra — Issue #138: Why I can't read my data outside ruby?
Author: adilsoncarvalho
Created: 2012-02-16 20:31:35+00:00
State: open

Hi,

After I insert a simple value into cassandra the data is only readable to another ruby client. Am I missing something to let my data avaiable to all clients (we have some java code around).

I've made some tests with the ruby cql drive, and it seems to do not have the same issue. Maybe I am forgetting something.

This is how I am inserting:

```ruby
cassandra = Cassandra.new 'Twissandra', '127.0.0.1:9160'
cassandra.insert :User, 'chave_1000', {"name_0"=>"NILDA SALENA","name_1"=>"ONEIDA CHRISTAL","name_10"=>"ODETTE ANGIE","name_11"=>"ARQUITA FELIPA","name_12"=>"ARIANA GITA","name_13"=>"AMALIA TAINA NANCI","name_14"=>"OSEPHINE LADIA","name_15"=>"LENNA LETITIA","name_16"=>"IGNACIA ARA","name_17"=>"KARMEN AYNELL FUMIKO","name_2"=>"GIA HORTENSE","name_3"=>"JONELLE VERNIA","name_4"=>"KATTIE SHAVONNE RUTHIE","name_5"=>"BARRIE GERTUDE","name_6"=>"ALBERTA ISIS","name_7"=>"ERTIE SIMA","name_8"=>"LALA HESTER PAT","name_9"=>"TANNA SUNNI","size"=>"12"}
```

If I try to get them on ruby, everything is perfect:

```ruby
require 'cassandra'
cassandra = Cassandra.new 'Twissandra', '127.0.0.1:9160'
cassandra.get :User, 'chave_1000'
# => {"name_0"=>"NILDA SALENA",
# "name_1"=>"ONEIDA CHRISTAL",
# "name_10"=>"ODETTE ANGIE",
# "name_11"=>"ARQUITA FELIPA",
# "name_12"=>"ARIANA GITA",
# "name_13"=>"AMALIA TAINA NANCI",
# "name_14"=>"OSEPHINE LADIA",
# "name_15"=>"LENNA LETITIA",
# "name_16"=>"IGNACIA ARA",
# "name_17"=>"KARMEN AYNELL FUMIKO",
# "name_2"=>"GIA HORTENSE",
# "name_3"=>"JONELLE VERNIA",
# "name_4"=>"KATTIE SHAVONNE RUTHIE",
# "name_5"=>"BARRIE GERTUDE",
# "name_6"=>"ALBERTA ISIS",
# "name_7"=>"ERTIE SIMA",
# "name_8"=>"LALA HESTER PAT",
# "name_9"=>"TANNA SUNNI",
# "size"=>"12"}
```

When I try to get data in cassandra-cli, I got those data:

```
[default@Twissandra] get User[utf8('chave_1000')];
=> (column=name_0, value=4e494c44412053414c454e41, timestamp=1329418537561572)
=> (column=name_1, value=4f4e4549444120434852495354414c, timestamp=1329418537561572)
=> (column=name_10, value=4f444554544520414e474945, timestamp=1329418537561572)
=> (column=name_11, value=415251554954412046454c495041, timestamp=1329418537561572)
=> (column=name_12, value=415249414e412047495441, timestamp=1329418526559509)
=> (column=name_13, value=414d414c4941205441494e41204e414e4349, timestamp=1329418526559509)
=> (column=name_14, value=4f53455048494e45204c41444941, timestamp=1329418526559509)
=> (column=name_15, value=4c454e4e41204c455449544941, timestamp=1329418526559509)
=> (column=name_16, value=49474e4143494120415241, timestamp=1329418526559509)
=> (column=name_17, value=4b41524d454e2041594e454c4c2046554d494b4f, timestamp=1329418526559509)
=> (column=name_2, value=47494120484f5254454e5345, timestamp=1329418537561572)
=> (column=name_3, value=4a4f4e454c4c45205645524e4941, timestamp=1329418537561572)
=> (column=name_4, value=4b415454494520534841564f4e4e4520525554484945, timestamp=1329418537561572)
=> (column=name_5, value=4241525249452047455254554445, timestamp=1329418537561572)
=> (column=name_6, value=414c42455254412049534953, timestamp=1329418537561572)
=> (column=name_7, value=45525449452053494d41, timestamp=1329418537561572)
=> (column=name_8, value=4c414c412048455354455220504154, timestamp=1329418537561572)
=> (column=name_9, value=54414e4e412053554e4e49, timestamp=1329418537561572)
=> (column=size, value=3132, timestamp=1329418537561572)
```

This is the schema I am using:

```
[default@Twissandra] show schema Twissandra;
create keyspace Twissandra
with placement_strategy = 'NetworkTopologyStrategy'
and strategy_options = {datacenter1 : 1}
and durable_writes = true;

use Twissandra;

create column family User
with column_type = 'Standard'
and comparator = 'UTF8Type'
and default_validation_class = 'BytesType'
and key_validation_class = 'BytesType'
and rows_cached = 0.0
and row_cache_save_period = 0
and row_cache_keys_to_save = 2147483647
and keys_cached = 200000.0
and key_cache_save_period = 14400
and read_repair_chance = 1.0
and gc_grace = 864000
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and row_cache_provider = 'SerializingCacheProvider'
and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
and column_metadata = [
{column_name : 'first',
validation_class : UTF8Type},
{column_name : 'last',
validation_class : UTF8Type},
{column_name : 'age',
validation_class : UTF8Type,
index_name : 'User_age_idx',
index_type : 0}];
```