SlideShare una empresa de Scribd logo
1 de 14
DataStax Java
Driver Walkthrough
DataStaxJava Driver Walkthrough
At
NewDelhi Cassandra UsersMeetup – November 2014
By: Narinder Kumar
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
• DataStaxmaintained language driversare available in
– C#
– Java
– Node.js
– Python
– Ruby
– Go
• Other open source implementations also available
Driver Options with different languages
• 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
• session.execute(Query) ➔ session.executeAsync(Query)
• Returns ResultSet ➔ ResultSetFuture
• ResultSetFuture
– Implements java.util.concurrent.Future<V> interface
Asynchronous I/O
• 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
• 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
CQL Java
ascii String
bigint long
blob Java.nio.ByteBuffer
counter Long
decimal java.math.BigDecimal
CQL to Java
Code Demos
ReferGithub repo : https://github.com/narinder-kumar/cassandrasample
• 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
• 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
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!

Más contenido relacionado

Destacado

40 plus presentation
40 plus presentation40 plus presentation
40 plus presentation
Zoe-Ann Lynch
 
The art of keeping cool hunter kyle austin
The art of keeping cool hunter kyle austinThe art of keeping cool hunter kyle austin
The art of keeping cool hunter kyle austin
Sharon Matney
 
3 montages of different live performances
3 montages of different live performances3 montages of different live performances
3 montages of different live performances
sathma
 
WTE Treament Basics English
WTE Treament Basics EnglishWTE Treament Basics English
WTE Treament Basics English
Rafael Salzar
 
AWS CodeDeploy
AWS CodeDeployAWS CodeDeploy
AWS CodeDeploy
TO THE NEW | Technology
 

Destacado (18)

Serious games & gamification voor het onderwijs
Serious games & gamification voor het onderwijsSerious games & gamification voor het onderwijs
Serious games & gamification voor het onderwijs
 
FUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 ThemeFUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 Theme
 
Unicef
UnicefUnicef
Unicef
 
Scambio sul posto dell\'energia
Scambio sul posto dell\'energiaScambio sul posto dell\'energia
Scambio sul posto dell\'energia
 
Martin Luther King Service Project
Martin Luther King Service ProjectMartin Luther King Service Project
Martin Luther King Service Project
 
40 plus presentation
40 plus presentation40 plus presentation
40 plus presentation
 
The art of keeping cool hunter kyle austin
The art of keeping cool hunter kyle austinThe art of keeping cool hunter kyle austin
The art of keeping cool hunter kyle austin
 
Corporate Training Programs
Corporate Training ProgramsCorporate Training Programs
Corporate Training Programs
 
T-Systems Core Belief Collaboration - Portfolio Overview
T-Systems Core Belief Collaboration - Portfolio OverviewT-Systems Core Belief Collaboration - Portfolio Overview
T-Systems Core Belief Collaboration - Portfolio Overview
 
Numeros
NumerosNumeros
Numeros
 
Ppt qa 2
Ppt qa 2Ppt qa 2
Ppt qa 2
 
Office 365 voor het onderwijs
Office 365 voor het onderwijsOffice 365 voor het onderwijs
Office 365 voor het onderwijs
 
3 montages of different live performances
3 montages of different live performances3 montages of different live performances
3 montages of different live performances
 
Mn powerpoint
Mn powerpointMn powerpoint
Mn powerpoint
 
Behavioural Marketing. Connecting the big 4 of web, email, social & mobile
Behavioural Marketing.  Connecting the big 4 of web, email, social & mobile Behavioural Marketing.  Connecting the big 4 of web, email, social & mobile
Behavioural Marketing. Connecting the big 4 of web, email, social & mobile
 
WTE Treament Basics English
WTE Treament Basics EnglishWTE Treament Basics English
WTE Treament Basics English
 
Sergio Santos Portfolio
Sergio Santos PortfolioSergio Santos Portfolio
Sergio Santos Portfolio
 
AWS CodeDeploy
AWS CodeDeployAWS CodeDeploy
AWS CodeDeploy
 

Más de TO THE NEW | Technology

12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C
TO THE NEW | Technology
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
TO THE NEW | Technology
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
TO THE NEW | Technology
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearch
TO THE NEW | Technology
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
TO THE NEW | Technology
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to Kanban
TO THE NEW | Technology
 

Más de TO THE NEW | Technology (20)

10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!
 
12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C
 
Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Grails Spring Boot
Grails Spring BootGrails Spring Boot
Grails Spring Boot
 
AWS Elastic Beanstalk
AWS Elastic BeanstalkAWS Elastic Beanstalk
AWS Elastic Beanstalk
 
Content migration to AEM
Content migration to AEMContent migration to AEM
Content migration to AEM
 
Big Data Expertise
Big Data ExpertiseBig Data Expertise
Big Data Expertise
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Cloud Formation
Cloud FormationCloud Formation
Cloud Formation
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearch
 
JULY IN GRAILS
JULY IN GRAILSJULY IN GRAILS
JULY IN GRAILS
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
 
Getting groovier-with-vertx
Getting groovier-with-vertxGetting groovier-with-vertx
Getting groovier-with-vertx
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to Kanban
 
Introduction to Heroku
Introduction to HerokuIntroduction to Heroku
Introduction to Heroku
 
Node JS
Node JSNode JS
Node JS
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

DataStax Java Driver Walkthrough

  • 1.
  • 3. DataStaxJava Driver Walkthrough At NewDelhi Cassandra UsersMeetup – November 2014 By: Narinder Kumar
  • 4. 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
  • 5. • DataStaxmaintained language driversare available in – C# – Java – Node.js – Python – Ruby – Go • Other open source implementations also available Driver Options with different languages
  • 6. • 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
  • 7. • session.execute(Query) ➔ session.executeAsync(Query) • Returns ResultSet ➔ ResultSetFuture • ResultSetFuture – Implements java.util.concurrent.Future<V> interface Asynchronous I/O
  • 8. • 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
  • 9. • 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
  • 10. CQL Java ascii String bigint long blob Java.nio.ByteBuffer counter Long decimal java.math.BigDecimal CQL to Java
  • 11. Code Demos ReferGithub repo : https://github.com/narinder-kumar/cassandrasample
  • 12. • 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
  • 13. • 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
  • 14. 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!