SlideShare a Scribd company logo
Building an IDE for Apache Cassandra
With Eclipse RCP, e4 and XText
Michaël Figuière
Software Architect
© 2014 DataStax, All Rights Reserved.
Cassandra Peer to Peer Architecture
2
Node
Node Node
Node
Node
Node
Clients can reach any of the
Cassandra nodes
Every node have the same role,
there’s no Master or Slave
© 2014 DataStax, All Rights Reserved.
Cassandra Peer to Peer Architecture
3
Node
Node Replica
Replica
Replica
Node
Each partition is stored in
several Replicas to ensure
durability and high availability
© 2014 DataStax, All Rights Reserved.
Linear Scalability
4
Client Writes/s by Node Count - Replication Factor = 3
© 2014 DataStax, All Rights Reserved.
Cassandra Query Language (CQL)
• Similar to SQL, mostly a subset
• Without joins, sub-queries, and aggregations
• Primary Key contains:
• A Partition Key used to select the partition that will store the Row
• Some Clustering Columns, used to define how Rows should be grouped
and sorted on the disk
• Supports Collections
• Supports User Defined Types (UDT)
5
© 2014 DataStax, All Rights Reserved. 6
CQL: Create Table
CREATE TABLE users (
login text,
name text,
age int,
...
PRIMARY KEY (login));
login is the partition key, it will
be hashed and rows will be
spread over the cluster on
different partitions
Just like in SQL!
© 2014 DataStax, All Rights Reserved. 7
CQL: Clustered Table
CREATE TABLE mailbox (
login text,
message_id timeuuid,
interlocutor text,
message text,
PRIMARY KEY(login, message_id)
);
message_id is a clustering column,
it means that all the rows with a
same login will be grouped and
sorted by message_id on the disk
A TimeUUID is a UUID that
can be sorted chronologically
© 2014 DataStax, All Rights Reserved. 8
CQL: Queries
SELECT * FROM mailbox
WHERE login = jdoe
AND message_id = '2014-09-25 16:00:00';
Get message by user and message_id (date)
SELECT * FROM mailbox WHERE login = jdoe
AND message_id <= '2014-09-25 16:00:00'
AND message_id >= '2014-09-20 16:00:00';
Get message by user and date interval
WHERE clauses can only be constraints
on the primary key and range queries are
not possible on the partition key
© 2014 DataStax, All Rights Reserved.
DataStax DevCenter
• Eclipse RCP standalone application
• Eclipse 3.x + e4
• CQL editor based on Xtext
• 1.0.0 in October 2013 - 1.3.0 March 2015
• Supports Cassandra 1.2 - 2.1
• Tens of thousands of downloads / month
9
DataStax DevCenter
Demo
© 2014 DataStax, All Rights Reserved.
Xtext with CQL
11
ValidationCQL Grammar
Content Assist Quick Fixes
Syntax HighlightingFormatting
Can be extracted as a standalone library
© 2014 DataStax, All Rights Reserved. 12
Validation and Quick Fix
Validation
@Fix(CqlConstants.KEYSPACE_EXIST)
public void addIfNotExistst(final Issue issue, IssueResolutionAcceptor acceptor)
{
...
createKeyspaceStmt.setIfNotExists(true);
...
}
Quick Fix
@Check
public void checkKeyspaceNotExist(CreateKeyspaceStatement stmt)
{
if (context.isKeyspaceExistInDatabase(stmt.getKeyspaceEntity()))
error(KEYSPACE_ALREADY_EXISTS, stmt, CqlConstants.KEYSPACE_EXIST);
}
© 2014 DataStax, All Rights Reserved.
Cassandra + Script Context
13
© 2014 DataStax, All Rights Reserved.
Current Schema for Each Statement
14
© 2014 DataStax, All Rights Reserved. 15
Xtext Embedded Editor
@Inject
private EmbeddedEditorFactory factory;
editor = factory
.newEditor(resourceProvider)
.readOnly()
.withResourceValidator(resourceValidator)
.processIssuesBy(issueProcessor)
.withParent(container);
partialEditor = editor.createPartialEditor();
Injected through
Xtext’s Guice context
The SWT Container
the editor should be
inserted in
© 2014 DataStax, All Rights Reserved. 16
Benefits of e4
Dependency Injection
@Inject
IEventBroker broker;
public void doSomething() {
broker.send(TOPIC, "some data");
}
Events Handling
@Inject
public void create(Composite parent, IWorkbenchHelpSystem help) {
Button button = ...;
help.setHelp(button, "com.example.button.help.id");
}
@Inject
public void receive(@EventTopic(TOPIC) Object data) {
fullRefresh();
}
© 2014 DataStax, All Rights Reserved.
DevCenter and e4
• DevCenter cannot be a pure e4 application…
• Relies on Xtext and Eclipse Editor
• Eclipse IDE doesn’t rely on the e4 Application Model yet
• …but can still use e4 through adapters on top of Eclipse 3.x
17
© 2014 DataStax, All Rights Reserved.
E4 in a Eclipse 3.x Plugin
18
DIViewPart Adapter
E4View
Eclipse 3.x Plugin
Eclipse technical
code goes here
Application
logic sits here
Questions?
@mfiguiere
blog.datastax.com
github.com/datastax

More Related Content

PDF
Paris Cassandra Meetup - Cassandra for Developers
PDF
YaJug - Cassandra for Java Developers
PDF
Geneva JUG - Cassandra for Java Developers
PDF
NYC* Tech Day - New Cassandra Drivers in Depth
PDF
Paris Cassandra Meetup - Overview of New Cassandra Drivers
PDF
In-depth caching in Varnish - GOG Varnish Meetup, march 2019
PPTX
Apache zookeeper 101
PPTX
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
Paris Cassandra Meetup - Cassandra for Developers
YaJug - Cassandra for Java Developers
Geneva JUG - Cassandra for Java Developers
NYC* Tech Day - New Cassandra Drivers in Depth
Paris Cassandra Meetup - Overview of New Cassandra Drivers
In-depth caching in Varnish - GOG Varnish Meetup, march 2019
Apache zookeeper 101
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...

What's hot (20)

PDF
Apache Cassandra and Drivers
PPTX
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
PDF
06 response-headers
PPTX
Apache zookeeper seminar_trinh_viet_dung_03_2016
PDF
Hazelcast
PPTX
Introduction to Apache ZooKeeper
PPTX
SCWCD : Thread safe servlets : CHAP : 8
PPTX
Hazelcast Essentials
PPTX
High Throughput Analytics with Cassandra & Azure
PPTX
Using Spark to Load Oracle Data into Cassandra
PDF
Building Reactive Microservices with Vert.x
PPTX
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
PPTX
OpenStack Keystone
PDF
Ice mini guide
PDF
Cassandra 3.0 advanced preview
PDF
Introduction to Cassandra Basics
PDF
Bulk Loading Data into Cassandra
PDF
Keystone deep dive 1
PDF
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
PDF
Distribute Key Value Store
Apache Cassandra and Drivers
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
06 response-headers
Apache zookeeper seminar_trinh_viet_dung_03_2016
Hazelcast
Introduction to Apache ZooKeeper
SCWCD : Thread safe servlets : CHAP : 8
Hazelcast Essentials
High Throughput Analytics with Cassandra & Azure
Using Spark to Load Oracle Data into Cassandra
Building Reactive Microservices with Vert.x
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
OpenStack Keystone
Ice mini guide
Cassandra 3.0 advanced preview
Introduction to Cassandra Basics
Bulk Loading Data into Cassandra
Keystone deep dive 1
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
Distribute Key Value Store
Ad

Viewers also liked (7)

PDF
E(fx)clipse eclipse con
PDF
The Next Generation Eclipse Graphical Editing Framework
PDF
GEF4 - Sightseeing Mars
PDF
Managing XML documents with Epsilon
PDF
GEF(4) Dot Oh Dot Oh
PPTX
PPTX
E(fx)clipse eclipse con
The Next Generation Eclipse Graphical Editing Framework
GEF4 - Sightseeing Mars
Managing XML documents with Epsilon
GEF(4) Dot Oh Dot Oh
Ad

Similar to EclipseCon - Building an IDE for Apache Cassandra (20)

PPTX
DataStax NYC Java Meetup: Cassandra with Java
PDF
Cassandra 2.0 and timeseries
PDF
Cassandra Summit 2013 Keynote
PDF
Introduction to Apache Cassandra
PDF
Going native with Apache Cassandra
PDF
Unlock cassandra data for application developers using graphQL
PDF
Helsinki Cassandra Meetup #2: Introduction to CQL3 and DataModeling
PDF
Presentation.pdf
PPTX
Managing Objects and Data in Apache Cassandra
PPTX
Appache Cassandra
PDF
Introduction to CQL and Data Modeling with Apache Cassandra
PDF
Trivadis TechEvent 2016 Big Data Cassandra, wieso brauche ich das? by Jan Ott
PDF
Cassandra: An Alien Technology That's not so Alien
PDF
CQL In Cassandra 1.0 (and beyond)
PPTX
Spring Data Cassandra
PDF
Cassandra and Spark
PPTX
Cassandra Java APIs Old and New – A Comparison
PDF
Cassandra drivers and libraries
PPTX
Cassandra
PPTX
CQL, then and now
DataStax NYC Java Meetup: Cassandra with Java
Cassandra 2.0 and timeseries
Cassandra Summit 2013 Keynote
Introduction to Apache Cassandra
Going native with Apache Cassandra
Unlock cassandra data for application developers using graphQL
Helsinki Cassandra Meetup #2: Introduction to CQL3 and DataModeling
Presentation.pdf
Managing Objects and Data in Apache Cassandra
Appache Cassandra
Introduction to CQL and Data Modeling with Apache Cassandra
Trivadis TechEvent 2016 Big Data Cassandra, wieso brauche ich das? by Jan Ott
Cassandra: An Alien Technology That's not so Alien
CQL In Cassandra 1.0 (and beyond)
Spring Data Cassandra
Cassandra and Spark
Cassandra Java APIs Old and New – A Comparison
Cassandra drivers and libraries
Cassandra
CQL, then and now

More from Michaël Figuière (19)

PDF
ChtiJUG - Cassandra 2.0
PDF
Cassandra summit 2013 - DataStax Java Driver Unleashed!
PDF
ApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
PDF
NoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
PDF
GTUG Nantes (Dec 2011) - BigTable et NoSQL
PDF
Duchess France (Nov 2011) - Atelier Apache Mahout
PDF
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
PDF
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
PDF
Mix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
PDF
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
PDF
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
PDF
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4
PDF
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
PDF
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
PDF
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
PDF
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
PPTX
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalité
PPTX
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
PPTX
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
ChtiJUG - Cassandra 2.0
Cassandra summit 2013 - DataStax Java Driver Unleashed!
ApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
NoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
GTUG Nantes (Dec 2011) - BigTable et NoSQL
Duchess France (Nov 2011) - Atelier Apache Mahout
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
Mix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalité
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...

Recently uploaded (20)

PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
project resource management chapter-09.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
DP Operators-handbook-extract for the Mautical Institute
Accuracy of neural networks in brain wave diagnosis of schizophrenia
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative analysis of optical character recognition models for extracting...
Zenith AI: Advanced Artificial Intelligence
Hindi spoken digit analysis for native and non-native speakers
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Web App vs Mobile App What Should You Build First.pdf
project resource management chapter-09.pdf
WOOl fibre morphology and structure.pdf for textiles
Tartificialntelligence_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
OMC Textile Division Presentation 2021.pptx
Hybrid model detection and classification of lung cancer
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A comparative study of natural language inference in Swahili using monolingua...
NewMind AI Weekly Chronicles - August'25-Week II
A novel scalable deep ensemble learning framework for big data classification...
DP Operators-handbook-extract for the Mautical Institute

EclipseCon - Building an IDE for Apache Cassandra

  • 1. Building an IDE for Apache Cassandra With Eclipse RCP, e4 and XText Michaël Figuière Software Architect
  • 2. © 2014 DataStax, All Rights Reserved. Cassandra Peer to Peer Architecture 2 Node Node Node Node Node Node Clients can reach any of the Cassandra nodes Every node have the same role, there’s no Master or Slave
  • 3. © 2014 DataStax, All Rights Reserved. Cassandra Peer to Peer Architecture 3 Node Node Replica Replica Replica Node Each partition is stored in several Replicas to ensure durability and high availability
  • 4. © 2014 DataStax, All Rights Reserved. Linear Scalability 4 Client Writes/s by Node Count - Replication Factor = 3
  • 5. © 2014 DataStax, All Rights Reserved. Cassandra Query Language (CQL) • Similar to SQL, mostly a subset • Without joins, sub-queries, and aggregations • Primary Key contains: • A Partition Key used to select the partition that will store the Row • Some Clustering Columns, used to define how Rows should be grouped and sorted on the disk • Supports Collections • Supports User Defined Types (UDT) 5
  • 6. © 2014 DataStax, All Rights Reserved. 6 CQL: Create Table CREATE TABLE users ( login text, name text, age int, ... PRIMARY KEY (login)); login is the partition key, it will be hashed and rows will be spread over the cluster on different partitions Just like in SQL!
  • 7. © 2014 DataStax, All Rights Reserved. 7 CQL: Clustered Table CREATE TABLE mailbox ( login text, message_id timeuuid, interlocutor text, message text, PRIMARY KEY(login, message_id) ); message_id is a clustering column, it means that all the rows with a same login will be grouped and sorted by message_id on the disk A TimeUUID is a UUID that can be sorted chronologically
  • 8. © 2014 DataStax, All Rights Reserved. 8 CQL: Queries SELECT * FROM mailbox WHERE login = jdoe AND message_id = '2014-09-25 16:00:00'; Get message by user and message_id (date) SELECT * FROM mailbox WHERE login = jdoe AND message_id <= '2014-09-25 16:00:00' AND message_id >= '2014-09-20 16:00:00'; Get message by user and date interval WHERE clauses can only be constraints on the primary key and range queries are not possible on the partition key
  • 9. © 2014 DataStax, All Rights Reserved. DataStax DevCenter • Eclipse RCP standalone application • Eclipse 3.x + e4 • CQL editor based on Xtext • 1.0.0 in October 2013 - 1.3.0 March 2015 • Supports Cassandra 1.2 - 2.1 • Tens of thousands of downloads / month 9
  • 11. © 2014 DataStax, All Rights Reserved. Xtext with CQL 11 ValidationCQL Grammar Content Assist Quick Fixes Syntax HighlightingFormatting Can be extracted as a standalone library
  • 12. © 2014 DataStax, All Rights Reserved. 12 Validation and Quick Fix Validation @Fix(CqlConstants.KEYSPACE_EXIST) public void addIfNotExistst(final Issue issue, IssueResolutionAcceptor acceptor) { ... createKeyspaceStmt.setIfNotExists(true); ... } Quick Fix @Check public void checkKeyspaceNotExist(CreateKeyspaceStatement stmt) { if (context.isKeyspaceExistInDatabase(stmt.getKeyspaceEntity())) error(KEYSPACE_ALREADY_EXISTS, stmt, CqlConstants.KEYSPACE_EXIST); }
  • 13. © 2014 DataStax, All Rights Reserved. Cassandra + Script Context 13
  • 14. © 2014 DataStax, All Rights Reserved. Current Schema for Each Statement 14
  • 15. © 2014 DataStax, All Rights Reserved. 15 Xtext Embedded Editor @Inject private EmbeddedEditorFactory factory; editor = factory .newEditor(resourceProvider) .readOnly() .withResourceValidator(resourceValidator) .processIssuesBy(issueProcessor) .withParent(container); partialEditor = editor.createPartialEditor(); Injected through Xtext’s Guice context The SWT Container the editor should be inserted in
  • 16. © 2014 DataStax, All Rights Reserved. 16 Benefits of e4 Dependency Injection @Inject IEventBroker broker; public void doSomething() { broker.send(TOPIC, "some data"); } Events Handling @Inject public void create(Composite parent, IWorkbenchHelpSystem help) { Button button = ...; help.setHelp(button, "com.example.button.help.id"); } @Inject public void receive(@EventTopic(TOPIC) Object data) { fullRefresh(); }
  • 17. © 2014 DataStax, All Rights Reserved. DevCenter and e4 • DevCenter cannot be a pure e4 application… • Relies on Xtext and Eclipse Editor • Eclipse IDE doesn’t rely on the e4 Application Model yet • …but can still use e4 through adapters on top of Eclipse 3.x 17
  • 18. © 2014 DataStax, All Rights Reserved. E4 in a Eclipse 3.x Plugin 18 DIViewPart Adapter E4View Eclipse 3.x Plugin Eclipse technical code goes here Application logic sits here