Re: Counter Column

2014-12-27 Thread Ajay
Thanks.

I went through some articles which mentioned that the client to pass the
timestamp for insert and update. Is that anyway we can avoid it and
Cassandra assume the current time of the server?

Thanks
Ajay
On Dec 26, 2014 10:50 PM, Eric Stevens migh...@gmail.com wrote:

 Timestamps are timezone independent.  This is a property of timestamps,
 not a property of Cassandra. A given moment is the same timestamp
 everywhere in the world.  To display this in a human readable form, you
 then need to know what timezone you're attempting to represent the
 timestamp as, this is the information necessary to convert it to local time.

 On Fri, Dec 26, 2014 at 2:05 AM, Ajay ajay.ga...@gmail.com wrote:

 Hi,

 If the nodes of Cassandra ring are in different timezone, could it affect
 the counter column as it depends on the timestamp?

 Thanks
 Ajay




Re: Counter Column

2014-12-27 Thread Phil Yang
In java,
http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
return the difference, measured in milliseconds, between the current time
and midnight, January 1, 1970 UTC. It means the timestamp which Cassandra
uses is not independent on the timezone.

2014-12-27 21:08 GMT+08:00 Ajay ajay.ga...@gmail.com:

 Thanks.

 I went through some articles which mentioned that the client to pass the
 timestamp for insert and update. Is that anyway we can avoid it and
 Cassandra assume the current time of the server?

 Thanks
 Ajay
 On Dec 26, 2014 10:50 PM, Eric Stevens migh...@gmail.com wrote:

 Timestamps are timezone independent.  This is a property of timestamps,
 not a property of Cassandra. A given moment is the same timestamp
 everywhere in the world.  To display this in a human readable form, you
 then need to know what timezone you're attempting to represent the
 timestamp as, this is the information necessary to convert it to local time.

 On Fri, Dec 26, 2014 at 2:05 AM, Ajay ajay.ga...@gmail.com wrote:

 Hi,

 If the nodes of Cassandra ring are in different timezone, could it
 affect the counter column as it depends on the timestamp?

 Thanks
 Ajay




-- 
Thanks,
Phil Yang


Re: Counter Column

2014-12-27 Thread Phil Yang
sorry for typo.. timestamp which Cassandra uses is independent on the
timezone.

Usually, it is recommended to use NTP to reduce the difference of
timestamps in each nodes

2014-12-27 21:20 GMT+08:00 Phil Yang ud1...@gmail.com:

 In java,
 http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
 return the difference, measured in milliseconds, between the current time
 and midnight, January 1, 1970 UTC. It means the timestamp which Cassandra
 uses is not independent on the timezone.

 2014-12-27 21:08 GMT+08:00 Ajay ajay.ga...@gmail.com:

 Thanks.

 I went through some articles which mentioned that the client to pass the
 timestamp for insert and update. Is that anyway we can avoid it and
 Cassandra assume the current time of the server?

 Thanks
 Ajay
 On Dec 26, 2014 10:50 PM, Eric Stevens migh...@gmail.com wrote:

 Timestamps are timezone independent.  This is a property of timestamps,
 not a property of Cassandra. A given moment is the same timestamp
 everywhere in the world.  To display this in a human readable form, you
 then need to know what timezone you're attempting to represent the
 timestamp as, this is the information necessary to convert it to local time.

 On Fri, Dec 26, 2014 at 2:05 AM, Ajay ajay.ga...@gmail.com wrote:

 Hi,

 If the nodes of Cassandra ring are in different timezone, could it
 affect the counter column as it depends on the timestamp?

 Thanks
 Ajay




 --
 Thanks,
 Phil Yang




-- 
Thanks,
Phil Yang


Re: Counter Column

2014-12-27 Thread Eric Stevens
Having the client pass the timestamp is optional, if you do not provide one
from the client, then it will use the server's timestamp.

On Sat, Dec 27, 2014, 6:25 AM Phil Yang ud1...@gmail.com wrote:

 sorry for typo.. timestamp which Cassandra uses is independent on the
 timezone.

 Usually, it is recommended to use NTP to reduce the difference of
 timestamps in each nodes

 2014-12-27 21:20 GMT+08:00 Phil Yang ud1...@gmail.com:

 In java,
 http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()
 return the difference, measured in milliseconds, between the current time
 and midnight, January 1, 1970 UTC. It means the timestamp which Cassandra
 uses is not independent on the timezone.

 2014-12-27 21:08 GMT+08:00 Ajay ajay.ga...@gmail.com:

 Thanks.

 I went through some articles which mentioned that the client to pass the
 timestamp for insert and update. Is that anyway we can avoid it and
 Cassandra assume the current time of the server?

 Thanks
 Ajay
 On Dec 26, 2014 10:50 PM, Eric Stevens migh...@gmail.com wrote:

 Timestamps are timezone independent.  This is a property of timestamps,
 not a property of Cassandra. A given moment is the same timestamp
 everywhere in the world.  To display this in a human readable form, you
 then need to know what timezone you're attempting to represent the
 timestamp as, this is the information necessary to convert it to local 
 time.

 On Fri, Dec 26, 2014 at 2:05 AM, Ajay ajay.ga...@gmail.com wrote:

 Hi,

 If the nodes of Cassandra ring are in different timezone, could it
 affect the counter column as it depends on the timestamp?

 Thanks
 Ajay




 --
 Thanks,
 Phil Yang




 --
 Thanks,
 Phil Yang




Re: Counter Column

2014-12-26 Thread Eric Stevens
Timestamps are timezone independent.  This is a property of timestamps, not
a property of Cassandra. A given moment is the same timestamp everywhere in
the world.  To display this in a human readable form, you then need to know
what timezone you're attempting to represent the timestamp as, this is the
information necessary to convert it to local time.

On Fri, Dec 26, 2014 at 2:05 AM, Ajay ajay.ga...@gmail.com wrote:

 Hi,

 If the nodes of Cassandra ring are in different timezone, could it affect
 the counter column as it depends on the timestamp?

 Thanks
 Ajay



Re: Counter column impossible to delete and re-insert

2014-11-06 Thread DuyHai Doan
Hello Clément

This is a known anti-pattern. You should never re-use a deleted counter
column otherwise there will be unpredictable result for the counter value.
Le 6 nov. 2014 08:45, Clément Fumey clement@gmail.com a écrit :

 Hi,

 I have a table with counter column . When I insert (update) a row, delete
 it and try to re-insert, it fail to re-insert the row. Here is the commands
 i use :

 CREATE TABLE test(
 testId int,
 year int,
 testCounter counter,
 PRIMARY KEY (testId, year)
 )WITH CLUSTERING ORDER BY (year DESC);

 UPDATE test SET testcounter = testcounter +5 WHERE testid = 2 AND year =
 2014;
 DELETE FROM test WHERE testid = 2 AND year = 2014;
 UPDATE test SET testcounter = testcounter +5 WHERE testid = 2 AND year =
 2014;

 The last command failed, there is no error message but the table is empty
 after it.
 Is that normal? Am I doing something wrong?

 Regards

 Clément



Re: Counter column families (pending replicate on write stage tasks)

2012-11-12 Thread Rob Coli
On Mon, Nov 12, 2012 at 3:35 PM, cem cayiro...@gmail.com wrote:
 We are currently facing a performance issue with counter column families. I
 see lots of pending ReplicateOnWriteStage tasks in tpstats. Then I disabled
 replicate_on_write. It helped a lot. I want to use like that  but I am not
 sure how to use it.

Quoting Sylvain, one of the primary authors/maintainers of the
Counters support...

https://issues.apache.org/jira/browse/CASSANDRA-3868

I don't disagree about the efficiency of the valve, but at what price?
'Bootstrapping a node will make you lose increments (you don't know
which ones, you don't know how many and this even if nothing goes
wrong)' is a pretty bad drawback. That is pretty much why that option
makes me uncomfortable: it does give you better performance, so people
may be tempted to use it. Now if it was only a matter of replicating
writes only through read-repair/repair, then ok, it's pretty dangerous
but it's rather easy to explain/understand the drawback (if you don't
lose a disk, you don't lose increments, and you'd better use CL.ALL or
have read_repair_chance to 1). But the fact that it doesn't work with
bootstrap/move makes me wonder if having the option at all is not
making a disservice to users.


IOW, don't be tempted to turn off replicate_on_write. It breaks
counters. If you are under capacity at a steady state, increase
capacity.

=Rob

-- 
=Robert Coli
AIMGTALK - rc...@palominodb.com
YAHOO - rcoli.palominob
SKYPE - rcoli_palominodb


Re: Counter column family

2012-04-18 Thread Tamar Fraenkel
My problem was the result of Hector bug, see
http://groups.google.com/group/hector-users/browse_thread/thread/8359538ed387564e

So please ignore question,
Thanks,

*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

ta...@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Tue, Apr 17, 2012 at 6:59 PM, Tamar Fraenkel ta...@tok-media.com wrote:

 Hi!
 I want to understand how incrementing of counter works.


- I have a 3 node ring,
- I use FailoverPolicy.FAIL_FAST,
- RF is 2,

 I have the following counter column family
 ColumnFamily: tk_counters
   Key Validation Class: org.apache.cassandra.db.marshal.CompositeType(
 org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.
 UUIDType)
   Default column value validator: org.apache.cassandra.db.marshal.
 CounterColumnType
   Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type
   Row cache size / save period in seconds / keys to save : 0.0/0/all
   Row Cache Provider: org.apache.cassandra.cache.
 SerializingCacheProvider
   Key cache size / save period in seconds: 0.0/14400
   GC grace seconds: 864000
   Compaction min/max thresholds: 4/32
   Read repair chance: 1.0
   Replicate on write: true
   Bloom Filter FP chance: default
   Built indexes: []
   Compaction Strategy:
 org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy

 My CL for this column family is Write=2, Read=1.

 When I increment a counter (using hector mutator), and execute returns
 without errors, what is the status of the nodes at that stage.
 Can execute return before the nodes are really updated? So that if a read
 is done immediately after the increment it will still read the previous
 values?
 Thanks,

 *Tamar Fraenkel *
 Senior Software Engineer, TOK Media

 [image: Inline image 1]

 ta...@tok-media.com
 Tel:   +972 2 6409736
 Mob:  +972 54 8356490
 Fax:   +972 2 5612956




tokLogo.png

Re: counter column family

2012-04-04 Thread aaron morton
You may have better luck with Hector specific questions on the Hector User 
Group https://groups.google.com/forum/?fromgroups#!forum/hector-users

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

On 4/04/2012, at 5:54 PM, Tamar Fraenkel wrote:

 Hi!
 So, if I am using Hector, I need to do:
 cassandraHostConfigurator.setRetryDownedHosts(false)?
 
 How will this affect my application generally?
 
 Thanks
 
 Tamar Fraenkel 
 Senior Software Engineer, TOK Media 
 
 tokLogo.png
 
 ta...@tok-media.com
 Tel:   +972 2 6409736 
 Mob:  +972 54 8356490 
 Fax:   +972 2 5612956 
 
 
 
 
 
 On Tue, Mar 27, 2012 at 4:25 PM, R. Verlangen ro...@us2.nl wrote:
 You should use a connection pool without retries to prevent a single 
 increment of +1 have a result of e.g. +3.
 
 
 2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in
 You can even define how much increment you want. But let me just warn you, as 
 far my knowledge, it has consistency issues.
 
  
 From: puneet loya [mailto:puneetl...@gmail.com] 
 Sent: Tuesday, March 27, 2012 5:59 PM
 
 
 To: user@cassandra.apache.org
 Subject: Re: counter column family
 
  
 thanxx a ton :) :)
 
  
 the counter column family works synonymous as 'auto increment' in other 
 databases rite?
 
  
 I mean we have a column of  type integer which increments with every insert.
 
  
 Am i goin the rite way??
 
  
 please reply :)
 
 On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:
 
 create column family MyCounterColumnFamily with 
 default_validation_class=CounterColumnType and key_validation_class=UTF8Type 
 and comparator=UTF8Type; 
 
  
 There you go! Keys must be utf8, as well as the column names. Of course you 
 can change those validators.
 
  
 Cheers!
 
  
 2012/3/27 puneet loya puneetl...@gmail.com
 
 Can u give an example of create column family with counter column in it. 
 
  
  
 Please reply
 
  
  
 Regards,
 
  
 Puneet Loya
 
 
 
  
 -- 
 With kind regards,
 
  
 Robin Verlangen
 
 www.robinverlangen.nl
 
  
  
 
 
 Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar 21-22. Know 
 more about our Big Data quick-start program at the event. 
 
 New Impetus webcast ‘Cloud-enabled Performance Testing vis-à-vis On-premise’ 
 available at http://bit.ly/z6zT4L. 
 
 
 NOTE: This message may contain information that is confidential, proprietary, 
 privileged or otherwise protected by law. The message is intended solely for 
 the named addressee. If received in error, please destroy and notify the 
 sender. Any use of this email is prohibited when received in error. Impetus 
 does not represent, warrant and/or guarantee, that the integrity of this 
 communication has been maintained nor that the communication is free of 
 errors, virus, interception or interference.
 
 
 
 -- 
 With kind regards,
 
 Robin Verlangen
 www.robinverlangen.nl
 
 



Re: Counter Column

2012-04-03 Thread Sylvain Lebresne
On Tue, Apr 3, 2012 at 9:11 AM, Avi-h avih...@gmail.com wrote:
 I have encountered the following piece of information regarding the use of
 ‘Counter Column’ in Cassandra: “If a write fails unexpectedly (timeout or
 loss of connection to the coordinator node) the client will not know if the
 operation has been performed. A retry can result in an over count” (- quoted
 from  http://wiki.apache.org/cassandra/Counters).

 is it still relevant?

It is (there is an open ticket to fix,
https://issues.apache.org/jira/browse/CASSANDRA-2495, but to be honest
we don't really have a good solution to fix it so far).

--
Sylvain


Re: Counter Column

2012-04-03 Thread Sylvain Lebresne
Again, it will be relevant until CASSANDRA-2495 is fixed. Until then
(then being undefined so far), it affects all version that have
counters (including 1.0.8).

--
Sylvain

On Tue, Apr 3, 2012 at 12:23 PM, Avi-h avih...@gmail.com wrote:
 this bug is for 0.8 beta 1, is it also relevant for 1.0.8?


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


Re: Counter Column

2012-04-03 Thread Alain RODRIGUEZ
Sylvain explained a lot of things about counters at Cassandra SF 2011 :
http://blip.tv/datastax/counters-in-cassandra-5497678 (video),
http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf(slides).

I think it is always important knowing how the things work.

Alain

2012/4/3 Sylvain Lebresne sylv...@datastax.com

 Again, it will be relevant until CASSANDRA-2495 is fixed. Until then
 (then being undefined so far), it affects all version that have
 counters (including 1.0.8).

 --
 Sylvain

 On Tue, Apr 3, 2012 at 12:23 PM, Avi-h avih...@gmail.com wrote:
  this bug is for 0.8 beta 1, is it also relevant for 1.0.8?
 
 
  --
  View this message in context:
 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Counter-Column-tp7432010p7432450.html
  Sent from the cassandra-u...@incubator.apache.org mailing list archive
 at Nabble.com.



RE: Counter Column

2012-04-03 Thread Jeremiah Jordan
Right, it affects every version of Cassandra from 0.8 beta 1 until the Fix 
Version, which right now is None, so it isn't fixed yet...


From: Avi-h [avih...@gmail.com]
Sent: Tuesday, April 03, 2012 5:23 AM
To: cassandra-u...@incubator.apache.org
Subject: Re: Counter Column

this bug is for 0.8 beta 1, is it also relevant for 1.0.8?


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


Re: counter column family

2012-04-03 Thread Tamar Fraenkel
Hi!
So, if I am using Hector, I need to do:
cassandraHostConfigurator.setRetryDownedHosts(false)?

How will this affect my application generally?

Thanks

*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

ta...@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Tue, Mar 27, 2012 at 4:25 PM, R. Verlangen ro...@us2.nl wrote:

 You should use a connection pool without retries to prevent a single
 increment of +1 have a result of e.g. +3.


 2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in

  You can even define how much increment you want. But let me just warn
 you, as far my knowledge, it has consistency issues.



 *From:* puneet loya [mailto:puneetl...@gmail.com]
 *Sent:* Tuesday, March 27, 2012 5:59 PM

 *To:* user@cassandra.apache.org
 *Subject:* Re: counter column family



 thanxx a ton :) :)



 the counter column family works synonymous as 'auto increment' in other
 databases rite?



 I mean we have a column of  type integer which increments with every
 insert.



 Am i goin the rite way??



 please reply :)

 On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:

 *create column family MyCounterColumnFamily with
 default_validation_class=CounterColumnType and
 key_validation_class=UTF8Type and comparator=UTF8Type;*



 There you go! Keys must be utf8, as well as the column names. Of course
 you can change those validators.



 Cheers!



 2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.





 Please reply





 Regards,



 Puneet Loya





 --
 With kind regards,



 Robin Verlangen

 www.robinverlangen.nl





 --

 Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar 21-22.
 Know more about our Big Data quick-start program at the event.

 New Impetus webcast ‘Cloud-enabled Performance Testing vis-à-vis
 On-premise’ available at http://bit.ly/z6zT4L.


 NOTE: This message may contain information that is confidential,
 proprietary, privileged or otherwise protected by law. The message is
 intended solely for the named addressee. If received in error, please
 destroy and notify the sender. Any use of this email is prohibited when
 received in error. Impetus does not represent, warrant and/or guarantee,
 that the integrity of this communication has been maintained nor that the
 communication is free of errors, virus, interception or interference.




 --
 With kind regards,

 Robin Verlangen
 www.robinverlangen.nl


tokLogo.png

Re: counter column family

2012-03-29 Thread Tyler Hobbs
On Tue, Mar 27, 2012 at 9:35 AM, puneet loya puneetl...@gmail.com wrote:

 now i want to have a field incrementing with every row insertion. how do i
 do it in cassandra??


There's nothing that will do it automatically.  You need to increment it
yourself.

-- 
Tyler Hobbs
DataStax http://datastax.com/


Re: counter column family

2012-03-27 Thread R. Verlangen
*create column family MyCounterColumnFamily with
default_validation_class=CounterColumnType and
key_validation_class=UTF8Type and comparator=UTF8Type;*

There you go! Keys must be utf8, as well as the column names. Of course you
can change those validators.

Cheers!

2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.


 Please reply


 Regards,

 Puneet Loya




-- 
With kind regards,

Robin Verlangen
www.robinverlangen.nl


Re: counter column family

2012-03-27 Thread puneet loya
thanxx a ton :) :)

the counter column family works synonymous as 'auto increment' in other
databases rite?

I mean we have a column of  type integer which increments with every insert.

Am i goin the rite way??

please reply :)

On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:

 *create column family MyCounterColumnFamily with
 default_validation_class=CounterColumnType and
 key_validation_class=UTF8Type and comparator=UTF8Type;*

 There you go! Keys must be utf8, as well as the column names. Of course
 you can change those validators.

 Cheers!


 2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.


 Please reply


 Regards,

 Puneet Loya




 --
 With kind regards,

 Robin Verlangen
 www.robinverlangen.nl




Re: counter column family

2012-03-27 Thread R. Verlangen
You should use a connection pool without retries to prevent a single
increment of +1 have a result of e.g. +3.

2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in

  You can even define how much increment you want. But let me just warn
 you, as far my knowledge, it has consistency issues.



 *From:* puneet loya [mailto:puneetl...@gmail.com]
 *Sent:* Tuesday, March 27, 2012 5:59 PM

 *To:* user@cassandra.apache.org
 *Subject:* Re: counter column family



 thanxx a ton :) :)



 the counter column family works synonymous as 'auto increment' in other
 databases rite?



 I mean we have a column of  type integer which increments with every
 insert.



 Am i goin the rite way??



 please reply :)

 On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:

 *create column family MyCounterColumnFamily with
 default_validation_class=CounterColumnType and
 key_validation_class=UTF8Type and comparator=UTF8Type;*



 There you go! Keys must be utf8, as well as the column names. Of course
 you can change those validators.



 Cheers!



 2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.





 Please reply





 Regards,



 Puneet Loya





 --
 With kind regards,



 Robin Verlangen

 www.robinverlangen.nl





 --

 Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar 21-22. Know
 more about our Big Data quick-start program at the event.

 New Impetus webcast ‘Cloud-enabled Performance Testing vis-à-vis
 On-premise’ available at http://bit.ly/z6zT4L.


 NOTE: This message may contain information that is confidential,
 proprietary, privileged or otherwise protected by law. The message is
 intended solely for the named addressee. If received in error, please
 destroy and notify the sender. Any use of this email is prohibited when
 received in error. Impetus does not represent, warrant and/or guarantee,
 that the integrity of this communication has been maintained nor that the
 communication is free of errors, virus, interception or interference.




-- 
With kind regards,

Robin Verlangen
www.robinverlangen.nl


Re: counter column family

2012-03-27 Thread puneet loya
wen i m using a counter column.. i m nt able to add columns of other type
to the column family.. is it so or it is just synactical error??

[default@CMDCv99] create column family status
... with comparator = AsciiType
... and column_metadata =
... [{
... column_name : Test,
... validation_class : IntegerType,
... index_type : 0,
... index_name : IdxName},
... {
... column_name : 'other name',
... validation_class : CounterColumnType
... }];
Cannot add a counter column (other name) in a non counter column family

On Tue, Mar 27, 2012 at 6:55 PM, R. Verlangen ro...@us2.nl wrote:

 You should use a connection pool without retries to prevent a single
 increment of +1 have a result of e.g. +3.


 2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in

  You can even define how much increment you want. But let me just warn
 you, as far my knowledge, it has consistency issues.



 *From:* puneet loya [mailto:puneetl...@gmail.com]
 *Sent:* Tuesday, March 27, 2012 5:59 PM

 *To:* user@cassandra.apache.org
 *Subject:* Re: counter column family



 thanxx a ton :) :)



 the counter column family works synonymous as 'auto increment' in other
 databases rite?



 I mean we have a column of  type integer which increments with every
 insert.



 Am i goin the rite way??



 please reply :)

 On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:

 *create column family MyCounterColumnFamily with
 default_validation_class=CounterColumnType and
 key_validation_class=UTF8Type and comparator=UTF8Type;*



 There you go! Keys must be utf8, as well as the column names. Of course
 you can change those validators.



 Cheers!



 2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.





 Please reply





 Regards,



 Puneet Loya





 --
 With kind regards,



 Robin Verlangen

 www.robinverlangen.nl





 --

 Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar 21-22.
 Know more about our Big Data quick-start program at the event.

 New Impetus webcast ‘Cloud-enabled Performance Testing vis-à-vis
 On-premise’ available at http://bit.ly/z6zT4L.


 NOTE: This message may contain information that is confidential,
 proprietary, privileged or otherwise protected by law. The message is
 intended solely for the named addressee. If received in error, please
 destroy and notify the sender. Any use of this email is prohibited when
 received in error. Impetus does not represent, warrant and/or guarantee,
 that the integrity of this communication has been maintained nor that the
 communication is free of errors, virus, interception or interference.




 --
 With kind regards,

 Robin Verlangen
 www.robinverlangen.nl




Re: counter column family

2012-03-27 Thread Dave Brosius

Counter columns are special, they must be in a column family to themselves.

On 03/27/2012 09:32 AM, puneet loya wrote:
wen i m using a counter column.. i m nt able to add columns of other 
type to the column family.. is it so or it is just synactical error??


[default@CMDCv99] create column family status
... with comparator = AsciiType
... and column_metadata =
... [{
... column_name : Test,
... validation_class : IntegerType,
... index_type : 0,
... index_name : IdxName},
... {
... column_name : 'other name',
... validation_class : CounterColumnType
... }];
Cannot add a counter column (other name) in a non counter column family

On Tue, Mar 27, 2012 at 6:55 PM, R. Verlangen ro...@us2.nl 
mailto:ro...@us2.nl wrote:


You should use a connection pool without retries to prevent a
single increment of +1 have a result of e.g. +3.


2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in
mailto:rishabh.agra...@impetus.co.in

You can even define how much increment you want. But let me
just warn you, as far my knowledge, it has consistency issues.

*From:*puneet loya [mailto:puneetl...@gmail.com
mailto:puneetl...@gmail.com]
*Sent:* Tuesday, March 27, 2012 5:59 PM


*To:* user@cassandra.apache.org mailto:user@cassandra.apache.org
*Subject:* Re: counter column family

thanxx a ton :) :)

the counter column family works synonymous as 'auto increment'
in other databases rite?

I mean we have a column of  type integer which increments with
every insert.

Am i goin the rite way??

please reply :)

On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl
mailto:ro...@us2.nl wrote:

*create column family MyCounterColumnFamily with
default_validation_class=CounterColumnType and
key_validation_class=UTF8Type and comparator=UTF8Type;*

There you go! Keys must be utf8, as well as the column names.
Of course you can change those validators.

Cheers!

2012/3/27 puneet loya puneetl...@gmail.com
mailto:puneetl...@gmail.com

Can u give an example of create column family with counter
column in it.

Please reply

Regards,

Puneet Loya



-- 
With kind regards,


Robin Verlangen

www.robinverlangen.nl http://www.robinverlangen.nl




Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar
21-22. Know more about our Big Data quick-start program at the
event.

New Impetus webcast ‘Cloud-enabled Performance Testing
vis-à-vis On-premise’ available at http://bit.ly/z6zT4L.


NOTE: This message may contain information that is
confidential, proprietary, privileged or otherwise protected
by law. The message is intended solely for the named
addressee. If received in error, please destroy and notify the
sender. Any use of this email is prohibited when received in
error. Impetus does not represent, warrant and/or guarantee,
that the integrity of this communication has been maintained
nor that the communication is free of errors, virus,
interception or interference.




-- 
With kind regards,


Robin Verlangen
www.robinverlangen.nl http://www.robinverlangen.nl






Re: counter column family

2012-03-27 Thread puneet loya
now i want to have a field incrementing with every row insertion. how do i
do it in cassandra??

On Tue, Mar 27, 2012 at 7:34 PM, Dave Brosius dbros...@mebigfatguy.comwrote:

  Counter columns are special, they must be in a column family to
 themselves.

 On 03/27/2012 09:32 AM, puneet loya wrote:

 wen i m using a counter column.. i m nt able to add columns of other type
 to the column family.. is it so or it is just synactical error??

  [default@CMDCv99] create column family status
 ... with comparator = AsciiType
 ... and column_metadata =
 ... [{
 ... column_name : Test,
 ... validation_class : IntegerType,
 ... index_type : 0,
 ... index_name : IdxName},
 ... {
 ... column_name : 'other name',
 ... validation_class : CounterColumnType
 ... }];
 Cannot add a counter column (other name) in a non counter column family

 On Tue, Mar 27, 2012 at 6:55 PM, R. Verlangen ro...@us2.nl wrote:

 You should use a connection pool without retries to prevent a single
 increment of +1 have a result of e.g. +3.


 2012/3/27 Rishabh Agrawal rishabh.agra...@impetus.co.in

  You can even define how much increment you want. But let me just warn
 you, as far my knowledge, it has consistency issues.



 *From:* puneet loya [mailto:puneetl...@gmail.com]
 *Sent:* Tuesday, March 27, 2012 5:59 PM

 *To:* user@cassandra.apache.org
 *Subject:* Re: counter column family



 thanxx a ton :) :)



 the counter column family works synonymous as 'auto increment' in other
 databases rite?



 I mean we have a column of  type integer which increments with every
 insert.



 Am i goin the rite way??



 please reply :)

 On Tue, Mar 27, 2012 at 5:50 PM, R. Verlangen ro...@us2.nl wrote:

 *create column family MyCounterColumnFamily with
 default_validation_class=CounterColumnType and
 key_validation_class=UTF8Type and comparator=UTF8Type;*



 There you go! Keys must be utf8, as well as the column names. Of course
 you can change those validators.



 Cheers!



 2012/3/27 puneet loya puneetl...@gmail.com

 Can u give an example of create column family with counter column in it.





 Please reply





 Regards,



 Puneet Loya





 --
 With kind regards,



 Robin Verlangen

 www.robinverlangen.nl





  --

 Impetus to sponsor and exhibit at Structure Data 2012, NY; Mar 21-22.
 Know more about our Big Data quick-start program at the event.

 New Impetus webcast ‘Cloud-enabled Performance Testing vis-à-vis
 On-premise’ available at http://bit.ly/z6zT4L.


 NOTE: This message may contain information that is confidential,
 proprietary, privileged or otherwise protected by law. The message is
 intended solely for the named addressee. If received in error, please
 destroy and notify the sender. Any use of this email is prohibited when
 received in error. Impetus does not represent, warrant and/or guarantee,
 that the integrity of this communication has been maintained nor that the
 communication is free of errors, virus, interception or interference.




  --
 With kind regards,

  Robin Verlangen
 www.robinverlangen.nl






Re: Counter Column Family Inconsistent Node

2011-08-16 Thread Ryan Lowe
yeah, sorry about that... pushed click before I added my comments.

I have a cluster of 5 nodes using 0.8.4 where I am using counters.  One one
of my nodes, every time I do a list command I get different results.  The
counters jump all over the place.

Any ideas?  I have run nodetool repair on all nodes.

Thanks!
Ryan

On Tue, Aug 16, 2011 at 1:18 PM, Ryan Lowe ryanjl...@gmail.com wrote:

 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)

 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=93683)
 = (counter=FILEUPLOAD, value=347)
 = (counter=MQUPLOAD, value=14961065367)
 = (counter=PAGES, value=183089568)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=23972)

 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)

 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)



Re: Counter Column Family Inconsistent Node

2011-08-16 Thread Jonathan Ellis
May be the same as https://issues.apache.org/jira/browse/CASSANDRA-3006 ?

On Tue, Aug 16, 2011 at 12:20 PM, Ryan Lowe ryanjl...@gmail.com wrote:
 yeah, sorry about that... pushed click before I added my comments.
 I have a cluster of 5 nodes using 0.8.4 where I am using counters.  One one
 of my nodes, every time I do a list command I get different results.  The
 counters jump all over the place.
 Any ideas?  I have run nodetool repair on all nodes.
 Thanks!
 Ryan

 On Tue, Aug 16, 2011 at 1:18 PM, Ryan Lowe ryanjl...@gmail.com wrote:

 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)
 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=93683)
 = (counter=FILEUPLOAD, value=347)
 = (counter=MQUPLOAD, value=14961065367)
 = (counter=PAGES, value=183089568)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=23972)
 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)
 1 Row Returned.
 [default@Race] list CounterCF;
 Using default limit of 100
 ---
 RowKey: Stats
 = (counter=APP, value=7503)
 = (counter=FILEUPLOAD, value=155)
 = (counter=MQUPLOAD, value=4726775)
 = (counter=PAGES, value=131948)
 = (counter=REST, value=3)
 = (counter=SOAP, value=44)
 = (counter=WS, value=1943)




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


Re: Counter Column Family Inconsistent Node

2011-08-16 Thread Ryan Lowe
Actually I think it was more related to our servers getting their time out
of sync... after finding this article:
http://ria101.wordpress.com/2011/02/08/cassandra-the-importance-of-system-clocks-avoiding-oom-and-how-to-escape-oom-meltdown/

I checked our servers, and sure enough, 2 of them were out of sync with each
other with more than a 2 min difference!  I reconfigured ntp and I think I
am back in business.

Thanks though!
Ryan

On Tue, Aug 16, 2011 at 2:53 PM, Jonathan Ellis jbel...@gmail.com wrote:

 May be the same as https://issues.apache.org/jira/browse/CASSANDRA-3006 ?

 On Tue, Aug 16, 2011 at 12:20 PM, Ryan Lowe ryanjl...@gmail.com wrote:
  yeah, sorry about that... pushed click before I added my comments.
  I have a cluster of 5 nodes using 0.8.4 where I am using counters.  One
 one
  of my nodes, every time I do a list command I get different results.  The
  counters jump all over the place.
  Any ideas?  I have run nodetool repair on all nodes.
  Thanks!
  Ryan
 
  On Tue, Aug 16, 2011 at 1:18 PM, Ryan Lowe ryanjl...@gmail.com wrote:
 
  [default@Race] list CounterCF;
  Using default limit of 100
  ---
  RowKey: Stats
  = (counter=APP, value=7503)
  = (counter=FILEUPLOAD, value=155)
  = (counter=MQUPLOAD, value=4726775)
  = (counter=PAGES, value=131948)
  = (counter=REST, value=3)
  = (counter=SOAP, value=44)
  = (counter=WS, value=1943)
  1 Row Returned.
  [default@Race] list CounterCF;
  Using default limit of 100
  ---
  RowKey: Stats
  = (counter=APP, value=93683)
  = (counter=FILEUPLOAD, value=347)
  = (counter=MQUPLOAD, value=14961065367)
  = (counter=PAGES, value=183089568)
  = (counter=REST, value=3)
  = (counter=SOAP, value=44)
  = (counter=WS, value=23972)
  1 Row Returned.
  [default@Race] list CounterCF;
  Using default limit of 100
  ---
  RowKey: Stats
  = (counter=APP, value=7503)
  = (counter=FILEUPLOAD, value=155)
  = (counter=MQUPLOAD, value=4726775)
  = (counter=PAGES, value=131948)
  = (counter=REST, value=3)
  = (counter=SOAP, value=44)
  = (counter=WS, value=1943)
  1 Row Returned.
  [default@Race] list CounterCF;
  Using default limit of 100
  ---
  RowKey: Stats
  = (counter=APP, value=7503)
  = (counter=FILEUPLOAD, value=155)
  = (counter=MQUPLOAD, value=4726775)
  = (counter=PAGES, value=131948)
  = (counter=REST, value=3)
  = (counter=SOAP, value=44)
  = (counter=WS, value=1943)
 



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



Re: Counter Column

2011-06-28 Thread Donal Zang

On 27/06/2011 19:19, Sylvain Lebresne wrote:

Let me make that simpler.

Don't ever use replicate_on_write=false (even if you think that it is
what you want, there is a good chance it's not).
Obviously, the default is replicate_on_write=true.
I may be wrong. But with 0.8.0, I think the default is 
replicate_on_write=false, you have to declare it explicitly.


--
Donal Zang
Computing Center, IHEP
19B YuquanLu, Shijingshan District,Beijing, 100049
zan...@ihep.ac.cn
86 010 8823 6018




Re: Counter Column

2011-06-28 Thread Sylvain Lebresne
On Tue, Jun 28, 2011 at 12:53 PM, Donal Zang zan...@ihep.ac.cn wrote:
 On 27/06/2011 19:19, Sylvain Lebresne wrote:

 Let me make that simpler.

 Don't ever use replicate_on_write=false (even if you think that it is
 what you want, there is a good chance it's not).
 Obviously, the default is replicate_on_write=true.

 I may be wrong. But with 0.8.0, I think the default is
 replicate_on_write=false, you have to declare it explicitly.

No, after having checked, you are right, the default is false and it
is a bug (literally a bug, the default is true in the code, but it
doesn't get applied correctly and it end up defaulting to false
uniquely because it is the default value of a boolean in java --
https://issues.apache.org/jira/browse/CASSANDRA-2835). That bug will
be fixed in 0.8.2.

I sincerely apologize about that, you have to explicitly set
replicate_on_write to true for now. The rest stays true.

--
Sylvain


 --
 Donal Zang
 Computing Center, IHEP
 19B YuquanLu, Shijingshan District,Beijing, 100049
 zan...@ihep.ac.cn
 86 010 8823 6018





Re: Counter Column

2011-06-27 Thread Donal Zang

On 27/06/2011 17:04, Artem Orobets wrote:


Hi!

As I know, we use counter column only with replication factor ALL, so 
is it mean that we can't read data while any replica will fail?


you can use any consistency level, using replicate_on_write=true when 
create the counter column family.


--
Donal Zang
Computing Center, IHEP
19B YuquanLu, Shijingshan District,Beijing, 100049
zan...@ihep.ac.cn
86 010 8823 6018



Re: Counter Column

2011-06-27 Thread Philippe
if i write at ALL and read at ONE,is that setting required ?
thanks
Le 27 juin 2011 17:22, Donal Zang zan...@ihep.ac.cn a écrit :
 On 27/06/2011 17:04, Artem Orobets wrote:

 Hi!

 As I know, we use counter column only with replication factor ALL, so
 is it mean that we can't read data while any replica will fail?

 you can use any consistency level, using replicate_on_write=true when
 create the counter column family.

 --
 Donal Zang
 Computing Center, IHEP
 19B YuquanLu, Shijingshan District,Beijing, 100049
 zan...@ihep.ac.cn
 86 010 8823 6018



Re: Counter Column

2011-06-27 Thread Sylvain Lebresne
Let me make that simpler.

Don't ever use replicate_on_write=false (even if you think that it is
what you want, there is a good chance it's not).
Obviously, the default is replicate_on_write=true.

--
Sylvain

On Mon, Jun 27, 2011 at 7:03 PM, Philippe watche...@gmail.com wrote:
 if i write at ALL and read at ONE,is that setting required ?
 thanks

 Le 27 juin 2011 17:22, Donal Zang zan...@ihep.ac.cn a écrit :
 On 27/06/2011 17:04, Artem Orobets wrote:

 Hi!

 As I know, we use counter column only with replication factor ALL, so
 is it mean that we can't read data while any replica will fail?

 you can use any consistency level, using replicate_on_write=true when
 create the counter column family.

 --
 Donal Zang
 Computing Center, IHEP
 19B YuquanLu, Shijingshan District,Beijing, 100049
 zan...@ihep.ac.cn
 86 010 8823 6018




Re: Counter Column in Cassandra

2011-06-13 Thread Patricio Echagüe
It's a column whose content represents a distributed counter.

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

On Mon, Jun 13, 2011 at 8:29 AM, Sijie YANG iyan...@gmail.com wrote:

 Hi, All

 I am newbie to cassandra. I have a simple question but don't find any clear
 answer by searching google:
 What's the meaning of counter column in Cassandra?

 Best





Re: Counter Column family Cassandra 0.8 PHP Support ?

2011-05-17 Thread aaron morton
I'm not a php type person, but I can help a little with thrift.

Install thrift 0.6 and then run this in the interface/ directory of the 
cassandra source...

thrift --gen php cassandra.thrift

You should end up with the interface/gen-php/ 

Hope that helps.


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

On 17 May 2011, at 11:26, bhanu choudhary wrote:

 
 I am using counters to read the counts on my website dynamically. I am 
 looking for phpcassandra client(?) that supports counters natively. I was 
 looking if any PHP developer could give me a lead in generating the PHP 
 client code required using thrift.
 
 Thanks in advance!