Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DataStax Java Driver Walkthrough

778 views

Published on

Presenter: Narinder Kumar, VP – Engineering at IntelliGrape

IntelliGrape (now TO THE NEW) organized New Delhi Cassandra Users Meetup in November 2014 and had a 1 hour walkthrough session on DataStax Java Driver API.

This presentation will arm you with the knowledge and hands-on skills on DataStax Java Driver API including topics like:

1. Driver Options with different languages
2. DataStax Java Driver Highlights
3. Key Features
4. Code Demos
5. Debugging & Testing

At the end of the session, we will provide few key takeaways to help the audience while coding with the DataStax Java Driver API.

The tutorial includes the driver options with different languages, highlights of the Datastax Java Driver, key features of Datastax Java Driver, code demos of Datastax Java Driver, Debugging and testing of Datastax Java Driver, key points to keep in mind while coding with Driver. The tutorial begins with a section about the driver options which are available in different languages like C#, Java, GO etc.

It also includes other open source implementations. Following is a Highlights section. It includes the highlights of the Driver like the most recent version as well as new updates like latency, testability, statements etc. Trailing is a section about key features of Datastax Java Driver. It includes features like asynchronous I/O, Automatic failover, Batch statements, CQL-Java data types conversion. After this, the next section is based on code demos of the Driver. It includes code demos like hello world client, loading & querying data in Cassandra, prepared statement & query builder. Afterward comes the debugging and testing of Datastax Java Driver.

It includes debugging of the Driver like enable tracing, configure settings, monitoring and it also includes testing of the Driver like implementing interfaces. The last section of this tutorial talks about the key points to be kept in mind while coding with Driver. It involves key points which a user should keep in mind like one cluster instance per cluster, one session instance per keyspace, considering prepared statement, considering batch operations.

Published in: Technology
  • Be the first to comment

DataStax Java Driver Walkthrough

  1. 1. DataStax Java Driver Walkthrough
  2. 2. DataStaxJava Driver Walkthrough At NewDelhi Cassandra UsersMeetup – November 2014 By: Narinder Kumar
  3. 3. 1. Driver Options with different languages 2. DataStax Java Driver Highlights 3. Key Features a. Asynchronous I/O b. Automatic Failover c. Batch Statements d. CQL – Java Data Types conversion 4. Code Demos a. Hello WorldClient b. Loading & Querying Data in Cassandra c. PreparedStatement & QueryBuilder 5. Debugging &Testing 6. Key Points to keep in mind Agenda
  4. 4. • DataStaxmaintained language driversare available in – C# – Java – Node.js – Python – Ruby – Go • Other open source implementations also available Driver Options with different languages
  5. 5. • Current version2.1.2 • What’s new – Parameterized Statements – Batching prepared Statements – Automatic Result SetPagination – Lightweight Transactions – Latency Aware Policies – Fewer Dependencies – Improved Testability DataStax Java Driver – Highlights
  6. 6. • session.execute(Query) ➔ session.executeAsync(Query) • Returns ResultSet ➔ ResultSetFuture • ResultSetFuture – Implements java.util.concurrent.Future<V> interface Asynchronous I/O
  7. 7. • In case of one / multiple Node failure, Java driver automatically – Tries other nodes – Schedules reconnections • Driver behavior is determined by cluster configuration options Cluster.builder() .addContactPoints(192.168.1.1, 192.168.1.5,…) .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE) .withReconnectionPolicy(new ConstantReconnectionPoloicy(100L)) .build(); Automatic Failover
  8. 8. • Allows execution of multiple statements in one group • Works for Simple as well as PreparedStatements • Can apply timestamp for later queries • May be used to form mini transaction Batch Statements
  9. 9. CQL Java ascii String bigint long blob Java.nio.ByteBuffer counter Long decimal java.math.BigDecimal CQL to Java
  10. 10. Code Demos ReferGithub repo : https://github.com/narinder-kumar/cassandrasample
  11. 11. • Debugging – Enable Tracing onserver side • QueryBuilder….enableTracing() • ResultSet.getExecutionInfo() – Adjust log4j configurationsettings – JMX Monitoring • connectedToHosts(), errorMetrics(), openConnections() • Testing – Inlatest release, lot of classes have been implementing Interfaces. Helps using Mocking frameworks during unit testing Debugging & Testing
  12. 12. • One cluster instance per cluster per application life-time – Easy Configurability • One session instance per keyspace – Expensive object, better shared • Ifexecuting onestatement multiple times, consider PreparedStatement – Faster execution • Consider BatchOperations Key points while coding with Driver
  13. 13. Contact us Have more queries related to AngularJS? Talk To Our Experts! Our Office Client Location Click Here To Know More! Here’s how TOTHENEW helps your customers outsource across the globe using BIG DATA!

×