Contributing code to cassandra

Post on 09-Apr-2017

296 views 2 download

Transcript of Contributing code to cassandra

Contributing code to

CassandraTel Aviv Cassandra Meetup

May 2015

Oded Peer, RSA Security

Brief History

2007

February 2010Jan 2009

July 2008

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

Getting involved• Reporting bugs

• Testing patches

• Help others on the mailing list

• Submitting patches

Dev Roles

Contributor Committer

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

Source Control

Patches, not pull requests

Branching model• Mainline model

Alternative - Trunk Based Development

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

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

Issue tracker

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

Build

http://cassci.datastax.com/

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

o Reviewo Voting

• Commit (by committer)

Submitting a Patch

My case

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

My Problem - Tombstones

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

o Using QueryBuildero PreparedStatement for different Permutations of the query

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

Testing CASSANDRA-7304

• Unit testo CQLTester

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

Questions?

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

Thank You@odpeer