Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Merge between 0.1.1-RC1 and master branches
Browse files Browse the repository at this point in the history
  • Loading branch information
mafernandez-stratio committed Nov 21, 2014
2 parents 263ea03 + 2368b12 commit af45ded
Show file tree
Hide file tree
Showing 241 changed files with 8,671 additions and 17,653 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ nbactions.xml
nb-configuration.xml
.idea
*.iml
crossdata-core/src/main/java/com/stratio/crossdata/core/grammar/generated
crossdata-shell/src/main/java/com/stratio/crossdata/sh/help/generated
crossdata-core/src/main/java/com/stratio/crossdata/core/grammar/generated/
crossdata-shell/src/main/java/com/stratio/crossdata/sh/help/generated/
src/main/resources/history.txt
*.orig
*/.cache
Expand Down
3 changes: 3 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Stratio Crossdata
Copyright 2014 Stratio

Stratio Meta
Copyright 2014 Stratio

Expand Down
70 changes: 27 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,28 @@

Crossdata (aka Meta) is a distributed framework that unifies the interaction with batch and streaming sources supporting multiple datastore technologies thanks to its generic architecture and a custom SQL-like language with support for streaming queries. Supporting multiple architectures imposes two main challenges: how to normalize the access to the datastores, and how to cope with datastore limitations. To access multiple technologies Crossdata defines a common unifying interface containing the set of operations that a datastore may support. New connectors can be easily added to increase its connectivity capabilities. Two types of connectors are defined: native and spark-based. Native connectors are faster for simple operations, while Spark-based connectors offer a larger set of functionality. The Crossdata planner decides which connector will be used for any request based its characteristics. We offer a shell, Java/REST APIs, and ODBC for BI.

## Full documentation ##

See the Wiki for full documentation, examples, operational details and other information.

See the [Javadoc] () and [Language reference](_doc/Grammar.md) for the internal details.

## Compiling Crossdata ##

Compiling Crossdata involves generating a set of files (.tokens, Lexers, and Parsers) from the different grammar files. To automatically build Stratio Crossdata execute the following command:

```
> mvn clean compile install
```
> mvn clean compile install


## Running the com.stratio.crossdata-server##

```
> mvn exec:java -DskipTests -pl crossdata-server -Dexec.mainClass="com.stratio.crossdata.server.MetaApplication"
```
> mvn exec:java -DskipTests -pl crossdata-server -Dexec.mainClass="com.stratio.crossdata.server.CrossdataApplication"

or you can run our script located in crossdata-dist:

> chmod +x crossdata-dist/target/crossdata-dist-0.1.0/bin/crossdata-server
> cd crossdata-dist/target/crossdata-dist-0.1.0/
> chmod +x crossdata-dist/target/crossdata-dist-[crossdata-version]/bin/crossdata-server
> cd crossdata-dist/target/crossdata-dist-[crossdata-version]/
> bin/crossdata-server

or run it like a service:

> bin/crossdata-server-daemon start



## Running the crosdata-shell ##

Expand All @@ -39,44 +36,35 @@ The shell features:
- Token completion (tab)
- Help command

```
> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell"
```

> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell"

The shell also supports synchronous query execution by means of the --sync parameter. This execution mode is required for streaming queries.

```
> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell" -Dexec.args="--sync"
```
> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell" -Dexec.args="--sync"


Additionally, you can execute an script upon launching the shell. The script will be executed first, and the prompt will be shown afterwards.

```
> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell" -Dexec
.args="--script /path/script.metaql"
```

You can run our shell too, executing our crossdata-dist script:
> mvn exec:java -pl crossdata-shell -Dexec.mainClass="com.stratio.crossdata.sh.Shell" -Dexec.args="--script /path/script.xdql"

> chmod +x crossdata-dist/target/crossdata-dist-0.1.0/bin/crossdata-sh
> cd crossdata-dist/target/crossdata-dist-0.1.0/
> bin/crossdata-sh

You can run our shell too, executing our crossdata-dist script:

## Packaging ##
> chmod +x crossdata-dist/target/crossdata-dist-[crossdata-version]/bin/crossdata-sh
> cd crossdata-dist/target/crossdata-dist-[crossdata-version]/
> bin/crossdata-sh

```
> mvn package
```
See [this link](https://github.com/Stratio/crossdata/edit/release/0.0.4/meta-dist/src/main/include/README.md) to know start/stop the server and the shell from the dist packages


## Useful commands ##

Once the shell is running, you can exit the program introducing the word **exit** or **quit** in the query prompt. A command help system is available by introducing the command **help**. A help entry is available per command, to check specify help topics use **help command**.

## Send issues to Jira ##
You can send us issues in https://com.stratio.crossdata.atlassian.net
You can send us issues in https://crossdata.atlassian.net/


## Grammar ##
Expand All @@ -85,22 +73,18 @@ Grammar specification for this release can be found [here](_doc/Grammar.md).

## Getting started ##
In this [link](_doc/GettingStarted.md) you can follow an example of Crossdata with a Cassandra Connector as an access
to a Cassandra data store.
to a Cassandra datastore.


## Connectors ##
Crossdata can use this connectors:

[Cassandra Connector](https://github.com/Stratio/stratio-connector-cassandra)

[Stratio Deep Connector](https://github.com/Stratio/stratio-connector-deep)

[MongoDB Connector](https://github.com/Stratio/stratio-connector-mongodb)
[List of Crossdata Connectors](_doc/List-of-Crossdata-Connectors.md)

[ElasticSearch Connector](https://github.com/Stratio/stratio-connector-elasticsearch)
[InMemory Connector development tutorial](_doc/InMemory-Connector-Development-Tutorial.md)

[Stratio Streaming Connector](https://github.com/Stratio/stratio-connector-streaming)
[Definition of Connector Operations](_doc/ConnectorOperations.md)

[Crossdata Connector Challenge](https://stratio.github.io/crossdata/contest)

# License #

Expand Down
141 changes: 141 additions & 0 deletions _doc/ConnectorOperations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Connector Operations #

This document will provided a detailed description of the different operations that can be supported by a Crossdata
connector. The document is organized as follows:

1. [Definition of Connector Operation](#definition-of-connector-operation)
2. [Types of Operations](#types-of-operations)
1. [Metadata](#project)
2. [Storage](#filter)
3. [Query](#select)
3. [More information](#more-information)

Definition of Connector Operation
=================================

A connector operation defines a capability a connector provides. All connector operations must be declared in their
associated manifest. As an example, consider the following *InMemoryConnector.xml* manifest

```xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the manifest for the connector. -->
<Connector>
<!-- Name of the connector as it will be identified in Crossdata -->
<ConnectorName>InMemoryConnector</ConnectorName>
<!-- Define the list of datastore this connector is able to access. -->
<DataStores>
<DataStoreName>InMemoryDatastore</DataStoreName>
</DataStores>
<!-- Connector version -->
<Version>0.0.1</Version>

<!-- Define the set of required operations the user will be asked to input
when attaching the connector -->

<!--OptionalProperties>
<Property>
<PropertyName>TableRowLimit</PropertyName>
<Description>Limit of rows allowed per table</Description>
</Property>
</OptionalProperties-->

<!-- Define the list of operations supported by the connector.
Check crossdata/doc/ConnectorOperations.md for more information. -->
<SupportedOperations>
<operation>CREATE_CATALOG</operation>
<operation>DROP_CATALOG</operation>
<operation>CREATE_TABLE</operation>
<operation>DROP_TABLE</operation>
<operation>TRUNCATE_TABLE</operation>
<operation>INSERT</operation>
<operation>PROJECT</operation>
<operation>SELECT_OPERATOR</operation>
<operation>SELECT_LIMIT</operation>
<operation>FILTER_PK_EQ</operation>
<operation>FILTER_PK_GT</operation>
<operation>FILTER_PK_LT</operation>
<operation>FILTER_PK_GET</operation>
<operation>FILTER_PK_LET</operation>
<operation>FILTER_NON_INDEXED_EQ</operation>
<operation>FILTER_NON_INDEXED_GT</operation>
<operation>FILTER_NON_INDEXED_LT</operation>
<operation>FILTER_NON_INDEXED_GET</operation>
<operation>FILTER_NON_INDEXED_LET</operation>
</SupportedOperations>
</Connector>
```

Each operation is associated with the methods found in *IMetadataEngine*, *IStorageEngine*,
and *IQueryEngine*. The following section provides a detailed description of each operation organized by the type of
operation.

Types of Operations
===================

The connector operations are organized attending to the type of operation to be performed: Metadata, Storage,
and Query. In order to simplify the definition of the different connector, two concepts are taken into account:
*column_type*, and *relationship*.

The column type is identified by Crossdata during the query analysis with the following types:

| column_type | Description |
|--------|------------|
| PK | The column is part of the primary key. |
| INDEXED | The column is indexed. |
| NON_INDEXED | The column is not indexed. |
| FUNCTION | A function is associated with the column. |

With respect to the relationship, Crossdata supports:

| relationship | Description |
|--------|------------|
| EQ | Equals. |
| GT | Greater than. |
| LT | Less than. |
| GET | Greater or equal than. |
| LET | Less or equal than. |
| ASSIGN | A value is to be assigned to a column. |
| MATCH | Compare a column with a Lucene-like expression. |

Metadata
--------

Metadata operations are those associated with the *IMetadataEngine* interface.

* **CREATE_CATALOG**: Create new catalogs.
* **DROP_CATALOG**: Delete existing catalogs.
* **CREATE_TABLE**: Create a new table.
* **ALTER_TABLE**: Alter the definition of an existing table.
* **DROP_TABLE**: Drop an existing table.
* **CREATE_INDEX**: Create a new index.
* **DROP_INDEX**: Drop an existing index.

Storage
-------

* **INSERT**: Insert a new row in the datastore. By default inserts are considered upsert operations.
* **INSERT_IF_NOT_EXISTS**: Insert a new row in the datastore if that row does not exists without the upsert behaviour.
* **DELETE_<column_type>_<relationship>**: Delete rows for the given type of columns and relationships.
* **UPDATE_<column_type>_<relationship>**: Update rows for the give type of columns and relationships.
* **TRUNCATE_TABLE**: Truncate the contents of an existing table.


Query
-----

* **ASYNC_QUERY**: Support for asynchronous query execution.
* **PROJECT**: Retrieve a set of columns from a specific table.
* **SELECT_OPERATOR**: Select a set of output columns for a query with alias.
* **SELECT_WINDOW**: Supports WINDOW clauses for streaming-like queries.
* **SELECT_LIMIT**: Limit the number of output rows.
* **SELECT_INNER_JOIN**: Support for INNER JOIN operations.
* **SELECT_INNER_JOIN_PARTIALS_RESULTS**: Support for INNER JOIN with one source already defined.
* **SELECT_ORDER_BY**: Support for ORDER BY clauses.
* **SELECT_GROUP_BY**: Support for GROUP BY clauses.
* **FILTER_<column_type>_<relationship>**: Filter a column by a particular relationship.

More information
================

For more information, check the [project documentation](stratio.github.io/crossdata).
6 changes: 4 additions & 2 deletions _doc/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ And then, run it:
> target/stratio-connector-cassandra-0.1.0/bin/stratio-connector-cassandra-0.1.0 start
```

**NOTE:** All the connectors have to be started once CrossdataServer is already running!

Now, from the Crossdata Shell we can write the following commands:

Add a data store. We need to specified the XML manifest that defines the data store. The XML manifest can be found
Expand All @@ -37,7 +39,7 @@ Add the connector manifest. The XML with the manifest can be found in the path o
target/stratio-connector-cassandra-0.1.0/conf/CassandraConnector.xml

```
xdsh:user> ADD CONNECTOR <Path to Cassandra Connector Manifest>
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
Expand All @@ -54,7 +56,7 @@ At this point, we can start to send queries, that Crossdata execute with the con

xdsh:user> USE catalogTest;

xdsh:user> CREATE TABLE tableTest ON CLUSTER cassandra_prod (id int PRIMARY KEY, name text);
xdsh:user> CREATE TABLE tableTest ON CLUSTER <cluster name> (id int PRIMARY KEY, name text);

xdsh:user> INSERT INTO tableTest(id, name) VALUES (1, 'stratio');

Expand Down
Loading

0 comments on commit af45ded

Please sign in to comment.