Re: cassandra python driver routing requests to one node?

2016-11-14 Thread Alex Popescu
I'm wondering if what you are seeing is
https://datastax-oss.atlassian.net/browse/PYTHON-643 (that could still be a
sign of a potential data hotspot)

On Sun, Nov 13, 2016 at 10:57 PM, Andrew Bialecki <
andrew.biale...@klaviyo.com> wrote:

> We're using the "default" TokenAwarePolicy. Our nodes are spread across
> different racks within one datacenter. I've turned on debug logging for the
> Python driver, but it doesn't look like it logs which Casandra node each
> request goes to, but maybe I haven't got the right logging set to debug.
>
> On Mon, Nov 14, 2016 at 12:39 AM, Ben Slater <ben.sla...@instaclustr.com>
> wrote:
>
>> What load balancing policies are you using in your client code (
>> https://datastax.github.io/python-driver/api/cassandra/policies.html)?
>>
>> Cheers
>> Ben
>>
>> On Mon, 14 Nov 2016 at 16:22 Andrew Bialecki <andrew.biale...@klaviyo.com>
>> wrote:
>>
>>> We have an odd situation where all of a sudden of our cluster started
>>> seeing a disproportionate number of writes go to one node. We're using the
>>> Python driver version 3.7.1. I'm not sure if this is a driver issue or
>>> possibly a network issue causing requests to get routed in an odd way. It's
>>> not absolute, there are requests going to all nodes.
>>>
>>> Tried restarting the problematic node, no luck (those are the quiet
>>> periods). Tried restarting the clients, also no luck. Checked nodetool
>>> status and ownership is even across the cluster.
>>>
>>> Curious if anyone's seen this behavior before. Seems like the next step
>>> will be to debug the client and see why it's choosing that node.
>>>
>>> [image: Inline image 1]
>>>
>>>
>>> --
>>> AB
>>>
>>
>
>
> --
> AB
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Lattest driver and netty issues...

2016-05-26 Thread Alex Popescu
Tony,

This thread will have much better chances to get answers and feedback if
posted on the Java driver mailing list:
https://groups.google.com/a/lists.datastax.com/forum/m/#!forum/java-driver-user

On Thursday, May 26, 2016, Tony Anecito <adanec...@yahoo.com> wrote:

> Okay,  think I understand the issue. Seems netty/casandra driver expect
> the javax.security.cert.X509Certificate to be readily available which it is
> for normal standalone java clients but it is not for the server side. That
> class is in the rt.jar for the jre. But since the server side does not use
> the rt.jar it is not found. Some recent change in netty or the datastax
> driver expects the class but it can not be found on the server side.
>
> I hate to use the client side rt.jar with all the javax classes but that
> is what is needed. I suspect the datastax testing did not take this into
> account? I am using cassandra driver with the Wildfly J2EE container so I
> am using the driver in that configuration not a standalone client. That by
> the way worked fine when I was testing some CQL through the driver.
>
> Regards,
> -Tony
>
>
> On Wednesday, May 25, 2016 8:56 PM, Tony Anecito <adanec...@yahoo.com
> <javascript:_e(%7B%7D,'cvml','adanec...@yahoo.com');>> wrote:
>
>
> Ok I found the additional handler file and I added but at runtime I am
> still getting the error message about the timer class not found and I
> looked in the jar and did not see that class. I was using
> netty-3.0.9.0.Final with Cassandra driver cassandra-driver-core-3.0.2.jar
> and netty-handler-4.0.33.jar.
>
> So what is the right combination to not get this timer class missing
> exception?
>
> Thanks.
>
>
> On Wednesday, May 25, 2016 8:26 PM, Tony Anecito <adanec...@yahoo.com
> <javascript:_e(%7B%7D,'cvml','adanec...@yahoo.com');>> wrote:
>
>
> Hi All,
>
> I downloaded the latest cassandra driver but when used I get an error
> about class io.netty.util.timer (netty-3.9.0.Final) not being found during
> runtime. If I get the latest netty-alll-4.0.46.Final.jar during runtime I
> get an exception about not having a java.security.cert.x509Certificate
> class.
>
> So what to do?
>
> Thanks!
>
>
>
>
>

-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

<http://cassandrasummit.org/Email_Signature>

» DataStax Enterprise - the database for cloud applications. «


Re: Production Ready/Stable DataStax Java Driver

2016-05-08 Thread Alex Popescu
On Sun, May 8, 2016 at 10:00 AM, Anuj Wadehra <anujw_2...@yahoo.co.in>
wrote:

> As 3.x driver supports all 1.2+ Cassandra versions, I would also like to
> better understand the motivation of having 2.1 releases simultaneously with
> 3.x releases of Java driver.


Hi Anuj,

Both Apache Cassandra and the DataStax drivers are evolving fast with
significant improvements across the board. While we support and provide the
latest and greatest, we do also support the users that are already in
production and allow them enough time to upgrade. Major release are
sometimes introducing breaking changes. That's unfortunate but sometimes
the only way we can push things forward.

I do agree with your assessment 1000% that if starting now, the best
version to go with is the latest on the 3.0 branch.


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

<http://cassandrasummit.org/Email_Signature>

» DataStax Enterprise - the database for cloud applications. «


Re: Production Ready/Stable DataStax Java Driver

2016-05-08 Thread Alex Popescu
Hi Anuj,

All released versions of the DataStax Java driver are production ready:

1. they all go through the complete QA cycle
2. we merge all bug fixes and improvements upstream.

Now, if you are asking which is currently the most deployed version, that's
2.1 (latest version 2.1.10.1 [1]).

If you want to be ready for future Cassandra upgrades and benefit of the
latest features of the Java driver, then
that's the 3.0 branch (latest version 3.0.1 [2]).

Last but not least, you should also consider when making the decision that
our current focus and main development
goes into the 3.x branch and that the 2.1 is in maintenance mode (meaning
that no new features will be added and it
will only see critical bug fixes).

Bottom line, if your application is not already developed against the 2.1
version of the Java driver, you should use
the latest 3.0 release.


[1]:
https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/bYQSUvKQm5k/JduPTt7cGAAJ

[2]:
https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/tOWZm4RVbm4/5E_aDAc8IAAJ


On Sun, May 8, 2016 at 7:39 AM, Anuj Wadehra <anujw_2...@yahoo.co.in> wrote:

> Hi,
>
> Which DataStax Java Driver release is most stable (production ready) for
> Cassandra 2.1?
>
> Thanks
> Anuj
>
>
>


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

<http://cassandrasummit.org/Email_Signature>

» DataStax Enterprise - the database for cloud applications. «


Re: com.datastax.driver.core.Connection "This should not happen and is likely a bug, please report."

2016-03-22 Thread Alex Popescu
Hi Thunder,

This would be better sent to the Java mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user.
A quick search revealed https://datastax-oss.atlassian.net/browse/JAVA-603
which seem to match the Cassandra/DataStax community version but not the
driver version.

On Mon, Mar 21, 2016 at 9:33 PM, Thunder Stumpges <
thunder.stump...@gmail.com> wrote:

> Hi guys,
>
> So, quick background, we are using Outworkers (previously WebSudos)
> Phantom v 1.22.0 Which appears to be using DataStax driver 3.0.0. We are
> running scala 2.10 inside Samza on Yarn (CDH 5.4.4) with Oracle JDK 8.
>
> This is all pointing at a 3 node dev cluster of DataStax Community v 2.1.13
>
> After running for a short time, the following error is thrown by the
> Datastax driver in the Samza container:
>
> Logger: com.datastax.driver.core.Connection
> Message:
> "Forcing termination of Connection[/:9042-3,
> inFlight=0, closed=true]. This should not happen and is likely a bug,
> please report."
>
> There aren't really any other logs around this time, so not sure what else
> I can provide. It said to "please report" so I guess I am. If what I have
> provided is enough information to actually file a bug report, please let me
> know and I will. Otherwise, what additional information can I collect for
> this?
>
> Thanks,
> Thunder
>
>


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Exception about too long clustering key

2016-03-09 Thread Alex Popescu
Hi Emīls,

Directing this question to the Java driver mailing list will give you
better chances to get an answer:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user

(as a side note, I haven't seen this one before)

On Wed, Mar 9, 2016 at 11:52 AM, Emīls Šolmanis <emils.solma...@gmail.com>
wrote:

> Hello,
>
> I keep getting an exception about a clustering key being too long, like
>
> com.datastax.driver.core.exceptions.InvalidQueryException: The sum of all 
> clustering columns is too long (72650 > 65535)
>   at 
> com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
>   at 
> com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
>   at 
> com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
>
>
> But the table has no clustering key. Even if I set the clustering key to a
> single column that's guaranteed to be a string around 4-5 characters, I get
> the same thing.
>
> The only result Google gave me suggested this was about the clustering key
> names, so I renamed all the fields in the schema def to 1-3 letters, to no
> avail.
>
> Does anyone know what this is about and how I can solve this?
>
> Running Cassandra 2.2.4, Datastax driver 3.0.0.
>
> Regards,
> Emils
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: DataStax .NET Driver - Converting from Row to DataRow

2016-02-24 Thread Alex Popescu
Arko,

Please send your question to the .Net driver mailing list where you'll have
better chances to get an answer:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/csharp-driver-user

thanks

On Wed, Feb 24, 2016 at 6:37 PM, Arko Provo Mukherjee <
arkoprovomukher...@gmail.com> wrote:

> Hello,
>
> I am trying to play with the Datastax .Net Driver for Cassandra.
>
> I understand that the .Fill() method is not implemented in CqlDataAdapter.
>
> Hence I was wondering if there is any elegant way to copy a Cassandra
> Row to a DataRow? I can then construct a DataSet myself.
>
> Thanks & regards
> Arko
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Schema Versioning

2016-02-10 Thread Alex Popescu
On Wed, Feb 10, 2016 at 12:05 PM, Joe Bako <jb...@gracenote.com> wrote:

> Modern RDBMS tools can compare schemas between DDL object definitions and
> live databases and generate change scripts accordingly.  Older techniques
> included maintaining a version and script table in the database, storing
> schema change scripts in a sequential fashion on disk, and iterating over
> them to apply them against the target database based on whether they had
> been run previously or not (indicated in the script table).


Using DevCenter will give you some of these features (and future versions
will add more). Just to give you a quick example, if using DevCenter to
make schema changes it will offer the options of saving the final
definition or just the set of changes applied (to an existing CQL file or a
new one).


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Java Driver Question

2016-02-02 Thread Alex Popescu
On Tue, Feb 2, 2016 at 8:12 AM, Richard L. Burton III <mrbur...@gmail.com>
wrote:

> is this behavior only related to the Java Drivers?


All DataStax drivers for Cassandra provide the node discovery feature and
are aware of the cluster topology.


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Session timeout

2016-01-29 Thread Alex Popescu
On Fri, Jan 29, 2016 at 8:17 AM, oleg yusim <olegyu...@gmail.com> wrote:

> Thanks for encouraging me, I kind of grew a bit desperate. I'm security
> person, not a Cassandra expert, and doing security assessment of Cassandra
> DB, I have to rely on community heavily. I will put together a composed
> version of all my previous queries, will title it "Security assessment
> questions" and will post it once again.


Oleg,

I'll apologize in advance if my answer will sound initially harsh. I've
been following your questions (mostly because I find them interesting), but
I've never jumped to answer any of them as I confess not knowing the
purpose of your research/report makes me caution (e.g. are you doing this
for your current employer evaluating the future use of the product? are you
doing this for an analyst company? are you planning to sell this report?
etc. etc).


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Cassandra driver class

2016-01-29 Thread Alex Popescu
I think both of those options expect a JDBC driver, while the DataStax Java
driver is not one.

As a side note, if you'd provide a more detailed description of the setup
you want to get and post it to the Java driver mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user,
chances of getting an answer will be higher.

On Fri, Jan 29, 2016 at 9:56 AM, KAMM, BILL <wk1...@att.com> wrote:

> I’m just getting started with Cassandra, and am trying to integrate it
> with JBoss.  I’m configuring the standalone-ha-full.xml file, but don’t
> know what to use for the driver class.  For example, I have this:
>
>
>
> 
>
> 
>
> com.datastax.driver.core.
>
> 
>
> 
>
>
>
> What do I replace “” with?
>
>
>
> Is “com.datastax.driver.core” even correct, or am I going down the wrong
> path?  I am using the DataStax 2.0.2 driver, with Cassandra 2.0.8.
>
>
>
> Should I be using  instead of ?
>
>
>
> Does anybody have a working example they can share?  Any help to get me
> going would be appreciated.  Thanks.
>
>
>
> Bill
>
>
>
>
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Spark Cassandra Java Connector: records missing despite consistency=ALL

2016-01-13 Thread Alex Popescu
Dennis,

You'll have better chances to get an answer on the
spark-cassandra-connector mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/spark-connector-user
or on IRC #spark-cassandra-connector

On Wed, Jan 13, 2016 at 4:17 AM, Dennis Birkholz <birkh...@pubgrade.com>
wrote:

> Hi together,
>
> we Cassandra to log event data and process it every 15 minutes with Spark.
> We are using the Cassandra Java Connector for Spark.
>
> Randomly our Spark runs produce too few output records because no data is
> returned from Cassandra for a several minutes window of input data. When
> querying the data (with cqlsh), after multiple tries, the data eventually
> becomes available.
>
> To solve the problem, we tried to use consistency=ALL when reading the
> data in Spark. We use the
> CassandraJavaUtil.javafunctions().cassandraTable() method and have set
> "spark.cassandra.input.consistency.level"="ALL" on the config when creating
> the Spark context. The problem persists but according to
> http://stackoverflow.com/a/25043599 using a consistency level of ONE on
> the write side (which we use) and ALL on the READ side should be sufficient
> for data consistency.
>
> I would really appreciate if someone could give me a hint how to fix this
> problem, thanks!
>
> Greets,
> Dennis
>
> P.s.:
> some information about our setup:
> Cassandra 2.1.12 in a two Node configuration with replication factor=2
> Spark 1.5.1
> Cassandra Java Driver 2.2.0-rc3
> Spark Cassandra Java Connector 2.10-1.5.0-M2
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: memory usage problem of Metadata.tokenMap.tokenToHost

2016-01-04 Thread Alex Popescu
There are still a couple of tickets being worked on for 2.1.10 and the
release will come afterwards. You can check the list:
https://datastax-oss.atlassian.net/browse/JAVA-989?jql=project%20%3D%20JAVA%20AND%20fixVersion%20%3D%202.1.10

On Mon, Jan 4, 2016 at 5:57 AM, joseph gao <gaojf.bok...@gmail.com> wrote:

> By the way, when would be the version 2.1.10 published?
>
> 2015-12-15 10:02 GMT+08:00 joseph gao <gaojf.bok...@gmail.com>:
>
>> That's great. Thanks, Alex!
>>
>> 2015-10-02 0:36 GMT+08:00 Alexandre Dutra <alexandre.du...@datastax.com>:
>>
>>> I confirm that the optional schema metadata feature (JAVA-828
>>> <https://datastax-oss.atlassian.net/browse/JAVA-828>) has been merged
>>> upstream and is included in driver 3.0.0-alpha3 and will as well be
>>> included in the forthcoming 2.1.8 version.
>>>
>>> On a side note, JAVA-664
>>> <https://datastax-oss.atlassian.net/browse/JAVA-664> has been open for
>>> quite a while now and aims to fix the problem you describe. It will
>>> hopefully make it into 2.1.8 as well, although I cannot guarantee that at
>>> this point.
>>>
>>> Thanks,
>>>
>>> Alexandre Dutra
>>>
>>> On Mon, Sep 28, 2015 at 7:55 PM Alex Popescu <al...@datastax.com> wrote:
>>>
>>>> Besides the others' advice that 2000+ keyspaces might be too much, the
>>>> latest Java driver (2.0.11) includes an option to disable the Metadata API
>>>> http://www.datastax.com/dev/blog/datastax-java-driver-2-0-11-released.
>>>> I'm not sure at this moment if this has been merged into 2.1 already.
>>>>
>>>> On Sun, Sep 20, 2015 at 9:22 AM, joseph gao <gaojf.bok...@gmail.com>
>>>> wrote:
>>>>
>>>>> cassandra: 2.1.7
>>>>> java driver: datastax java driver 2.1.6
>>>>>
>>>>> Here is the problem:
>>>>>My application uses 2000+ keyspaces, and will dynamically create
>>>>> keyspaces and tables. And then in java client, the
>>>>> Metadata.tokenMap.tokenToHost would use about 1g memory. so this will 
>>>>> cause
>>>>> a lot of  full gc.
>>>>>As I see, the key of the tokenToHost is keyspace, and the value is
>>>>> a tokenId_to_replicateNodes map.
>>>>>
>>>>>When I try to solve this problem, I find something not sure: all
>>>>> keyspaces have same 'tokenId_to_replicateNodes' map.
>>>>> My replication strategy of all keyspaces is : simpleStrategy and
>>>>> replicationFactor is 3
>>>>>
>>>>> So would it be possible if keyspaces use same strategy, the value
>>>>> of tokenToHost map use a same map. So it would extremely reduce the memory
>>>>> usage
>>>>>
>>>>>  thanks a lot
>>>>>
>>>>> --
>>>>> --
>>>>> Joseph Gao
>>>>> PhoneNum:15210513582
>>>>> QQ: 409343351
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Bests,
>>>>
>>>> Alex Popescu | @al3xandru
>>>> Sen. Product Manager @ DataStax
>>>>
>>>>
>>>>
>>>> <http://cassandrasummit-datastax.com/?utm_campaign=summit15_medium=summiticon_source=emailsignature>
>>>>
>>> --
>>> Alexandre Dutra
>>> Driver & Tools Engineer @ DataStax
>>>
>>
>>
>>
>> --
>> --
>> Joseph Gao
>> PhoneNum:15210513582
>> QQ: 409343351
>>
>
>
>
> --
> --
> Joseph Gao
> PhoneNum:15210513582
> QQ: 409343351
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: OpsCenter doen not work with Cassandra 3.0

2015-11-25 Thread Alex Popescu
Hi Sergey,

There were some changes of the system schema tables in the released version
of Cassandra 3.0 that are preventing tools like OpsCenter and DevCenter to
connect. We are working on releasing updated versions that are fully
compatible with C 3.0.

thanks for your understanding,

On Wed, Nov 25, 2015 at 3:45 PM, Sergey Panov <pa...@isbc.ru> wrote:

> Hello,
>
> Today we tried to setup DataStaxOpsCenter-5.2.2.2015102711-linux-x64 to
> work with Cassandra 3.0.
>
> OpsCenter logs have the following:
>
> 2015-11-26 02:17:39+0300 [] INFO: Starting factory
>  0x2521b00>
> 2015-11-26 02:17:40+0300 [] INFO: Stopping factory
>  0x2521b00>
> 2015-11-26 02:17:40+0300 [] WARN: [control connection] Error connecting to
> 172.20.30.91: Unexpected response during Connection setup:
> ProtocolError('Server pr
> otocol version (4) does not match the specified driver protocol version
> (2). Consider setting Cluster.protocol_version to 4.',)
> 2015-11-26 02:17:40+0300 [] ERROR: Control connection failed to connect,
> shutting down Cluster: ('Unable to connect to any servers',
> {u'172.20.30.91': Protocol
> Error("Unexpected response during Connection setup: ProtocolError('Server
> protocol version (4) does not match the specified driver protocol version
> (2). Consid
> er setting Cluster.protocol_version to 4.',)",)})
> 2015-11-26 02:17:40+0300 [] WARN: ProcessingError while calling
> CreateClusterConfController: Unable to connect to cluster. Error is: Unable
> to connect to any
> seed nodes, tried [u'172.20.30.91']
>
>
> How can we switch to protocol_version to 4?
> Does OpsCenter officially support the latest version of Cassandra?
> Did anybody try to setup it?
>
> Please advice. Thank you!
>
> --
>
> Sergey Panov
>
>


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Cassandra 3.0.0 connection problem

2015-11-20 Thread Alex Popescu
Hi Enrico,

As Tyler mentioned, Cassandra 3.0 introduced some major changes to the
system tables, which are critical to the way DataStax drivers work, that
prevented drivers to connect. We are addressing these changes as fast as we
can, but for the PHP driver we need to firstly update the underlying C/C++
driver and this is already being worked on. I don't have yet a time-frame
to share though, but we know how important it is to have these out as soon
as possible.

Thanks for your understanding

On Friday, November 20, 2015, Enrico Sola <sola.enrico...@gmail.com> wrote:

> I've seen now that the DataStax PHP driver (version 1.0.0, the only
> available on github) it's only partially compatible with Cassandra 2.1, I
> used it until 2.2.3, in fact in this one I can't use useful data type like
> FROZEN or TUPLE.
> On the DataStax developer blog that talk about a new beta version but
> nothing has been released yet, I don't know why PHP driver has not been
> updated with these latest Cassandra updates, I hope for a quick new release
> for 3.0.0.
> About downgrade unfortunately I forget about snapshot so I exported in
> another way and after that completely uninstalled and installed again.
> Thanks for informations!
>
> Enrico
>
>
> Il giorno 19 nov 2015, alle ore 19:10, Tyler Hobbs <ty...@datastax.com
> <javascript:_e(%7B%7D,'cvml','ty...@datastax.com');>> ha scritto:
>
>
> On Thu, Nov 19, 2015 at 1:13 AM, Enrico Sola <sola.enrico...@gmail.com
> <javascript:_e(%7B%7D,'cvml','sola.enrico...@gmail.com');>> wrote:
>
>> Hi, I'm new to Cassandra and I've recently upgraded to 3.0.0 on Ubuntu
>> Linux 14.04 LTS, through apt-get upgrade not manual installation, after the
>> update all was fine so I could access to my keyspaces using cqlsh but I
>> can't access to Cassandra using DataStax PHP Driver because I get this
>> error: "No hosts available for the control connection”.
>> The connection parameters are the same of 2.2.3 version (and was working
>> fine).
>> I don't know if is this a bug or a problem of the PHP driver but my
>> systems use Cassandra and are now offline, so it's a known issue with a
>> solution?
>>
>
> I don't think the PHP driver supports Cassandra 3.0 yet.  There were some
> changes to the system schema tables that are probably preventing it from
> connecting successfully.
>
>
>> I tried also to downgrade to 2.2.3 version but after that Cassandra
>> didn't start due to keyspace loading problem, I'm just looking for a quick
>> solution so doesn't matter if I have to downgrade to 2.2.3, so how can I do
>> the downgrade without lose my datas?
>>
>
> Downgrading major versions isn't supported, which is why we recommend that
> you take a snapshot before upgrading.  Your only real option for
> downgrading without data loss is to dump your data (using cqlsh's COPY TO
> or something similar) and then re-load it on 2.2 (using cqlsh's COPY FROM
> or something similar).
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>
>
>

-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Getting code=2200 [Invalid query] message=Invalid column name ... while executing ALTER statement

2015-11-13 Thread Alex Popescu
 print sqlAlterStatement1
>>> session.execute(sqlAlterStatement1)
>>> sqlAlterStatement1 = None
>>>
>>> print " Altered tables :: "
>>> # 
>>> count = 0
>>> for colName in colNames :
>>> count = count +1
>>> sqlUpdateGeneDetection = " UPDATE test.iau SET "+colName+" =
>>> '"+str(count)+"' WHERE sample_id = 'sample123'"
>>> session.execute(sqlUpdateGeneDetection)
>>> sqlUpdateGeneDetection = None
>>>
>>> print " Updated tables :: "
>>> session.cluster.shutdown()
>>> 
>>>
>>> #---
>>>
>>> Very rarely this code works, but most of the time it fails when it reach
>>> ALTER statement.
>>> FYI, I tried preparedstatement with binding in INSERT, UPDATE statements
>>> too.
>>>
>>> The error with output is shown here:
>>>
>>> #--
>>> created the table
>>>
>>>  Inserted main ids into the table
>>>  ALTER TABLE test.iau ADD col1 text
>>>  ALTER TABLE test.iau ADD col2 text
>>>  ALTER TABLE test.iau ADD col3 text
>>>  ALTER TABLE test.iau ADD col4 text
>>>  ALTER TABLE test.iau ADD col5 text
>>>  ALTER TABLE test.iau ADD col6 text
>>>  ALTER TABLE test.iau ADD col7 text
>>>  ALTER TABLE test.iau ADD col8 text
>>>  ALTER TABLE test.iau ADD col9 text
>>> E
>>> ==
>>>
>>> --
>>> Traceback (most recent call last):
>>>   File "UnitTests.py", line 313, in test_insert_data
>>> session.execute(sqlAlterStatement1)
>>>   File "/usr/local/lib/python2.7/site-packages/cassandra/cluster.py",
>>> line 1405, in execute
>>> result = future.result(timeout)
>>>   File "/usr/local/lib/python2.7/site-packages/cassandra/cluster.py",
>>> line 2976, in result
>>> raise self._final_exception
>>> InvalidRequest: code=2200 [Invalid query] message="Invalid column name
>>> col9 because it conflicts with an existing column"
>>>
>>> --
>>> Ran 1 test in 9.856s
>>> #--
>>>
>>> But when I checked the table using CQL col9 is not there.
>>>
>>> Is there' schema' refresh issue or is it bug in Cassandra 2.1.5?
>>>
>>> Thank you.
>>> Kind regards
>>> Rajesh R
>>>
>>>
>>>
>>>
>>> **
>>> The information contained in the EMail and any attachments is
>>> confidential and intended solely and for the attention and use of the named
>>> addressee(s). It may not be disclosed to any other person without the
>>> express authority of Public Health England, or the intended recipient, or
>>> both. If you are not the intended recipient, you must not disclose, copy,
>>> distribute or retain this message or any part of it. This footnote also
>>> confirms that this EMail has been swept for computer viruses by
>>> Symantec.Cloud, but please re-sweep any attachments before opening or
>>> saving. http://www.gov.uk/PHE
>>>
>>> ******
>>>
>>
>>
>> **
>> The information contained in the EMail and any attachments is
>> confidential and intended solely and for the attention and use of the named
>> addressee(s). It may not be disclosed to any other person without the
>> express authority of Public Health England, or the intended recipient, or
>> both. If you are not the intended recipient, you must not disclose, copy,
>> distribute or retain this message or any part of it. This footnote also
>> confirms that this EMail has been swept for computer viruses by
>> Symantec.Cloud, but please re-sweep any attachments before opening or
>> saving. http://www.gov.uk/PHE
>> **
>>
>
>
> **
> The information contained in the EMail and any attachments is confidential
> and intended solely and for the attention and use of the named
> addressee(s). It may not be disclosed to any other person without the
> express authority of Public Health England, or the intended recipient, or
> both. If you are not the intended recipient, you must not disclose, copy,
> distribute or retain this message or any part of it. This footnote also
> confirms that this EMail has been swept for computer viruses by
> Symantec.Cloud, but please re-sweep any attachments before opening or
> saving. http://www.gov.uk/PHE
> **
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: cassandra 3.0 rc1 and datastax java driver 3.0.0 alpha3

2015-10-12 Thread Alex Popescu
You'll have better chances to get an answer directly on the Java driver
mailing list:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user

thanks

On Sat, Oct 10, 2015 at 4:30 PM, Vova Shelgunov <vvs...@gmail.com> wrote:

> Hi all,
>
> I've tried to connect to the cassandra 3.0 cluster, using datastax java
> driver, but I got the following exception when I tried to craete
> MappingManager:
>
> Caused by: com.datastax.driver.core.exceptions.CodecNotFoundException:
> Codec not found for requested operation:
> [varchar <-> V]
> at
> com.datastax.driver.core.CodecRegistry.newException(CodecRegistry.java:647)
> at
> com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:499)
> at
> com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:481)
> at
> com.datastax.driver.core.CodecRegistry.maybeCreateCodec(CodecRegistry.java:554)
> at
> com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:497)
> at
> com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:481)
> at
> com.datastax.driver.core.CodecRegistry.access$400(CodecRegistry.java:143)
> at
> com.datastax.driver.core.CodecRegistry$1.load(CodecRegistry.java:295)
> at
> com.datastax.driver.core.CodecRegistry$1.load(CodecRegistry.java:293)
> at
> com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
> at
> com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
> at
> com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
> at
> com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
> at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
> at
> com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
> at
> com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
> at
> com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:457)
> at
> com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:426)
> at
> com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:89)
> at
> com.datastax.driver.core.AbstractGettableByIndexData.getMap(AbstractGettableByIndexData.java:390)
> at
> com.datastax.driver.core.AbstractGettableData.getMap(AbstractGettableData.java:26)
> at
> com.datastax.driver.core.AbstractGettableByIndexData.getMap(AbstractGettableByIndexData.java:378)
> at
> com.datastax.driver.core.AbstractGettableData.getMap(AbstractGettableData.java:26)
> at
> com.datastax.driver.core.AbstractGettableData.getMap(AbstractGettableData.java:233)
> at
> com.datastax.driver.core.KeyspaceMetadata.build(KeyspaceMetadata.java:70)
> at
> com.datastax.driver.core.SchemaParser.buildKeyspaces(SchemaParser.java:116)
> at
> com.datastax.driver.core.SchemaParser.refresh(SchemaParser.java:61)
> at
> com.datastax.driver.core.ControlConnection.refreshSchema(ControlConnection.java:328)
> at
> com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:258)
> at
> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:185)
> at
> com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)
> at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1372)
> at com.datastax.driver.core.Cluster.init(Cluster.java:160)
> at
> com.datastax.driver.core.SessionManager.initAsync(SessionManager.java:75)
> at
> com.datastax.driver.core.SessionManager.init(SessionManager.java:67)
>     at
> com.datastax.driver.mapping.MappingManager.getProtocolVersion(MappingManager.java:65)
> at
> com.datastax.driver.mapping.MappingManager.(MappingManager.java:56)
>
> Could you please say what does it mean?
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: memory usage problem of Metadata.tokenMap.tokenToHost

2015-09-28 Thread Alex Popescu
Besides the others' advice that 2000+ keyspaces might be too much, the
latest Java driver (2.0.11) includes an option to disable the Metadata API
http://www.datastax.com/dev/blog/datastax-java-driver-2-0-11-released. I'm
not sure at this moment if this has been merged into 2.1 already.

On Sun, Sep 20, 2015 at 9:22 AM, joseph gao <gaojf.bok...@gmail.com> wrote:

> cassandra: 2.1.7
> java driver: datastax java driver 2.1.6
>
> Here is the problem:
>My application uses 2000+ keyspaces, and will dynamically create
> keyspaces and tables. And then in java client, the
> Metadata.tokenMap.tokenToHost would use about 1g memory. so this will cause
> a lot of  full gc.
>As I see, the key of the tokenToHost is keyspace, and the value is a
> tokenId_to_replicateNodes map.
>
>When I try to solve this problem, I find something not sure: all
> keyspaces have same 'tokenId_to_replicateNodes' map.
> My replication strategy of all keyspaces is : simpleStrategy and
> replicationFactor is 3
>
> So would it be possible if keyspaces use same strategy, the value of
> tokenToHost map use a same map. So it would extremely reduce the memory
> usage
>
>  thanks a lot
>
> --
> ------
> Joseph Gao
> PhoneNum:15210513582
> QQ: 409343351
>



-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


<http://cassandrasummit-datastax.com/?utm_campaign=summit15_medium=summiticon_source=emailsignature>


Re: date type and SimpleDateSerializer for Cassandra-2.2.0

2015-08-21 Thread Alex Popescu
*)

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(
 *NioEventLoop.java:468*)

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(
 *NioEventLoop.java:382*)

at io.netty.channel.nio.NioEventLoop.run(*NioEventLoop.java:354*)

... 2 more



 What Am I doing wrong?



 Thank you for your help.



 Regards



 Philippe SURAY




-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


http://cassandrasummit-datastax.com/?utm_campaign=summit15utm_medium=summiticonutm_source=emailsignature


Re: Any use-case about a migration from SQL Server to Cassandra?

2015-06-23 Thread Alex Popescu
On Tue, Jun 23, 2015 at 12:13 PM, Marcos Ortiz mlor...@uci.cu wrote:

 2- They used heavily C# in a Microsoft-based environment, so I need to
 know if the .Net driver is ready to use for production


The DataStax C# driver has been used in production for quite a while by
numerous users. It is the most up-to-date, feature rich, and
tunable C# driver for Apache Cassandra and DataStax Enterprise.

Anyways, if there's anything missing we are always happy to improve it.

(as you can see from my sig, I do work for DataStax, but the above is very
true)


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: DevCenter 1.2.0 keep failing in KDE 4.14.1

2015-06-23 Thread Alex Popescu
Hi Marcos,

On Tue, Jun 23, 2015 at 12:23 PM, Marcos Ortiz mlor...@uci.cu wrote:

 MaxPermSize=256m; support was removed in 8.0


1. The MaxPermSize is just a warning.

2. This is the first time I've seen that error. Search revealed this
StackOverflow thread
http://stackoverflow.com/questions/26436009/eclipse-luna-crashes-on-new-project-in-ubuntu
which mentions a workaround.

3. Last but definitely the most important, I'd strongly encourage you to
upgrade to the latest version of DevCenter 1.3.1
http://www.datastax.com/download-ops-dev#DataStax_DevCenter

-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: [MASSMAIL]Re: DevCenter 1.2.0 keep failing in KDE 4.14.1

2015-06-23 Thread Alex Popescu
On Tue, Jun 23, 2015 at 12:58 PM, Marcos Ortiz mlor...@uci.cu wrote:

 OK, I will do it.


As a side note, DevCenter 1.3 also has supported for reaching out to us
directly [1]

http://www.datastax.com/dev/blog/devcenter-1-3-available-now-featuring-schema-wizards-and-execution-of-highlighted-statements


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Using Cassandra and Twisted (Python)

2015-06-16 Thread Alex Popescu
Jonathan,

I'm pretty sure you'll have better chances to get this answered on the
Python driver mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user

On Tue, Jun 16, 2015 at 1:01 AM, Jonathan Ballet jbal...@gfproducts.ch
wrote:

 Hi,

 I'd like to write some Python applications using Twisted to talk to a
 Cassandra cluster.

 It seems like the Datastax Python library from
 https://github.com/datastax/python-driver does support Twisted, but it's
 not exactly clear how I would use this library along with Twisted. The
 documentation for the async API is very sparse and there's no mention on
 how to plug this into Twisted event-loop.

 Does anyone have a small working example on how to use both of these?

 Thanks!

 Jonathan




-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: no file cassandra.h found

2015-06-11 Thread Alex Popescu
Please send this question to the DataStax C++ mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/cpp-driver-user

On Thu, Jun 11, 2015 at 8:57 AM, ICHIBA Sara ichi.s...@gmail.com wrote:

 hey there,

 I'm trying to compile a script which include the line  #include
 cassandra.h . the compilation is never completed and I have the error
 file/directory cassandra.h not found. Any idea how to fix this knowing that
 I have the Datastax Cassandra cpp-driver installed??

 In advance, thank you for your response,
 Sara




-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: cassandra installation

2015-06-09 Thread Alex Popescu
The JVM is the runtime platform for Cassandra. You can use any driver with
it (there's no default driver). DataStax provides quite a few open source
drivers [1] and there are also community maintained drivers [2]

[1]: https://github.com/datastax/

[2]: http://planetcassandra.org/client-drivers-tools/

On Tue, Jun 9, 2015 at 8:26 AM, ICHIBA Sara ichi.s...@gmail.com wrote:

 hey there,

 In order to install cassandra, java has to be installed first. is that
 mean that the default driver of cassandra is java? what if we wanna use the
 cpp driver?

 P.S 1: my questions might be so dump, but I will really appreciate an
 answer.
 PS 2: I'm intern and i'm completely new to cassandra so...




-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Creating 'Put' requests

2015-04-23 Thread Alex Popescu
On Thu, Apr 23, 2015 at 8:50 AM, Matthew Johnson matt.john...@algomi.com
wrote:

 Unfortunately it seems that I was misinformed on the “dynamically creating
 timeseries columns” feature, and that this WAS deprecated in CQL3 – in
 order to dynamically create columns I would have to issue an ‘ALTER TABLE’
 statement for every new column. I read one suggestions which is to use
 collections instead - so basically have a single pre-defined column which
 is a Map, say, and then add ‘timestamp : value’ into that map instead of a
 new column for every timestamp. Would you say this is an acceptable
 approach?


Depending on the data model and the queries your application will use,
you'll be using either clustering columns or collections (or a
combination). If you need help modeling, you could start a new thread with
the relevant details and I'm pretty sure you'll get some good suggestions
here.


-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Connecting to Cassandra cluster in AWS from local network

2015-04-20 Thread Alex Popescu
You'll have to configure your nodes to:

1. use AWS internal IPs for inter-node connection (check listen_address)
and
2. use the AWS public IP for client-to-node connections (check rpc_address)

Depending on the setup, there might be other interesting conf options in
cassandra.yaml (broadcast_address, listen_interface, rpc_interface).

[1]:
http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html

On Mon, Apr 20, 2015 at 9:50 AM, Jonathan Haddad j...@jonhaddad.com wrote:

 Ideally you'll be on the same network, but if you can't be, you'll need to
 use the public ip in listen_address.

 On Mon, Apr 20, 2015 at 9:47 AM Matthew Johnson matt.john...@algomi.com
 wrote:

 Hi all,



 I have set up a Cassandra cluster with 2.1.4 on some existing AWS boxes,
 just as a POC. Cassandra servers connect to each other over their internal
 AWS IP addresses (172.x.x.x) aliased in /etc/hosts as sales1, sales2 and
 sales3.



 I connect to it from my local dev environment using the seed’s external
 NAT address (54.x.x.x) aliases in my Windows hosts file as sales3 (my seed).



 When I try to connect, it connects fine, and can retrieve some data (I
 have very limited amounts of data in there, but it seems to retrieve ok),
 but I also get lots of stacktraces in my log where my dev environment is
 trying to connect to Cassandra on the internal IP (presumably the Cassandra
 seed node tells my dev env where to look):





 *INFO  2015-04-20 16:34:14,808 [CASSANDRA-CLIENT] {main} Cluster - New
 Cassandra host sales3/54.x.x.142:9042 added*

 *INFO  2015-04-20 16:34:14,808 [CASSANDRA-CLIENT] {main} Cluster - New
 Cassandra host /172.x.x.237:9042 added*

 *INFO  2015-04-20 16:34:14,808 [CASSANDRA-CLIENT] {main} Cluster - New
 Cassandra host /172.x.x.170:9042 added*

 *Connected to cluster: Test Cluster*

 *Datatacenter: datacenter1; Host: /172.x.x.170; Rack: rack1*

 *Datatacenter: datacenter1; Host: sales3/54.x.x.142; Rack: rack1*

 *Datatacenter: datacenter1; Host: /172.x.x.237; Rack: rack1*

 *DEBUG 2015-04-20 16:34:14,901 [CASSANDRA-CLIENT] {Cassandra Java Driver
 worker-0} Connection - Connection[sales3/54.x.x.142:9042-2, inFlight=0,
 closed=false] Transport initialized and ready*

 *DEBUG 2015-04-20 16:34:14,901 [CASSANDRA-CLIENT] {Cassandra Java Driver
 worker-0} Session - Added connection pool for sales3/54.x.x.142:9042*

 *DEBUG 2015-04-20 16:34:19,850 [CASSANDRA-CLIENT] {Cassandra Java Driver
 worker-1} Connection - Connection[/172.x.x.237:9042-1, inFlight=0,
 closed=false] Error connecting to /172.x.x.237:9042 (connection timed out:
 /172.x.x.237:9042)*

 *DEBUG 2015-04-20 16:34:19,850 [CASSANDRA-CLIENT] {Cassandra Java Driver
 worker-1} Connection - Defuncting connection to /172.x.x.237:9042*

 *com.datastax.driver.core.TransportException**: [/172.x.x.237:9042]
 Cannot connect*





 Does anyone have any experience with connecting to AWS clusters from dev
 machines? How have you set up your aliases to get around this issue?



 Current setup in sales3 (seed node) cassandra.yaml:



 *- seeds: sales3*

 *listen_address: sales3*

 *rpc_address: sales3*



 Current setup in other nodes (eg sales2) cassandra.yaml:



 *- seeds: sales3*

 *listen_address: sales2*

 *rpc_address: sales2*





 Thanks!

 Matt






-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax


Re: Pagination support on Java Driver Query API

2015-02-10 Thread Alex Popescu
On Tue, Feb 10, 2015 at 4:59 AM, Ajay ajay.ga...@gmail.com wrote:

 1) Java driver implicitly support Pagination in the ResultSet (using
 Iterator) which can be controlled through FetchSize. But it is limited in a
 way that we cannot skip or go previous. The FetchState is not exposed.


Cassandra doesn't support skipping so this is not really a limitation of
the driver.


-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: about insert into table with IF NOT EXISTS error

2015-02-09 Thread Alex Popescu
Tom, this question would have better chances to be answered on the Node.js
driver mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/nodejs-driver-user

On Mon, Feb 9, 2015 at 5:38 PM, tom zs68j...@gmail.com wrote:

 Hi:

   I setup one node cassandra server, and using node.js driver cql to query
 db.

   But, when insert into table with IF NOT EXISTS statement, it report
 error as below:

 :ResponseError: Cannot achieve consistency level QUORUM

 And, I try set nodejs cql query with consistency to ONE, still see that
 error.

 If I remove  IF NOT EXISTS from cql, insert passed.

  Please advice. thx.

 best regards
   Tom




-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Problems with user defined types (cql) and Datastax Java Driver

2015-02-05 Thread Alex Popescu
Andreas,

Can you please post your question to the Java driver ml
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
as you'll have better chances to get an answer there.

thanks

On Thu, Feb 5, 2015 at 9:10 AM, Andreas Finke andreas.fi...@solvians.com
wrote:

  Hi,



 I encountered the problem that in Java the Session does not create a valid
 UserType for my corresponding CQL user defined type.



 CQL_SCHEMA:



 create keyspace if not exists quotes

 WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1
 };



 CREATE TYPE IF NOT EXISTS quotes.price (

 value double,

 size bigint,

 timestamp bigint,

 delay int

 );



 JAVA



 UserType priceType =
 session.getCluster().getMetadata().getKeyspace(quotes).getUserType(price);

 Assert.assertNotNull(priceType); // true

 Assert.assertEquals(price, priceType.getTypeName()); // true

 Assert.assertEquals(4, priceType.getFieldNames().size()); //
 AssertionFailedError: expected:4 but was:0



 I am testing with Cassandra v.2.1.2 on Windows using Datastax Java Driver
 2.1.2.



 I am thankful for any suggestions.



 Regards

 Andi




-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: UDF and DevCenter

2015-01-22 Thread Alex Popescu
Thanks for the feedback Andy. I'll forward this to the DevCenter team.

Currently we have an email for sending feedback our way:
devcenter-feedb...@datastax.com. And the good news is that in the next
release there will be an integrated feedback form directly in DevCenter.

On Thu, Jan 22, 2015 at 8:15 AM, Andrew Cobley (Staff) 
a.e.cob...@dundee.ac.uk wrote:


 I’m not sure where to send “faults” for the DataStax Devcenter so I’ll
 send them here.  If I define a UDT such as:

  CREATE TYPE if not exists sensorsync.SensorReading (

 fValue float,
 sValue text,
 iValue  int
 );

  and a table

  Create table if not exists sensorsync.Sensors(
 name uuid,
 insertion_time timestamp,
 reading map text,frozenSensorReading,
 Primary Key (name,insertion_time)
 )

  If I now want to insert data  but not use all the fields in the UDT
 DevCenter flags it as a fault.  So:

   insert into sensorsync.Sensors (name,insertion_time,reading) values (
 7500e917-04b0-4697-ae7e-dbcdbf7415cb,'2015-01-01 02:10:05',{'sensor':{
 iValue:101},'sensor1':{fValue:30.5}});

  Works ok (rund in devcenter and cqlsh)  but dev centre flags the missing
 values with an error.  Minor, but may throw people a curve.

  Andy



 The University of Dundee is a registered Scottish Charity, No: SC015096




-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Datastax Cassandra Java Driver executeAsynch question.

2015-01-12 Thread Alex Popescu
Hi Bogdan,

This question would be better on the specific driver's mailing list.
Assuming you are using the Java driver the mailing list is [1]. As for your
question look into PoolingOptions [2] that you pass when configuring the
Cluster instance.

[1]:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user

[2]:
http://www.datastax.com/drivers/java/2.1/com/datastax/driver/core/PoolingOptions.html

On Mon, Jan 12, 2015 at 9:58 AM, Batranut Bogdan batra...@yahoo.com wrote:

 Hello all,


 In my implementation of the FutureCallBack interface in the onSuccess
 method, I put Thread.currentThread.getName(). What I saw was that there is
 a ThreadPool... That is all fine, but seems to me that the pool does not
 have that many threads. About 10 from my observations - I did not bother to
 get the exact number. Why? Well because when I query cassandra I have a
 list of about 6000 cf keys. I traverse the list and executeAsynch a
 prepared statement for each of these. I have seen that during the execution
 the driver is waiting for free threads to continue if all the threads in
 the pool are waiting for response from C*.

 How can I increase the number of threads that the driver uses to query
 Cassandra?





-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Programmatic Cassandra version detection/extraction

2014-11-13 Thread Alex Popescu
On Wed, Nov 12, 2014 at 2:44 PM, Otis Gospodnetic 
otis.gospodne...@gmail.com wrote:

 Hi,

 Is there a way to detect which version of Cassandra one is running?
 Is there an API for that, or a constant with this value, or maybe an MBean
 or some other way to get to this info?

 Here's the use case:
 SPM monitors Cassandra http://sematext.com/spm/, but Cassandra MBeans
 and metrics have or may change over time.
 How will SPM agent know which MBeans to look for, which metrics to
 extract, and how to interpret values it extracts without knowing which
 version of Cassandra it's monitoring?
 It could try probing for some known MBeans and deduce Cassandra version
 from that, but that feels a little sloppy.
 Ideally, we'd be able to grab the version from some MBean and based on
 that extract metrics we know are exposed in that version of Cassandra.

 Thanks,
 Otis


If you are using the Java driver, you can retrieve the version of Cassandra
for each Host:

http://www.datastax.com/drivers/java/2.1/com/datastax/driver/core/Host.html#getCassandraVersion()


 --
 Monitoring * Alerting * Anomaly Detection * Centralized Log Management
 Solr  Elasticsearch Support * http://sematext.com/




-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Working with legacy data via CQL

2014-11-11 Thread Alex Popescu
On Tuesday, November 11, 2014, Erik Forsberg forsb...@opera.com wrote:

 Hi!

 I have some data in a table created using thrift. In cassandra-cli, the
 'show schema' output for this table is:


 Now, when I try to extract data from this using cqlsh or the
 python-driver, I have no problems getting data for the columns which are
 actually UTF8,but for those where column_metadata have been set to
 something else, there's trouble. Example using the python driver:


 For sure this is an ugly table, but I have data in it, and I would like
 to avoid having to rewrite all my tools at once, so if I could support
 it from CQL that would be great.

 Regards,
 \EF


You'll have better chances to get an answer about the Python driver on its
own mailing list
https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user


-- 

[:-a)

Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: DevCenter and Cassandra 2.1

2014-09-26 Thread Alex Popescu
Hi Andrew,

DevCenter has a complete CQL parser inside which helps with the offline
validations and suggestions. So the bad news is that it requires a new
version for every CQL grammar change.
The good news is that this wait is not going to be too long (I cannot talk
yet about a specific release date, but it's getting there).

On Fri, Sep 26, 2014 at 2:13 AM, Andrew Cobley a.e.cob...@dundee.ac.uk
wrote:

 Hi all,

 I notice that descanter 1.1.1doesn’t support User defined types (as far as
 I can see).  Is it just a matter of importing a template or will we need to
 wait for full 2.1 support in descanter ?

 Andy


 The University of Dundee is a registered Scottish Charity, No: SC015096




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Named Parameters in Prepared Statement

2014-09-22 Thread Alex Popescu
Yes, you can bind parameters by name:

```
INSERT INTO songs (id, title, album, artist) VALUES (:id, :title, :album,
:artist)
```

All DataStax drivers for Cassandra support this feature. In Java it looks
like

// prepare only once
PreparedStatememt pstmt = session.prepare(INSERT INTO songs (id, title,
album, artist) VALUES (:id, :title, :album, :artist))

// later
BoundStatement stmt = new BoundStatement(pstmt);
stmt.setLong(id, 1234);
stmt.setString(title, Example title);

On Mon, Sep 22, 2014 at 4:41 AM, Timmy Turner timm.t...@gmail.com wrote:

 Looking through the CQL 3.1 grammar in Cassandra, I found a ':' ident
 alternative in the value rule (line 961).

 Is this for binding named parameters in prepared statements? Is this
 currently supported by any of the drivers or in Cassandra (2.1) itself?

 Looking at the docs and the current Java driver it doesn't seem that way.




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: [RELEASE] Apache Cassandra 2.1.0

2014-09-17 Thread Alex Popescu
Apologies for the late reply: the 2.1.x version of the C#, Java and Python
DataStax drivers support the new Cassandra 2.1 version.

Here's the quick list of links:

C#:

Latest version: 2.1.2
Nuget: https://www.nuget.org/packages/CassandraCSharpDriver/

Java:

Latest version: 2.1.1
Maven: http://maven-repository.com/artifact/com.datastax.cassandra
Binary distro: http://www.datastax.com/download#dl-datastax-drivers

Python:

Latest version: 2.1.1
PyPi: https://pypi.python.org/pypi/cassandra-driver


On Thu, Sep 11, 2014 at 10:58 AM, Tony Anecito adanec...@yahoo.com wrote:

 Ok is it part of the release or needs to be downloaded from Datastax
 somewhere. I am wondering about the java driver.

 Thanks!
 -Tony


   On Thursday, September 11, 2014 9:47 AM, abhinav chowdary 
 abhinav.chowd...@gmail.com wrote:


 Yes its was released java driver 2.1
 On Sep 11, 2014 8:33 AM, Tony Anecito adanec...@yahoo.com wrote:

 Congrads team I know you worked hard on it!!

 One question. Where can users get a java Datastax driver to support this
 version? If so is it released?

 Best Regards,
 -Tony Anecito
 Founder/President
 MyUniPortal LLC
 http://www.myuniportal.com


   On Thursday, September 11, 2014 9:05 AM, Sylvain Lebresne 
 sylv...@datastax.com wrote:


 The Cassandra team is pleased to announce the release of the final version
 of Apache Cassandra 2.1.0.

 Cassandra 2.1.0 brings a number of new features and improvements including
 (but
 not limited to):
  - Improved support of Windows.
  - A new incremental repair option[4, 5]
  - A better row cache that can cache only the head of partitions[6]
  - Off-heap memtables[7]
  - Numerous performance improvements[8, 9]
  - CQL improvements and additions: User-defined types, tuple types, 2ndary
indexing of collections, ...[10]
  - An improved stress tool[11]

 Please refer to the release notes[1] and changelog[2] for details.

 Both source and binary distributions of Cassandra 2.1.0 can be downloaded
 at:

  http://cassandra.apache.org/download/

 As usual, a debian package is available from the project APT repository[3]
 (you will need to use the 21x series).

 The Cassandra team

 [1]: http://goo.gl/k4eM39 (CHANGES.txt)
 [2]: http://goo.gl/npCsro (NEWS.txt)
 [3]: http://wiki.apache.org/cassandra/DebianPackaging
 [4]: http://goo.gl/MjohJp
 [5]: http://goo.gl/f8jSme
 [6]: http://goo.gl/6TJPH6
 [7]: http://goo.gl/YT7znJ
 [8]: http://goo.gl/Rg3tdA
 [9]: http://goo.gl/JfDBGW
 [10]: http://goo.gl/kQl7GW
 [11]: http://goo.gl/OTNqiQ








-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Cassandra connectors

2014-07-11 Thread Alex Popescu
On Fri, Jul 11, 2014 at 4:23 AM, Lohith Samaga lohithsam...@gmail.com
wrote:

 Questions:
 1. Do we have any jdbc driver for Cassandra 2.x series? If no, are tehre
 any plans to build one?


There's no JDBC driver for C* 2.x, though we might create a wrapper over
the Java driver at some point. It should be noted
that due to the richer data types in C* there will be limitations with such
a JDBC driver.


  2. Do we have a RESTful interface for Cassandra?


Accessing C* is done over the CQL protocol. Creating a RESTful API that is
crafted for your application needs will deliver
much better results than a generic interface. This would make things a lot
more complicated on C* side
and could potentially expose your data to security risks.


-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: python cql driver - cassandra.ReadTimeout - “Operation timed out - received only 1 responses.”

2014-06-02 Thread Alex Popescu
If I'm reading this correctly, what you are seeing is the read_timeout on
Cassandra side and not the client side timeout. Even if you set the client
side timeouts, the C* read  write timeouts are still respected on that
side.


On Mon, Jun 2, 2014 at 10:55 AM, Marcelo Elias Del Valle 
marc...@s1mbi0se.com.br wrote:

 I am using Cassandra 2.0 with python CQL.

 I have created a column family as follows:

 CREATE KEYSPACE IF NOT EXISTS Identification
   WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy',
   'DC1' : 1 };

 USE Identification;

 CREATE TABLE IF NOT EXISTS entitylookup (
   name varchar,
   value varchar,
   entity_id uuid,
   PRIMARY KEY ((name, value), entity_id))
 WITH
 caching=all;

 I then try to count the number of records in this CF as follows:

 #!/usr/bin/env pythonimport argparseimport sysimport tracebackfrom cassandra 
 import ConsistencyLevelfrom cassandra.cluster import Clusterfrom 
 cassandra.query import SimpleStatement
 def count(host, cf):
 keyspace = identification
 cluster = Cluster([host], port=9042, control_connection_timeout=6)
 session = cluster.connect(keyspace)
 session.default_timeout=6

 st = SimpleStatement(SELECT count(*) FROM %s % cf, 
 consistency_level=ConsistencyLevel.ALL)
 for row in session.execute(st, timeout=6):
 print count for cf %s = %s  % (cf, str(row))
 dump_pool.close()
 dump_pool.join()
 if __name__ == __main__:
 parser = argparse.ArgumentParser()
 parser.add_argument(-cf, --column-family, default=entitylookup, 
 help=Column Family to query)
 parser.add_argument(-H, --host, default=localhost, help=Cassandra 
 host)
 args = parser.parse_args()

 count(args.host, args.column_family)

 print fim

  The count is not that useful to me, it's just a test with an operation
 that takes long to complete.

 Although I have defined timeout as 6 seconds, after less than 30
 seconds I get the following error:

 ./count_entity_lookup.py  -H localhost -cf entitylookup
 Traceback (most recent call last):
   File ./count_entity_lookup.py, line 27, in module
 count(args.host, args.column_family)
   File ./count_entity_lookup.py, line 16, in count
 for row in session.execute(st, timeout=None):
   File 
 /home/mvalle/pyenv0/local/lib/python2.7/site-packages/cassandra/cluster.py, 
 line 1026, in execute
 result = future.result(timeout)
   File 
 /home/mvalle/pyenv0/local/lib/python2.7/site-packages/cassandra/cluster.py, 
 line 2300, in result
 raise self._final_exception
 cassandra.ReadTimeout: code=1200 [Timeout during read request] 
 message=Operation timed out - received only 1 responses. 
 info={'received_responses': 1, 'data_retrieved': True, 'required_responses': 
 2, 'consistency': 5}

  It seems the answer was found in just a replica, but this really doesn't
 make sense to me. Should't cassandra be able to query it anyway?

 These tests are running in a two node cluster, with RF = 2, write and read
 consistency = ALL (but same results using QUORUM).

 Thanks in advance.

 Best regards,

 Marcelo.




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Increased Cassandra connection latency

2014-05-29 Thread Alex Popescu
Also using the latest version of the driver (1.0.7) is always a good idea
just to make sure you are not hitting issues that have already been
addressed.


On Thu, May 29, 2014 at 12:33 AM, Aaron Morton aa...@thelastpickle.com
wrote:

 You’ll need to provide some more information such as:

 * Do you have monitoring on the cassandra cluster that shows the request
 latency ? Data Stax OpsCentre is  good starting point.

 * Is compaction keeping up ? Check with nodetool compactionstats

 * Is the GCInspector logging about long running ParNew ? (it only logs
 when it’s longer than 200ms)

 Cheers
 Aaron


 -
 Aaron Morton
 New Zealand
 @aaronmorton

 Co-Founder  Principal Consultant
 Apache Cassandra Consulting
 http://www.thelastpickle.com

 On 23/05/2014, at 10:35 pm, Alexey Sverdelov 
 alexey.sverde...@googlemail.com wrote:

 Hi all,

 I've noticed increased latency on our tomcat REST-service (average 30ms,
 max  2sec). We are using Cassandra 1.2.16 with official DataStax Java
 driver v1.0.3.

 Our setup:

 * 2 DCs
 * each DC: 7 nodes
 * RF=5
 * Leveled compaction

 After cassandra restart on all nodes, the latencies are alright again
 (average  5ms, max 50ms).

 Any thoughts are greatly appreciated.

 Thanks,
 Alexey





-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: : Read a negative frame size (-2113929216)!

2014-04-25 Thread Alex Popescu
Can you share the relevant code snippet that leads to this exception?


On Fri, Apr 25, 2014 at 4:47 PM, Vivek Mishra mishra.v...@gmail.com wrote:

 datastax java driver 2.0.1




 On Sat, Apr 26, 2014 at 1:35 AM, Chris Lohfink 
 clohf...@blackbirdit.comwrote:

 what client are you using?

 On Apr 25, 2014, at 3:01 PM, Vivek Mishra mishra.v...@gmail.com wrote:

 It's a simple cql3 query to create keyspace.

 -Vivek


 On Sat, Apr 26, 2014 at 1:28 AM, Chris Lohfink 
 clohf...@blackbirdit.comwrote:

 Did you send an enormous write or batch write and it wrapped?  Or is
 your client trying to use non-framed transport?

 Chris

 On Apr 25, 2014, at 2:50 PM, Vivek Mishra mishra.v...@gmail.com wrote:

  This is what i am getting with Cassandra 2.0.7 with Thrift.
 
 
  Caused by: org.apache.thrift.transport.TTransportException: Read a
 negative frame size (-2113929216)!
at
 org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:133)
at
 org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at
 org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at
 org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:362)
at
 org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:284)
at
 org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:191)
at
 org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
 
  Any pointer/suggestions?
 
  -Vivek







-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Which hector version is suitable for cassandra 2.0.6 ?

2014-03-27 Thread Alex Popescu
On Thu, Mar 27, 2014 at 2:23 AM, user 01 user...@gmail.com wrote:

 Btw both Hector  Datastax java driver are maintained by Datastax,  both
 for java, this speaks for itself !


Hector is not maintained by DataStax.


-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Exception in thread event_loop

2014-03-17 Thread Alex Popescu
Sundeep,

You'll probably have better chances to get these questions answered on the
Python driver group:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user

1. I'd suggest rewriting a bit the first code snippet just to get it to
work first so we can eliminate other possible issues.
2. It looks like an installation issue of libev.



On Sun, Mar 16, 2014 at 7:01 PM, Sundeep Kambhampati 
satyasunde...@gmail.com wrote:


 Thank you for the reply. I installed libev. However, it throwing a new
 exception. I searched online but couldn't find much help.

   File Utils/readDataCassandra.py, line 6, in module
 from cassandra.io.libevreactor import LibevConnection
   File
 /usr/local/lib/python2.7/site-packages/cassandra/io/libevreactor.py, line
 17, in module
 import cassandra.io.libevwrapper as libev
 ImportError:
 /usr/local/lib/python2.7/site-packages/cassandra/io/libevwrapper.so:
 undefined symbol: ev_run

 Can you please help me with this?

 Regards,
 Sundeep




 On Sun, Mar 16, 2014 at 8:33 PM, Laing, Michael michael.la...@nytimes.com
  wrote:

 A possible workaround - not a fix - might be to install libev so the
 libev event loop is used.

  See http://datastax.github.io/python-driver/installation.html

 Also be sure you are running the latest version: 1.0.2 I believe.

 Your ';' is outside of your 'str' - actually shouldn't be a problem tho.

 Good luck!
 ml


 On Sun, Mar 16, 2014 at 8:19 PM, Sundeep Kambhampati 
 satyasunde...@gmail.com wrote:

 Hi,

 I am using cassandra-2.0.4.

 When I execute following python code, I often get an exception mentioned
 below. Sometimes it works fine but most of the times it throws an error.
 All the nodes are up and running. Data in second column of table is huge,
 few thousand characters long and there around 10K rows.

 Code :

 from cassandra.cluster import Cluster

 cluster = Cluster(['10.2.252.0', '10.2.252.1'])
 session = cluster.connect('test')

 str = SELECT * FROM users ;
 rows = session.execute(str)

 for user_row in rows:
 print user_row.f_id, user_row.data

 cluster.shutdown()

 Exception:

 Exception in thread event_loop (most likely raised during interpreter
 shutdown):
 Traceback (most recent call last):
   File /usr/local/lib/python2.7/threading.py, line 810, in
 __bootstrap_inner
   File /usr/local/lib/python2.7/threading.py, line 763, in run
   File
 /usr/local/lib/python2.7/site-packages/cassandra/io/asyncorereactor.py,
 line 52, in _run_loop
 type 'exceptions.AttributeError': __exit__


 Can someone help me fixing this error?

 Regards,
 Sundeep






-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Driver documentation questions

2014-03-12 Thread Alex Popescu
While this is a question that would fit better on the Java driver group
[1], I'll try to provide a very short answer:

1. Cluster is an long-lived object and the application should have only 1
instance
2. Session is also a long-lived object and you should try to have 1 Session
per keyspace.

A session manages connection pools  for nodes in the cluster and it's
an expensive resource.

2.1. In case your application uses a lot of keyspaces, then you should
try to limit the number of Sessions and use fully qualified identifiers

3. PreparedStatements should be prepared only once.

Session and PreparedStatements are thread-safe and should be shared across
your app.

[1]
https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user


On Fri, Mar 7, 2014 at 12:42 PM, Green, John M (HP Education) 
john.gr...@hp.com wrote:

  I’ve been tinkering with both the C++ and Java drivers but in neither
 case have I got a good indication of how threading and resource mgmt should
 be implemented in a long-lived multi-threaded application server
 process.That is, what should be the scope of a builder, a cluster,
 session, and statement.   A JDBC connection is typically a per-thread
 affair.When application server receives a request, it typically

 a)  gets JDBC connection from a connection pool,

 b)  processes the request

 c)   returns the connection to the JDBC connection pool.



 All the Cassandra driver sample code I’ve seen so far is for single
 threaded command-line applications so I’m wondering what is thread safe (if
 anything) and what objects are “expensive” to instantiate.   I’m assuming a
 Session is analogous to a JDBC connection so when a request comes into my
 multi-threaded application server, I should create a new Session (or find a
 way to pool Sessions), but should I be creating a new cluster first?   What
 about a builder?



 John “lost in the abyss”




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Cassandra 2.0 with Hadoop 2.x?

2014-02-06 Thread Alex Popescu
On Thu, Feb 6, 2014 at 3:50 PM, Clint Kelly clint.ke...@gmail.com wrote:

 I can
 post a link if anyone is curious (once it is done).


I'm curious... thanks


-- 

:- a)


@al3xandru


Re: How to retrieve snappy compressed data from Cassandra using Datastax?

2014-01-28 Thread Alex Popescu
Wouldn't you be better to delegate the compression part to Cassandra (which
support Snappy [1])? This way the compression part will be completely
transparent to your application.

[1] http://www.datastax.com/dev/blog/whats-new-in-cassandra-1-0-compression


On Tue, Jan 28, 2014 at 8:51 PM, Check Peck comptechge...@gmail.com wrote:

 I am working on a project in which I am supposed to store the snappy
 compressed data in Cassandra, so that when I retrieve the same data from
 Cassandra, it should be snappy compressed in memory and then I will
 decompress that data using snappy to get the actual data from it.

 I am having a byte array in `bytesToStore` variable, then I am snappy
 compressing it using google `Snappy` and stored it back into Cassandra -

 // .. some code here
 System.out.println(bytesToStore);

 byte[] compressed = Snappy.compress(bytesToStore);

 attributesMap.put(e1, compressed);

 ICassandraClient client = CassandraFactory.getInstance().getDao();
 // write to Cassandra
 client.upsertAttributes(0123, attributesMap, sample_table);

 After inserting the data in Cassandra, I went back into CQL mode and I
 queried it and I can see this data in my table for the test_id `0123`-

 cqlsh:testingks select * from sample_table where test_id = '0123';

  test_id | name | value

 -+-+
 0123 |   e1 |
 0x2cac7fff012c4ebb9555001e42797465204172726179205465737420466f722042696720456e6469616e


 Now I am trying to read the same data back from Cassandra and everytime it
 is giving me `IllegalArgumentException` -

 public MapString, byte[] getDataFromCassandra(final String rowKey,
 final CollectionString attributeNames) {

 MapString, byte[] dataFromCassandra = new
 ConcurrentHashMapString, byte[]();

 try {
 String query=SELECT test_id, name, value from sample_table
 where test_id = '+rowKey+ ';;
 //SELECT test_id, name, value from sample_table where test_id
 = '0123';
 System.out.println(query);

 DatastaxConnection.getInstance();

 ResultSet result =
 DatastaxConnection.getSession().execute(query);

 IteratorRow it = result.iterator();

 while (it.hasNext()) {
 Row r = it.next();
 for(String str : attributeNames) {
 ByteBuffer bb = r.getBytes(str); // this line is
 throwing an exception for me
 byte[] ba=new byte[bb.remaining()];
 bb.get(ba, 0, ba.length);
 dataFromCassandra.put(str, ba);
 }
 }
 } catch (Exception e) {
 e.printStackTrace();
 }

 return dataFromCassandra;
 }

 This is the Exception I am getting -

 java.lang.IllegalArgumentException: e1 is not a column defined in this
 metadata

 In the above method, I am passing rowKey as `0123` and `attributeNames`
 contains `e1` as the string.

 I am expecting Snappy Compressed data in `dataFromCassandra` Map. In this
 map the key should be `e1` and the value should be snappy compressed data
 if I am not wrong.. And then I will iterate this Map to snappy decompress
 the data..

 I am using Datastax Java client working with Cassandra 1.2.9.

 Any thoughts what wrong I am doing here?

 To unsubscribe from this group and stop receiving emails from it, send an
 email to java-driver-user+unsubscr...@lists.datastax.com.




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Counters question - is there a better way to count

2013-12-06 Thread Alex Popescu
On Thu, Dec 5, 2013 at 7:44 AM, Christopher Wirt chris.w...@struq.comwrote:

 I want to build a really simple column family which counts the occurrence
 of a single event X.


The guys from Disqus are big into counters:

https://www.youtube.com/watch?v=A2WdS0YQADo

http://www.slideshare.net/planetcassandra/cassandra-at-disqus (relevant
slides start at 25)


-- 

:- a)


Alex Popescu
@al3xandru


Re: CQL Tables in Cassandra with an Index

2013-11-08 Thread Alex Popescu
Conditional inserts/updates (lightweight transactions) are available only
in C* 2.0+.

Also most of the time you should try to think about alternative ways to
solve the problem and rely on these only if you cannot find a different
solution (the reason for this is that they come with performance penalties
and you'd be better off with a scalable  performant design, rather than
taking the easy way out ;-)


On Fri, Nov 8, 2013 at 11:40 AM, Techy Teck comptechge...@gmail.com wrote:

 If I execute the above query from CQL shell, it doesn't work for me at
 all... This is what I get -

 cqlsh:pp insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('1', 'e29',  'some_new_value', now()) if not
 exists
 ;
 Bad Request: line 1:123 missing EOF at 'if'

 Is there anything I am missing here? I am running Cassandra 1.2.3




 On Fri, Nov 8, 2013 at 5:33 AM, DuyHai Doan doanduy...@gmail.com wrote:

 Consider using the new lightweight transaction

  insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('1', 'e29',  'some_new_value', now()) *if
 not exists*;



 Le vendredi 8 novembre 2013 03:53:12 UTC+1, Techy Teck a écrit :

 I am using the below table in our use case -

 create table test_new (
 employee_id text,
 employee_name text,
 value text,
 last_modified_date timeuuid,
 primary key (employee_id, last_modified_date)
);

 create index employee_name_idx on test_new (employee_name);

 In my above table employee_id will be unique always starting from 1 till
 32767. So our query pattern is like this -

 1. Give me everything for any of the employee_id?
 2. Give me everything for what has changed in last 5 minutes?
 3. Give me everything for any of the employee_name?


 I will be inserting below data into my above table -

 insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('1', 'e27',  'some_value', now());
 insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('2', 'e27',  'some_new_value', now());
 insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('3', 'e28',  'some_new_again_value', now());

 So now is there any way to avoid this particular scenario in my above
 table for the below query.. Somehow somebody by mistake is trying to
 execute the below query then it will create another row with employee_id as
 1 and with other fields? I don't want anyone to insert the same employee_id
 again if it is already there in the cassandra database.. Any thoughts?

 insert into test_new (employee_id, employee_name, value,
 last_modified_date) values ('1', 'e29',  'some_new_value', now());


  To unsubscribe from this group and stop receiving emails from it, send
 an email to java-driver-user+unsubscr...@lists.datastax.com.


  To unsubscribe from this group and stop receiving emails from it, send an
 email to java-driver-user+unsubscr...@lists.datastax.com.




-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: is this correct, thrift unportable to CQL3Š.

2013-09-25 Thread Alex Popescu
), key, ByteBuffer.wrap(value)));
 } else {
 PreparedStatement statement = session.prepare(INSERT
 INTO  + keys + . + table + (id, colvalue) VALUES (?, ?));
 BoundStatement boundStatement = new
 BoundStatement(statement);

 session.execute(boundStatement.bind(StandardConverters.convertFromBytes(String.class,
 rowKey), ByteBuffer.wrap(value)));
   }

 And, I did that and getting this exception:

 Exception:Missing PRIMARY KEY part colname since colvalue is set

 And just FYI. Our Column Family definition is below:

 CREATE TABLE keys.StringIndice (id text,
 colname text,
 colvalue blob,
 PRIMARY KEY (id,colname, colvalue)) WITH COMPACT STORAGE)

 Thanks again,
 Vikas Goyal



 On Tue, Sep 24, 2013 at 7:02 PM, Sylvain Lebresne sylv...@datastax.com
 mailto:sylv...@datastax.com wrote:
 Short answer: not, this is not correct.

 Longer answer: what you call null is actually an empty value (which is
 *not* the same thing, unless you consider an empty string is the same thing
 than a null string). As it happens, C* always an empty value as a valid
 value for any type and that's true of both thrift and CQL3. What is true is
 that CQL3 discourage the use of empty values for type for which it doesn't
 particularly make sense (integers typically) by not having a particular
 easy to use syntax to input them. But that's supported nonetheless. If you
 use a prepared statement for instance (where you send values already
 serialized), nothing will prevent you from sending an empty value. Even if
 you don't want to use a prepared statement, CQL3 has conversion functions (
 http://cassandra.apache.org/doc/cql3/CQL.html#blobFun) that allows to do
 it (for instance, blobAsInt(0x) will be an empty int value).

 --
 Sylvain



 On Tue, Sep 24, 2013 at 2:36 PM, Hiller, Dean dean.hil...@nrel.gov
 mailto:dean.hil...@nrel.gov wrote:
 Many applications in thrift use the wide row with composite column name
 and as an example, let's say golf score for instance and we end up with
 golf score : pk like so

 null : pk56
 null : pk45
 89 : pk90
 89: pk87
 90: pk101
 95: pk17

 Notice that there are some who do not have a golf score(zero would not
 quite make sense and would be interpreted as a golf score).  I am hearing
 from this post if they are correct that this is not portable to CQL3???  Is
 this true?
 http://stackoverflow.com/questions/18963248/how-can-i-have-null-column-value-for-a-composite-key-column-in-cql3

 (This sounds like a major deficit to me as the wide row now can only be
 used where actual values exist?).  Is it possible to port this pattern
 to CQL3?

 Thanks,
 Dean











-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: CQL Thrift

2013-08-30 Thread Alex Popescu
On Fri, Aug 30, 2013 at 11:56 AM, Vivek Mishra mishra.v...@gmail.comwrote:

 @lhazlewood

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

 Begin batch

  multiple insert statements.

 apply batch

 It doesn't work for you?

 -Vivek


According to the OP batching inserts is slow. The SO thread [1] mentions
that the in their environment BATCH takes 1.5min, while the Thrift-based
approach is around 235millis.

[1]
http://stackoverflow.com/questions/18522191/using-cassandra-and-cql3-how-do-you-insert-an-entire-wide-row-in-a-single-reque
-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: CQL: Prepared statements

2013-08-28 Thread Alex Popescu
On Wed, Aug 28, 2013 at 4:01 AM, Vassilis Bekiaris 
bekiar...@iconplatforms.com wrote:

  Hi,

 I think the introductory paragraphs in the Java Driver documentation [1]
 provide good justification on the use of prepared statements:

  ... but you can also use prepared statements, which only need to be
 parsed once by the cluster, and then bind values to the variables and
 execute the bound statement you read or write data to a cluster.

 In the previous tutorial, you added a loadData method which creates a new
 statement for each INSERT, but you may also use prepared statements and
 bind new values to the columns each time before execution. Doing this
 increases performance, especially for repeated queries.

 Cheers!

 [1]
 http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html



I think PreparedStatements should almost always be the recommended way (no
stringification, performance, etc.).  Except maybe statements that you are
sure they'll be run only once,

:- a)


Alex Popescu
@al3xandru


Re: Any good GUI based tool to manage data in Casandra?

2013-08-09 Thread Alex Popescu
DevCenter is using the new java driver [1] which works only with CQL3 and
the binary protocol so older C*/DSE version will not be supported. I know
that upgrading your cluster just to be able to use DevCenter doesn't make
sense, but hopefully features in the 1.2 and 2.0 will justify the upgrade
;-)


[1] https://github.com/datastax/java-driver


On Fri, Aug 9, 2013 at 10:02 AM, Rahul Gupta rgu...@dekaresearch.comwrote:

  Hello,

 ** **

 Is there backward compatibility planned for DataStax DevCenter.

 I am using DSE 3.0.1 and Cassandra 1.1.9.7

 ** **

 Currently no plan to upgrade to C* 1.2.

 ** **

 Thanks,

 *Rahul Gupta*
 *DEKA* *Research  Development* http://www.dekaresearch.com/

 340 Commercial St  Manchester, NH  03101

 P: 603.666.3908 extn. 6504 | C: 603.718.9676

 ** **

 This e-mail and the information, including any attachments, it contains
 are intended to be a confidential communication only to the person or
 entity to whom it is addressed and may contain information that is
 privileged. If the reader of this message is not the intended recipient,
 you are hereby notified that any dissemination, distribution or copying of
 this communication is strictly prohibited. If you have received this
 communication in error, please immediately notify the sender and destroy
 the original message.

 ** **

 *From:* Alex Popescu [mailto:al...@datastax.com]
 *Sent:* Friday, August 09, 2013 12:47 AM
 *To:* user@cassandra.apache.org; Tony Anecito

 *Subject:* Re: Any good GUI based tool to manage data in Casandra?

  ** **

 I've seen your email last week and saved it to ping you about DevCenter:
 http://www.datastax.com/dev/blog/introducing-datastax-devcenter. Please
 keep in mind that this is just the first version and we need
 suggestions/bug reports/etc.

 ** **

 :- a)

 ** **

 On Wed, Aug 7, 2013 at 11:18 AM, Tony Anecito adanec...@yahoo.com wrote:
 

 Thanks Nick for your reply. Good to know that. I knew OpsCenter was mainly
 schema management.

 Best Regards,
 -Tony

 ** **

 ** **
--

 *From:* Nick Bailey n...@datastax.com
 *To:* user@cassandra.apache.org
 *Sent:* Wednesday, August 7, 2013 12:04 PM


 *Subject:* Re: Any good GUI based tool to manage data in Casandra?

 ** **

 OpsCenter allows CRUD of column families  themselves (although not CQL3
 column families). It only allows viewing the data inside column families
 though, no support for writing or updating.

 ** **

 On Wed, Aug 7, 2013 at 12:54 PM, Aaron Morton aa...@thelastpickle.com
 wrote:

 I think on of the versions of ops centre has the feature
 http://www.datastax.com/what-we-offer/products-services/datastax-opscenter
 

 ** **

 otherwise people use the cassandra-cli or cqlsh. 

 ** **

 Cheers

 ** **

 -

 Aaron Morton

 Cassandra Consultant

 New Zealand

 ** **

 @aaronmorton

 http://www.thelastpickle.com

 ** **

 On 7/08/2013, at 1:28 AM, Tony Anecito adanec...@yahoo.com wrote:



 

 Thanks Aaron. I found that before I asked the question and Helenos seems
 the closest but it does not allow you to easily use CRUD like say SQL
 Server Management tools where you can get a list of say 1,000 records in a
 grid control and select rows for deletion or insert or update.

  

 I will look closer at that one since this is the reply from the team but
 if users on this email list have other suggestions please do not hesitate
 to reply.

  

 Many Thanks,

 -Tony

 ** **

 *From:* Aaron Morton aa...@thelastpickle.com
 *To:* Cassandra User user@cassandra.apache.org
 *Sent:* Tuesday, August 6, 2013 1:38 AM
 *Subject:* Re: Any good GUI based tool to manage data in Casandra?

 ** **

 There is a list here.  

 ** **

 http://wiki.apache.org/cassandra/Administration%20Tools

 ** **

 Cheers

 ** **

 -

 Aaron Morton

 Cassandra Consultant

 New Zealand

 ** **

 @aaronmorton

 http://www.thelastpickle.com/

 ** **

 On 3/08/2013, at 6:19 AM, Tony Anecito adanec...@yahoo.com wrote:



 

 Hi All,

 ** **

 Is there a GUI tool for managing data in Cassandra database? I have google
 and seen tools but they seem to be schema management or explorer to just
 view data. IT would be great to delete/inset rows or update values for a
 column via GUI.


 Thanks,

 -Tony

 ** **

 ** **

 ** **

 ** **

 ** **



 

 ** **

 -- 

 ** **

 :- a)

 ** **

 ** **

 Alex Popescu

 Sen. Product Manager @ DataStax

 @al3xandru

 ** **

 Click 
 herehttps://www.mailcontrol.com/sr/BMRXE!+kKu7GX2PQPOmvUlIKVP3GxTsrstp6D3b2!9hWvxc0BNVq5tvAH2g5DL+tPQDoBm8zRr2zR1Lppn2zgQ==to
  report this email as spam.
 

 --
 This e-mail and the information, including any attachments, it contains
 are intended to be a confidential communication only

Re: Any good GUI based tool to manage data in Casandra?

2013-08-09 Thread Alex Popescu
On Fri, Aug 9, 2013 at 10:12 AM, David McNelis dmcne...@gmail.com wrote:

 Is DevCenter a project that might end up open sourced?  The original blog
 post calls it free, and if its destined to stay so, I'd think that would be
 a benefit (being OSS) to the community at large.



We haven't figured this part yet. DevCenter is still in its infancy and
we'll be experimenting with different approaches/technologies to allow us
to build the features we imagined for it. Having the code in the open right
now doesn't make too much sense.

-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Any good GUI based tool to manage data in Casandra?

2013-08-09 Thread Alex Popescu
It surely is coming! Being an early version we wanted to focus on nailing a
couple of things first before supporting multiple OS versions.


On Fri, Aug 9, 2013 at 1:11 PM, Keith Freeman 8fo...@gmail.com wrote:

  Sounds like a good tool, but isn't it odd to only have Windows  Mac
 versions?  My impression has been that most users run Cassandra on Linux.
 Is a Linux version coming (please!)?


 On 08/09/2013 01:27 PM, Alex Popescu wrote:


 On Fri, Aug 9, 2013 at 10:12 AM, David McNelis dmcne...@gmail.com wrote:

 Is DevCenter a project that might end up open sourced?  The original blog
 post calls it free, and if its destined to stay so, I'd think that would be
 a benefit (being OSS) to the community at large.



  We haven't figured this part yet. DevCenter is still in its infancy and
 we'll be experimenting with different approaches/technologies to allow us
 to build the features we imagined for it. Having the code in the open right
 now doesn't make too much sense.

  --

  :- a)


  Alex Popescu
 Sen. Product Manager @ DataStax
 @al3xandru





-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Any good GUI based tool to manage data in Casandra?

2013-08-08 Thread Alex Popescu
I've seen your email last week and saved it to ping you about DevCenter:
http://www.datastax.com/dev/blog/introducing-datastax-devcenter. Please
keep in mind that this is just the first version and we need
suggestions/bug reports/etc.

:- a)


On Wed, Aug 7, 2013 at 11:18 AM, Tony Anecito adanec...@yahoo.com wrote:

 Thanks Nick for your reply. Good to know that. I knew OpsCenter was mainly
 schema management.

 Best Regards,
 -Tony


   --
  *From:* Nick Bailey n...@datastax.com
 *To:* user@cassandra.apache.org
 *Sent:* Wednesday, August 7, 2013 12:04 PM

 *Subject:* Re: Any good GUI based tool to manage data in Casandra?

 OpsCenter allows CRUD of column families  themselves (although not CQL3
 column families). It only allows viewing the data inside column families
 though, no support for writing or updating.


 On Wed, Aug 7, 2013 at 12:54 PM, Aaron Morton aa...@thelastpickle.comwrote:

 I think on of the versions of ops centre has the feature
 http://www.datastax.com/what-we-offer/products-services/datastax-opscenter

 otherwise people use the cassandra-cli or cqlsh.

 Cheers

 -
 Aaron Morton
 Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com

 On 7/08/2013, at 1:28 AM, Tony Anecito adanec...@yahoo.com wrote:

 Thanks Aaron. I found that before I asked the question and Helenos seems
 the closest but it does not allow you to easily use CRUD like say SQL
 Server Management tools where you can get a list of say 1,000 records in a
 grid control and select rows for deletion or insert or update.

 I will look closer at that one since this is the reply from the team but
 if users on this email list have other suggestions please do not hesitate
 to reply.

 Many Thanks,
 -Tony

   *From:* Aaron Morton aa...@thelastpickle.com
 *To:* Cassandra User user@cassandra.apache.org
 *Sent:* Tuesday, August 6, 2013 1:38 AM
 *Subject:* Re: Any good GUI based tool to manage data in Casandra?

  There is a list here.

 http://wiki.apache.org/cassandra/Administration%20Tools

 Cheers

  -
 Aaron Morton
 Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com/

  On 3/08/2013, at 6:19 AM, Tony Anecito adanec...@yahoo.com wrote:

  Hi All,

 Is there a GUI tool for managing data in Cassandra database? I have google
 and seen tools but they seem to be schema management or explorer to just
 view data. IT would be great to delete/inset rows or update values for a
 column via GUI.

 Thanks,
 -Tony











-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Is there update-in-place on maps?

2013-08-07 Thread Alex Popescu
On Wed, Aug 7, 2013 at 10:47 AM, Aaron Morton aa...@thelastpickle.comwrote:

 As for the atomic increment, I take the answer is 'no, there is no atomic
 increment, I have to pull the value to the client and send an update with
 the new value'.

 Saying atomic increment is probably confusing.
 You cannot have Counters, the thing most people would think about when you
 say increment, in a collection type.

 You can update the values in a map server side.

 If you can provide a concrete example of what you want to do it may be
 easier.



I think the OP is asking if the following op is atomic:

UPDATE users SET favs['posts'] = favs['post'] + 1 WHERE id = 'smith'


:- a)

Cheers

 -
 Aaron Morton
 Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com

 On 6/08/2013, at 10:05 PM, Andy Twigg andy.tw...@gmail.com wrote:

 Counters can be atomically incremented (
 http://wiki.apache.org/cassandra/Counters). Pick a UUID for the counter,
 and use that: c=map.get(k); c.incr()


 On 6 August 2013 11:01, Jan Algermissen jan.algermis...@nordsc.comwrote:


 On 06.08.2013, at 11:36, Andy Twigg andy.tw...@gmail.com wrote:

  Store pointers to counters as map values?

 Sorry, but this fits into nothing I know about C* so far - can you
 explain?

 Jan




 --
 Dr Andy Twigg
 Junior Research Fellow, St Johns College, Oxford
 Room 351, Department of Computer Science
 http://www.cs.ox.ac.uk/people/andy.twigg/
 andy.tw...@cs.ox.ac.uk | +447799647538





-- 

:- a)


Alex Popescu
Sen. Product Manager @ DataStax
@al3xandru


Re: Are Writes disk-bound rather than CPU-bound?

2013-07-23 Thread Alex Popescu
I see pretty much the same formulation in the 1.2 docs, so I'm wondering
what would be the best rewrite of that paragraph?


On Tue, Jul 23, 2013 at 9:00 AM, hajjat haj...@purdue.edu wrote:



 On Tue, Jul 23, 2013 at 5:05 AM, aaron morton [via [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=7589248i=0]
 [hidden email] http://user/SendEmail.jtp?type=nodenode=7589248i=1wrote:

 “/Insert-heavy workloads will actually be CPU-bound in Cassandra before
 being
 memory-bound/”

 What is the source for that ?


 http://www.datastax.com/docs/0.8/cluster_architecture/cluster_planning
 ​​


 This is because everything is
 *first *written to the commit log *on disk*. Any thoughts??

 Pretty much.

 Cheers

-
 Aaron Morton
 Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com

 On 22/07/2013, at 8:58 AM, hajjat [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=7589236i=0
 wrote:

 “/Insert-heavy workloads will actually be CPU-bound in Cassandra before
 being
 memory-bound/”

 However, from reading the documentation
 (http://www.datastax.com/docs/1.2/dml/about_writes) it seems the disk is
 the
 real bottleneck in Writes rather than the CPU. This is because everything
 is
 *first *written to the commit log *on disk*. Any thoughts??



 --
 View this message in context:
 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Are-Writes-disk-bound-rather-than-CPU-bound-tp7589191.html
 Sent from the [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=7589236i=1mailing list 
 archive at
 Nabble.com.




 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Are-Writes-disk-bound-rather-than-CPU-bound-tp7589191p7589236.html
  To unsubscribe from Are Writes disk-bound rather than CPU-bound?, click
 here.
 NAMLhttp://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --
 *Mohammad Hajjat*
 *Ph.D. Student*
 *Electrical and Computer Engineering*
 *Purdue University*

 --
 View this message in context: Re: Are Writes disk-bound rather than
 CPU-bound?http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Are-Writes-disk-bound-rather-than-CPU-bound-tp7589191p7589248.html

 Sent from the cassandra-u...@incubator.apache.org mailing list 
 archivehttp://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/at 
 Nabble.com.




-- 

:- a)


Alex Popescu
@al3xandru