hmsonline / cassandra-triggers

52 stars 13 forks source link

Is cassandra 2.0.4 supported? #54

Open newtechfellas opened 10 years ago

newtechfellas commented 10 years ago

I see exceptions on starting cassandra after I drop in the jars and updating the JVM_OPTS.

[AppClassLoader@26e7127] weaveinfo Join point 'method-execution(void org.apache.cassandra.thrift.CassandraServer.doInsert(org.apache.cassandra.thrift.ConsistencyLevel, java.util.List, boolean))' in Type 'org.apache.cassandra.thrift.CassandraServer' (CassandraServer.java:1066) advised by afterThrowing advice from 'com.hmsonline.cassandra.triggers.CassandraServerTriggerAspect' (CassandraServerTriggerAspect.java)
ERROR 15:28:32,321 Exception encountered during startup
java.lang.VerifyError: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9
    at org.apache.cassandra.thrift.ThriftServer.getCassandraServer(ThriftServer.java:88)
    at org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:55)
    at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:414)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:474)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:504)
java.lang.VerifyError: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9
    at org.apache.cassandra.thrift.ThriftServer.getCassandraServer(ThriftServer.java:88)
    at org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:55)
    at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:414)
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:474)
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:504)
Exception encountered during startup: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9
 INFO 15:28:32,340 Stop listening for CQL clients
 INFO 15:28:32,341 Announcing shutdown

boneill42 commented 10 years ago

What version of Cassandra are you using?


Brian O'Neill Chief Technology Officer

Health Market Science The Science of Better Results 2700 Horizon Drive € King of Prussia, PA € 19406 M: 215.588.6024 € @boneill42 http://www.twitter.com/boneill42 € healthmarketscience.com

This information transmitted in this email message is for the intended recipient only and may contain confidential and/or privileged material. If you received this email in error and are not the intended recipient, or the person responsible to deliver it to the intended recipient, please contact the sender at the email above and delete this email and any attachments and destroy any copies thereof. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited.

From: newtechfellas notifications@github.com Reply-To: hmsonline/cassandra-triggers <reply+i-37694771-90efab1bea968d0ceb75a4604402f097cf17a981-897229@reply.gith ub.com> Date: Friday, July 11, 2014 at 4:30 PM To: hmsonline/cassandra-triggers cassandra-triggers@noreply.github.com Subject: [cassandra-triggers] Is cassandra 2.0.4 supported? (#54)

I see exceptions on starting cassandra after I drop in the jars and updating the JVM_OPS. [AppClassLoader@26e7127] weaveinfo Join point 'method-execution(void org.apache.cassandra.thrift.CassandraServer.doInsert(org.apache.cassandra.th rift.ConsistencyLevel, java.util.List, boolean))' in Type 'org.apache.cassandra.thrift.CassandraServer' (CassandraServer.java:1066) advised by afterThrowing advice from 'com.hmsonline.cassandra.triggers.CassandraServerTriggerAspect' (CassandraServerTriggerAspect.java) ERROR 15:28:32,321 Exception encountered during startup java.lang.VerifyError: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9 at org.apache.cassandra.thrift.ThriftServer.getCassandraServer(ThriftServer.jav a:88) at org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:55) at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:414) at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:4 74) at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:504) java.lang.VerifyError: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9 at org.apache.cassandra.thrift.ThriftServer.getCassandraServer(ThriftServer.jav a:88) at org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:55) at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:414) at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:4 74) at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:504) Exception encountered during startup: Expecting a stackmap frame at branch target 16 in method org.apache.cassandra.thrift.CassandraServer.()V at offset 9 INFO 15:28:32,340 Stop listening for CQL clients INFO 15:28:32,341 Announcing shutdown

‹ Reply to this email directly or view it on GitHub https://github.com/hmsonline/cassandra-triggers/issues/54 .

newtechfellas commented 10 years ago

Tried with 2.0.9 and 2.0.4

boneill42 commented 10 years ago

That is likely the issue. The AOP is designed to work against 1.2. For >2.0, have you considered using the native C* support for triggers?

-brian


Brian O'Neill Chief Technology Officer

Health Market Science The Science of Better Results 2700 Horizon Drive € King of Prussia, PA € 19406 M: 215.588.6024 € @boneill42 http://www.twitter.com/boneill42 € healthmarketscience.com

This information transmitted in this email message is for the intended recipient only and may contain confidential and/or privileged material. If you received this email in error and are not the intended recipient, or the person responsible to deliver it to the intended recipient, please contact the sender at the email above and delete this email and any attachments and destroy any copies thereof. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited.

From: newtechfellas notifications@github.com Reply-To: hmsonline/cassandra-triggers <reply+i-37694771-90efab1bea968d0ceb75a4604402f097cf17a981-897229@reply.gith ub.com> Date: Monday, July 14, 2014 at 12:22 PM To: hmsonline/cassandra-triggers cassandra-triggers@noreply.github.com Cc: Brian O'Neill bone@alumni.brown.edu Subject: Re: [cassandra-triggers] Is cassandra 2.0.4 supported? (#54)

Tried with 2.0.9 and 2.0.4

‹ Reply to this email directly or view it on GitHub https://github.com/hmsonline/cassandra-triggers/issues/54#issuecomment-4892 1662 .

newtechfellas commented 10 years ago

Yes. I tried it. I get the trigger mechanism but it gives me limited information i.e the columns/values. I need more details for auditing requirement. Was hoping AOP would help. I am trying to address http://stackoverflow.com/questions/24684457/data-auditing-in-cassandra problem. Is there a way I could use AOP for this requirement?

boneill42 commented 10 years ago

It shouldn¹t be too tough to make the AOP compatible with C* 2.

You likely just need to change the slice point, which is defined here: https://github.com/hmsonline/cassandra-triggers/blob/master/src/main/java/co m/hmsonline/cassandra/triggers/CassandraServerTriggerAspect.java

In 2+, I believe the packaging/naming has changed for CassandraServer, but I can¹t recall what the new class/package is off the top of my head.

If you end up porting this to 2, I¹d love to merge a PR for it. =)

-brian


Brian O'Neill Chief Technology Officer

Health Market Science The Science of Better Results 2700 Horizon Drive € King of Prussia, PA € 19406 M: 215.588.6024 € @boneill42 http://www.twitter.com/boneill42 € healthmarketscience.com

This information transmitted in this email message is for the intended recipient only and may contain confidential and/or privileged material. If you received this email in error and are not the intended recipient, or the person responsible to deliver it to the intended recipient, please contact the sender at the email above and delete this email and any attachments and destroy any copies thereof. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited.

From: newtechfellas notifications@github.com Reply-To: hmsonline/cassandra-triggers <reply+i-37694771-90efab1bea968d0ceb75a4604402f097cf17a981-897229@reply.gith ub.com> Date: Monday, July 14, 2014 at 12:33 PM To: hmsonline/cassandra-triggers cassandra-triggers@noreply.github.com Cc: Brian O'Neill bone@alumni.brown.edu Subject: Re: [cassandra-triggers] Is cassandra 2.0.4 supported? (#54)

Yes. I tried it. I get the trigger mechanism but it gives me limited information i.e the columns/values. I need more details for auditing requirement. Was hoping AOP would help. I am trying to address http://stackoverflow.com/questions/24684457/data-auditing-in-cassandra problem. Is there a way I could use AOP for this requirement?

‹ Reply to this email directly or view it on GitHub https://github.com/hmsonline/cassandra-triggers/issues/54#issuecomment-4892 3107 .

boneill42 commented 10 years ago

And yes, AOP might provide an elegant solution to auditing requirements. (we considered the same thing)

-brian


Brian O'Neill Chief Technology Officer

Health Market Science The Science of Better Results 2700 Horizon Drive € King of Prussia, PA € 19406 M: 215.588.6024 € @boneill42 http://www.twitter.com/boneill42 € healthmarketscience.com

This information transmitted in this email message is for the intended recipient only and may contain confidential and/or privileged material. If you received this email in error and are not the intended recipient, or the person responsible to deliver it to the intended recipient, please contact the sender at the email above and delete this email and any attachments and destroy any copies thereof. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited.

From: newtechfellas notifications@github.com Reply-To: hmsonline/cassandra-triggers <reply+i-37694771-90efab1bea968d0ceb75a4604402f097cf17a981-897229@reply.gith ub.com> Date: Monday, July 14, 2014 at 12:33 PM To: hmsonline/cassandra-triggers cassandra-triggers@noreply.github.com Cc: Brian O'Neill bone@alumni.brown.edu Subject: Re: [cassandra-triggers] Is cassandra 2.0.4 supported? (#54)

Yes. I tried it. I get the trigger mechanism but it gives me limited information i.e the columns/values. I need more details for auditing requirement. Was hoping AOP would help. I am trying to address http://stackoverflow.com/questions/24684457/data-auditing-in-cassandra problem. Is there a way I could use AOP for this requirement?

‹ Reply to this email directly or view it on GitHub https://github.com/hmsonline/cassandra-triggers/issues/54#issuecomment-4892 3107 .

newtechfellas commented 10 years ago

Ok. thank you for confirming. I am trying to make this work with > 2.0 version. If I succeed, I will send PR.

boneill42 commented 10 years ago

Best of luck, and much appreciated.


Brian O'Neill Chief Technology Officer

Health Market Science The Science of Better Results 2700 Horizon Drive € King of Prussia, PA € 19406 M: 215.588.6024 € @boneill42 http://www.twitter.com/boneill42 € healthmarketscience.com

This information transmitted in this email message is for the intended recipient only and may contain confidential and/or privileged material. If you received this email in error and are not the intended recipient, or the person responsible to deliver it to the intended recipient, please contact the sender at the email above and delete this email and any attachments and destroy any copies thereof. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited.

From: newtechfellas notifications@github.com Reply-To: hmsonline/cassandra-triggers <reply+i-37694771-90efab1bea968d0ceb75a4604402f097cf17a981-897229@reply.gith ub.com> Date: Monday, July 14, 2014 at 1:08 PM To: hmsonline/cassandra-triggers cassandra-triggers@noreply.github.com Cc: Brian O'Neill bone@alumni.brown.edu Subject: Re: [cassandra-triggers] Is cassandra 2.0.4 supported? (#54)

Ok. thank you for confirming. I am trying to make this work with > 2.0 version. If I succeed, I will send PR.

‹ Reply to this email directly or view it on GitHub https://github.com/hmsonline/cassandra-triggers/issues/54#issuecomment-4892 7588 .

newtechfellas commented 10 years ago

After updating 2.0.9 dependency and changing few class names and aspectj version to 1.6, I am stuck with below issue in mvn test. Not sure why its failing. Any hints?

[AppClassLoader@10393e97] weaveinfo Join point 'method-execution(void org.apache.cassandra.thrift.CassandraServer.doInsert(org.apache.cassandra.thrift.ConsistencyLevel, java.util.List, boolean))' in Type 'org.apache.cassandra.thrift.CassandraServer' (CassandraServer.java:1067) advised by afterThrowing advice from 'com.hmsonline.cassandra.triggers.CassandraServerTriggerAspect' (CassandraServerTriggerAspect.java)
2014-07-14 15:14:28,846-0500 | DEBUG [main] AbstractTriggerTest.loadDataSchema(65) | ======================= LOADED DATA SCHEMA FOR TESTS ==========================
2014-07-14 15:14:28,882-0500 | ERROR [Thrift:1] CassandraDaemon.uncaughtException(199) | Exception in thread Thread[Thrift:1,5,main]
java.lang.AssertionError
    at org.apache.cassandra.config.CFMetaData.getCfDef(CFMetaData.java:1926)
    at org.apache.cassandra.thrift.ThriftValidation.validateColumnNames(ThriftValidation.java:214)
    at org.apache.cassandra.thrift.ThriftValidation.validateColumnNames(ThriftValidation.java:267)
    at org.apache.cassandra.thrift.CassandraServer.internal_insert(CassandraServer.java:656)
    at org.apache.cassandra.thrift.CassandraServer.insert(CassandraServer.java:695)
    at org.apache.cassandra.thrift.Cassandra$Processor$insert.getResult(Cassandra.java:3782)
    at org.apache.cassandra.thrift.Cassandra$Processor$insert.getResult(Cassandra.java:3766)
    at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
    at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
    at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:201)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
2014-07-14 15:14:28,891-0500 | DEBUG [main] CassandraStore.create(59) | Did not create [triggers:Triggers] (probably already there)
Tests run: 2, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 2.87 sec <<< FAILURE!
2014-07-14 15:14:30,949-0500 | ERROR [StorageServiceShutdownHook] CassandraDaemon.uncaughtException(199) | Exception in thread Thread[StorageServiceShutdownHook,5,main]
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@108e08dc rejected from org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor@5ce7ac01[Shutting down, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 1]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2013)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:816)
    at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:325)
    at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:594)
    at org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor.scheduleWithFixedDelay(DebuggableScheduledThreadPoolExecutor.java:59)
    at org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:295)
    at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
    at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
    at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
    at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
    at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
    at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
    at org.apache.cassandra.db.Keyspace$1.apply(Keyspace.java:86)
    at org.apache.cassandra.db.Keyspace$1.apply(Keyspace.java:83)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at org.apache.cassandra.service.StorageService$1.runMayThrow(StorageService.java:582)
    at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
    at java.lang.Thread.run(Thread.java:722)
Results :
Failed tests:   testLogWrite(com.hmsonline.cassandra.triggers.TriggerTest)
Tests in error: 
  testThrowingExceptionWhenInsertingColumn(com.hmsonline.cassandra.triggers.TriggerTest)
ghost commented 8 years ago

did it work for C*3,i need tigger to do sth.i want to learn from your coding that how it to work.thanks

boneill42 commented 8 years ago

@JavaNikon this was a hack in the older versions of Cassandra that used AOP to get trigger like behavior. These days, trigger support is built right in: https://docs.datastax.com/en/cql/3.1/cql/cql_reference/trigger_r.html

ghost commented 8 years ago

oh,thank you, i will see it