Code Monkey home page Code Monkey logo

stratio-connector-cassandra's Introduction

About

Native connector for Cassandra using Crossdata.

Requirements

Stratio Cassandra version 2.1 must be installed and started.
[Crossdata] (https://github.com/Stratio/crossdata) version 0.2.0-001 is needed to interact with this connector.

Compiling Stratio Connector Cassandra

To automatically build execute the following command:

> mvn clean compile install

Running the Stratio Connector Cassandra

> mvn exec:java -Dexec.mainClass="com.stratio.connector.cassandra.CassandraConnector"

Build an executable Connector Cassandra

To generate the executable execute the following command:

> mvn crossdata-connector:install

To run Connector Cassandra execute:

> target/stratio-connector-cassandra-0.2.0/bin/stratio-connector-cassandra-0.2.0-001 start

To stop the connector execute:

> target/stratio-connector-cassandra-0.2.0/bin/stratio-connector-cassandra-0.2.0-001 stop

How to use Cassandra Connector

  1. Start crossdata-server and then crossdata-shell.

  2. https://github.com/Stratio/crossdata

  3. Start Cassandra Connector as it is explained before

  4. In crossdata-shell:

    Add a data store. We need to specified the XML manifest that defines the data store. The XML manifest can be found in the path of the Cassandra Connector in target/stratio-connector-cassandra-0.2.0/conf/CassandraDataStore.xml

    xdsh:user>  ADD DATASTORE <Absolute path to Cassandra Datastore manifest>;
    

    Attach cluster on that data store. The data store name must be the same as the defined in the data store manifest.

    xdsh:user>  ATTACH CLUSTER <cluster_name> ON DATASTORE <datastore_name> WITH OPTIONS {'Hosts': '[<ipHost_1, ipHost_2,...ipHost_n>]', 'Port': <cassandra_port>};
    

    Add the connector manifest. The XML with the manifest can be found in the path of the Cassandra Connector in target/stratio-connector-cassandra-0.2.0/conf/CassandraConnector.xml

    xdsh:user>  ADD CONNECTOR <Path to Cassandra Connector Manifest>
    

    Attach the connector to the previously defined cluster. The connector name must match the one defined in the Connector Manifest, and the cluster name must match with the previously defined in the ATTACH CLUSTER command.

    xdsh:user>  ATTACH CONNECTOR <connector name> TO <cluster name> WITH OPTIONS {'DefaultLimit': '1000'};
    

    At this point, we can start to send queries, that Crossdata execute with the connector specified.

    xdsh:user> CREATE CATALOG catalogTest;
    
    xdsh:user> USE catalogTest;
    
    xdsh:user> CREATE TABLE tableTest ON CLUSTER cassandra_prod (id int PRIMARY KEY, name text);
    
    xdsh:user> INSERT INTO tableTest(id, name) VALUES (1, 'stratio');
    
    xdsh:user> SELECT * FROM tableTest;
    

License

Stratio Crossdata is licensed as Apache2

Licensed to STRATIO (C) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership. The STRATIO (C) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

stratio-connector-cassandra's People

Contributors

aagea avatar antonioalcocer avatar dhiguero avatar mafernandez-stratio avatar roclas avatar

Watchers

 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.