astyanax

MaximumRetryException when reading data off Cassandra using multiget

大兔子大兔子 提交于 2019-12-11 19:36:38
问题 I am inserting time series data with time stamp (T) as the column name in a wide column that stores 24 hours worth of data in a single row. Streaming data is written from data generator (4 instances, each with 256 threads) inserting data into multiple rows in parallel. CF2 (Wide column family): RowKey1 (T1, V1) (T2, V3) (T4, V4) ...... RowKey2 (T1, V1) (T3, V3) ..... : : I am now attempting to read this data off Cassandra using multiget. The client is written in python and uses pycassa. When

Not enough bytes to read value of component using Composite Columns with Astyanax client

前提是你 提交于 2019-12-11 09:46:46
问题 I am tyring to insert into Composite Column in Cassandra column family using Astyanax client. Below is my column family in Cassandra. create column family USER_DATA with key_validation_class = 'UTF8Type' and comparator = 'CompositeType(UTF8Type,UTF8Type,DateType)' and default_validation_class = 'UTF8Type' and gc_grace = 86400; I am expecting after insertion, it will look like this user-id column1 123 (Column1-Value Column1-SchemaName LastModifiedDate) Below is my java main code- public static

Querying columns with prefix not working using Astyanax

て烟熏妆下的殇ゞ 提交于 2019-12-11 08:35:14
问题 I have a scheme as follows: TimeStamp Device ID Device Name Device Owner Device location I have created this column family using CQL and defined the primary key as (TimeStamp,Device ID, Device Name) . Through a serializable object that has fields for DeviceID, name and a field name (which stores either Device Owner or Device Location ). I have inserted some records using Astyanax. As per my understanding, the columns for a row are created by combining Device ID , Device Name and field name as

Why won't astyanax (java) recognize my @Id annotated values in my scala case class parameter list?

喜夏-厌秋 提交于 2019-12-10 18:01:24
问题 So here's my dilemma: I have a domain model with a bunch of case classes in scala such as User and Organization . Within my data access layer (dao, repository, etc) I am using astyanax(a java library from netflix) and it's entity persister to save the object to a cassandra column family. Here is some sample code for my cassandra/astyanax-backed DAOs (yes i know I need to do something more scala-ish, but I'm still learning =)) After reading through this long-winded description, I'm basically

Astyanax Composite Column

大憨熊 提交于 2019-12-10 11:35:53
问题 I am looking for a data model look like this. In this data model i am using composite key. I know how to make a composite key. But somehow in this case i m unable to do. User_Keys_By_Last_Name = { "Engineering" : {"anderson", 1 : "ac1263", "anderson", 2 : "724f02", ... }, "Sales" : { "adams", 1 : "b32704", "alden", 1 : "1553bd", ... }, } I want to do this in Astyanax. Please suggest me how to do it. Thanks in Advance 回答1: Better you go for CQL3. http://www.datastax.com/dev/blog/whats-new-in

Cassandra CQL3 support in Astyanax

守給你的承諾、 提交于 2019-12-08 17:56:39
问题 Does Astyanax support "insert into" via prepared statement with CQL3? I use the latest Astyanax library 1.56.24 and Cassandra 1.2.1. When I try to execute a prepared statement with CQL3: keyspace.prepareQuery(conn.CF_CONTACTS) .withCql("INSERT INTO contacts (a, b) VALUES (?, ?);") .asPreparedStatement() .withStringValue("123") .withStringValue("456") .execute();; I get the following exception: Caused by: InvalidRequestException(why:Cannot execute/prepare CQL2 statement since the CQL has been

Token Aware Astyanax Connection pool connecting on nodes without distributing connections over nodes

纵饮孤独 提交于 2019-12-07 04:56:28
问题 I was using astyanax connection pool defined as this: ipSeeds = "LOAD_BALANCER_HOST:9160"; conPool.setSeeds(ipSeeds) .setDiscoveryType(NodeDiscoveryType.TOKEN_AWARE) .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE); However, my cluster have 4 nodes and I have 8 client machines connecting on it. LOAD_BALANCER_HOST forwards requests to one of my four nodes. On a client node, I have: $netstat -an | grep 9160 | awk '{print $5}' | sort |uniq -c 235 node1:9160 680 node2:9160 4 node3:9160 4

Astyanax: simple write throwing this exception: Not enough bytes to read value of component

心已入冬 提交于 2019-12-06 22:48:29
问题 I am new to astyanax and trying some sample programs and getting this error. This is a simple write and looks like am doing some thing basic wrong. Not using composite keys. Caused by: InvalidRequestException(why:Not enough bytes to read value of component 0) at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20833) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra

Astyanax Composite Column

时间秒杀一切 提交于 2019-12-06 21:00:30
I am looking for a data model look like this. In this data model i am using composite key. I know how to make a composite key. But somehow in this case i m unable to do. User_Keys_By_Last_Name = { "Engineering" : {"anderson", 1 : "ac1263", "anderson", 2 : "724f02", ... }, "Sales" : { "adams", 1 : "b32704", "alden", 1 : "1553bd", ... }, } I want to do this in Astyanax. Please suggest me how to do it. Thanks in Advance Better you go for CQL3. http://www.datastax.com/dev/blog/whats-new-in-cql-3-0 来源: https://stackoverflow.com/questions/10482493/astyanax-composite-column

Cassandra updates not working consistently

不问归期 提交于 2019-12-05 19:18:54
I run the following code on my local (mac) machine and on a remote unix server.: public void deleteValue(final String id, final String value) { log.info("Removing value " + value); final Collection<String> valuesBeforeRemoval = getValues(id); final MutationBatch m = keyspace.prepareMutationBatch(); m.withRow(VALUES_CF, id).deleteColumn(value); try { m.execute(); } catch (final ConnectionException e) { log.error("Unable to delete location " + value, e); } final Collection<String> valuesAfterRemoval = getValues(id); if (valuesAfterRemoval.size()!=(valuesBeforeRemoval.size()-1)) { log.error(