Coder Social home page Coder Social logo

datastaxquerybuilder's Introduction

DataStax Query Builder

About

This github covers using DataStax Query Builder to do basic CRUD actions

Prerequisites

  • Basic understanding of Docker images and containers.

  • Docker installed on your local system, see Docker Installation Instructions.

  • When using Docker for Mac or Docker for Windows, the default resources allocated to the linux VM running docker are 2GB RAM and 2 CPU's. Make sure to adjust these resources to meet the resource requirements for the containers you will be running. More information can be found here on adjusting the resources allocated to docker.

Docker for mac

Docker for windows

Getting Started

  1. Prepare Docker environment-see the Prerequisites section above...
  2. Pull this github into a directory
git clone https://github.com/jphaugla/datastaxQueryBuilder.git
  1. Refer to the notes from DataStax Docker github for background on the needed DataStax images. Directions are here: https://github.com/datastax/docker-images/#datastax-platform-overview. Don't get too bogged down here as the included docker-compose.yaml handles most everything.
  2. Open terminal and change to the github home where you will see the docker-compose.yml file, then:
docker-compose up -d
  1. Verify DataStax is working (may take a minute for datastax cassandra to startup so be patient)
docker exec dse cqlsh -e "desc keyspaces"
  1. At this point can use the command shell from cassandra using
docker exec -it dse cqlsh

The java code

The java code demonstrates opening a cassandra session using the datastax driver. Next, standard statement execution is used to create a keyspace and a table. Then, inserts and reads are performed using various techniques to document simple statements and QueryBuilder methods. mvn is used to execute all of this

To execute the code

  1. Complile the code
mvn package
  1. Execute the code
mvn exec:java

Conclusion

At this point, run throught the cql worksheet and enjoy playing with Cassandra!

Additional Notes/tips

  • To get the IP address of the DataStax and openldap:
export DSE_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dse)

and:

export LDAP_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' openldap)
  • use echo $DSE_IPE and echo $LDAP_IP to view
  • can add to the docker compose to run additional datastax workloads such as analtyics (-k), search (-s), and graph (-g)
 command:
     -s
     -g
     -k

datastaxquerybuilder's People

Contributors

jphaugla avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.