Contributing code to cassandra

23
Contributing code to Cassandra Tel Aviv Cassandra Meetup May 2015 Oded Peer, RSA Security

Transcript of Contributing code to cassandra

Page 1: Contributing code to cassandra

Contributing code to

CassandraTel Aviv Cassandra Meetup

May 2015

Oded Peer, RSA Security

Page 2: Contributing code to cassandra

Brief History

2007

February 2010Jan 2009

July 2008

Page 3: Contributing code to cassandra

An Apache Project• Project Management Committee (PMC)

o Established by and reports to ASF Boardo Provides oversight (legal, procedures, community)o PMC members are elected based on merit

• Mailing lists for communicationo “If it didn't happen on the dev list, it didn't happen”

• Apache License• Voting procedures to reach consensus• Release procedure• Tools

Page 4: Contributing code to cassandra

Getting involved• Reporting bugs

• Testing patches

• Help others on the mailing list

• Submitting patches

Page 5: Contributing code to cassandra

Dev Roles

Contributor Committer

Page 6: Contributing code to cassandra

91 Commit Authors46% Datastax

7682 Files changed

70 % Datastax

248,411 Changed lines78% Datastax

Code Contribution2014

26 Committers10 from Datastax

4 from Apple3 from Twitter

Source: ‘git log’

Source: Cassandra wiki

Page 7: Contributing code to cassandra

Source Control

Patches, not pull requests

Page 8: Contributing code to cassandra

Branching model• Mainline model

Page 9: Contributing code to cassandra

Alternative - Trunk Based Development

Page 10: Contributing code to cassandra

Cassandra Repo• Cassandra trunk

o 1570+ Java fileso 100,000+ lines of code

• MySQL 5.7o 4200+ c/c++ fileso 1,130,000+ lines of code

Page 11: Contributing code to cassandra

Frequency of Changes

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec0

5

10

15

20

25

30

35

40

45

50

StorageService 2014

# times changed

Page 12: Contributing code to cassandra

Issue tracker

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

Page 13: Contributing code to cassandra

Build

http://cassci.datastax.com/

Page 14: Contributing code to cassandra

How to contribute• Find an issue to work on• Discuss proposed solution• Modify the source• Submit a patch

o Reviewo Voting

• Commit (by committer)

Page 15: Contributing code to cassandra

Submitting a Patch

Page 16: Contributing code to cassandra

My case

Page 17: Contributing code to cassandra

Porting to C*• Events have many attributes• Not all attributes have values• INSERT only• JDBC way - Use PreparedStatement

Page 18: Contributing code to cassandra

My Problem - Tombstones

• INSERT == UPDATE• ‘null’ in prepared statements creates tombstones• Terrible performance• Workarounds

o Using QueryBuildero PreparedStatement for different Permutations of the query

Page 19: Contributing code to cassandra

CASSANDRA-7304• OR: Ability to distinguish between NULL and UNSET values

in Prepared Statements• Discuss solutions on JIRA

o Query Optionso IGNORE_NULLS keywordo Indicate ‘unset’ with a special value

• Accepted solutiono Bound value format <length><data>o Up to binary protocol version 4 a negative length indicates nullo On binary protocol version 4 length -1 for null, -2 unset, error otherwise

• Submit Patch• Review

Page 20: Contributing code to cassandra

Testing CASSANDRA-7304

• Unit testo CQLTester

• Cover all features (tuples, UDT, UDF, etc.)• Distributed Tests (dtests)

Page 21: Contributing code to cassandra

Questions?

Page 22: Contributing code to cassandra

Recap• Apache Project• SCM - Git

o Mainline model• Jira

o Bugs, discussing solutions, code review• Process

o Assign issue, develop, submit patch, review and commit

Page 23: Contributing code to cassandra

Thank You@odpeer