Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
a0222e9
Started new module for Mongodb
janakact May 17, 2016
6c019d9
Created Tablespace
janakact May 21, 2016
b19c629
Improved import
janakact May 21, 2016
98b99ac
Created MongoDbFragment
janakact May 21, 2016
6065d19
Created MongoDb Scanner
janakact May 21, 2016
780d285
Created MonogoDb Appender
janakact May 21, 2016
3231ea9
Added ConnectionInfo
janakact May 21, 2016
bf3be8f
Added missing Licensed details
janakact May 21, 2016
6568afc
Removed Plugins
janakact May 21, 2016
c7fec80
Added a dummy test code
janakact May 21, 2016
989f466
Merged
janakact May 23, 2016
36f2738
Changed fragment to abstract class
janakact May 23, 2016
531ae8c
Implemented connection info for single host
janakact May 25, 2016
43f7c72
fixed an trivial bug
janakact May 25, 2016
c46cd9b
Changed, pom.xml storeg to copy jars
janakact May 26, 2016
4d1019c
Update TestConnectionInfo.java
janakact May 27, 2016
e8adf19
Added Storage and Format Property
May 30, 2016
3d48fbb
TAJO-2148: Implement an example HTTP tablespace.
jihoonson May 31, 2016
d5d89b9
Change module order
jihoonson May 31, 2016
3fbb4da
Fix test failures
jihoonson Jun 1, 2016
a14c081
Remove unnecessary changes
jihoonson Jun 2, 2016
50162be
Changed Db->DB and dependancy fongo added
Jun 2, 2016
b1595ee
Added Shade
Jun 2, 2016
08f867c
Changed settings
Jun 2, 2016
eac1662
Removed the shade plugin
Jun 6, 2016
5f6cefc
Before implementing test server
Jun 7, 2016
02c3aef
Server and One TestCase
Jun 7, 2016
501f2f3
Added license
Jun 7, 2016
1b1256a
Server runs
Jun 7, 2016
6642075
Add tablespace for test
Jun 7, 2016
4ffcf76
Added Metadata Provider
Jun 7, 2016
f903754
Load data to server
Jun 8, 2016
22dd1da
Server works and load data
Jun 8, 2016
87aee6d
Disable example http tablespace for http scheme by default.
jihoonson Jun 9, 2016
5dc4914
Doc Added
Jun 10, 2016
3ec5ea4
Added the basic content to the doc
Jun 10, 2016
dbda0bf
Create and Purge Table
Jun 10, 2016
52ffa95
Implemented the getSplit and getVolume
Jun 11, 2016
fd85344
Fixed typos
Jun 14, 2016
4c49d6b
Fixed not stoping issue
Jun 14, 2016
5d669c6
QueryTestBase
Jun 14, 2016
6f44b8c
Added Handlers
Jun 21, 2016
d6e3d2d
Fixed name issue in description
Jun 21, 2016
19d0269
Constructer created
Jun 21, 2016
b6270fc
changed storage type to 'mongodb' from 'rawdata'
Jun 21, 2016
540fff5
Added some lines for scanner
Jun 23, 2016
747e02a
Added Protoc, moving to file space
Jun 24, 2016
4594610
Merged to Jihoons branch
Jun 24, 2016
a5b2245
Created a collection reader class, scanner get called
Jun 24, 2016
73786bc
simple fault
Jun 24, 2016
2b74a28
Making Collection Reader
Jun 24, 2016
1242ea2
Implemented a scanner. reads well, testing only single line
Jun 24, 2016
a73b186
Multiple lines, do not support composite attributes
Jun 24, 2016
8d0e074
Configured to support both file and not file
Jun 25, 2016
0fa19bf
Added test cases to test Join, Groupby, Sort
Jul 27, 2016
b59d553
Inheritance removed because there is no use in parent class.
Jul 28, 2016
aed6b35
Commeted the previous code
Jul 28, 2016
005af16
New test case to insert
janakact Aug 3, 2016
68d1774
Commented the insert test which in not yet setup
janakact Aug 3, 2016
6eb9d26
commented the insert test
janakact Aug 4, 2016
c12eab0
merged with the apache git repo
janakact Aug 4, 2016
192bc69
commented insert
janakact Aug 4, 2016
87375c0
Added appender, CollectionWriter, DocumentSerializer
janakact Aug 5, 2016
ca18ca8
Implemented the text type for appender
janakact Aug 5, 2016
adaa3a8
Set metadataProvided=false
janakact Aug 5, 2016
41f27d4
Refactor Deserialize to Serialize
janakact Aug 5, 2016
71e3a64
Add to collection
janakact Aug 5, 2016
1e815a3
to make a test case
janakact Aug 9, 2016
2ad84f5
Mongo Appender added to storage
janakact Aug 10, 2016
5ab8fea
Removed an unnecessary line
janakact Aug 10, 2016
06e7553
Fixed teardown issue
janakact Aug 10, 2016
380c5d0
Optimized import and Metadata enabled
janakact Aug 10, 2016
2ecb0c9
Fixed purge issue
janakact Aug 10, 2016
42f8d7c
Fixed some storage configurations
janakact Aug 10, 2016
2a22f8b
Enabled using config keys
janakact Aug 12, 2016
a662f90
Improved the document
janakact Aug 12, 2016
d0811f6
Changed driver version to 3.3
janakact Aug 12, 2016
9a1b2fd
Improved the document
janakact Aug 12, 2016
0b8ad14
Update mongodb.rst
janakact Aug 12, 2016
2ed2e36
Improving appender
janakact Aug 12, 2016
717660e
Merge branch 'TAJO-2079-FileSpace' of https://github.com/janakact/taj…
janakact Aug 12, 2016
8148edc
Delete after insert test
janakact Aug 16, 2016
b19fb73
Added more tests for serializer
janakact Aug 16, 2016
04a789f
Improved appender test to test float, bool, int
janakact Aug 16, 2016
894f7fa
Enabled flush and writing all tuples together
janakact Aug 16, 2016
873a6cb
Removed File Scanner
janakact Aug 16, 2016
1159a2e
Removed hbase dependancy:
janakact Aug 16, 2016
c5b96c9
Optimized .pom file
janakact Aug 18, 2016
b435074
Merge pull request #1 from janakact/TAJO-2079-FileSpace
janakact Aug 18, 2016
2e9e631
Improved the code style
janakact Aug 19, 2016
0a7dfd0
Removed commented code
janakact Aug 19, 2016
82f6a42
Add test case for CTAS query
blrunner Aug 21, 2016
57e2169
Merge pull request #2 from blrunner/TAJO-2079
janakact Aug 21, 2016
f9ab536
Removed unnecessary code
janakact Aug 22, 2016
d7b9de7
Merge branch 'TAJO-2079' of https://github.com/janakact/tajo into TAJ…
janakact Aug 22, 2016
a5c9565
Fixed indentation :)
janakact Aug 22, 2016
fdd871e
Fixed dependency issue
Aug 25, 2016
6b1506a
Made the new branch Only scan part
janakact Sep 5, 2016
5cea271
Reformated code
janakact Sep 5, 2016
36bc03c
Removed comments
janakact Sep 5, 2016
a771189
Merge remote-tracking branch 'origin/TAJO-2079' into TAJO-2079
janakact Sep 5, 2016
f06ae54
Merged with apache branch
janakact Sep 5, 2016
ef76967
Merged
janakact Sep 5, 2016
7e92299
Removed unnecessary comments
janakact Sep 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class BuiltinStorages {
public static final String SEQUENCE_FILE = "SEQUENCEFILE";
public static final String AVRO = "AVRO";
public static final String HBASE = "HBASE";
public static final String MONGODB = "MONGODB";
public static final String SYSTEM = "SYSTEM";
public static final String EX_HTTP_JSON = "EX_HTTP_JSON";
public static final String KAFKA = "KAFKA";
Expand Down
49 changes: 49 additions & 0 deletions tajo-docs/src/main/sphinx/storage_plugins/mongodb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
*******************
MongoDB Integration
*******************

Overview
========

Apache Tajo™ storage modules contains a storage plugin for MongoDB which allows Apache Tajo to access databases and collections in MongoDB. In order to use MongoDB storage plugin user needs to follow following steps.

* Download Mongo Java Driver 3.2.2 and add to the class path.
* Setup a MongoDB server in a localhost or another.
* Configure the cluster using storage-site.json

Download MongoDB Java Driver
==========================

You can download latest version of MongoDB java driver from https://mongodb.github.io/mongo-java-driver/
Download the .jar file and place it in the class path. You can place the file in TAJO_HOME or you can place the .jar file somewhere else and configure the CLASS_PATH variable from conf/tajo-env.sh (or tajo-env.cmd).

Setup a Mongo Server
====================
In order to proceed you need to have a running mongo server instance. If you are new to MongoDB just follow the Getting Started Guide(https://docs.mongodb.com/getting-started/shell/). After setting up the server, find the host and port to connect to the particular server. If it is a local installation by default, the port is 27017.


Configure the cluster
=====================

MongoDB storage handler configuration will be like this.
First you have to register the StorageHandler.Then register the space. Update the storage-site.json as following.

.. code-block:: json

{
"storages": {
"mongodb": {
"handler": "org.apache.tajo.storage.mongodb.MongoDBTableSpace",
"default-format": "text"
}
},
"spaces": {
"space_name": {
"uri": "mongodb://<host>:<port>/<database_name>?user=<username>&password=<password>",
"configs": {
"mapped_database": "<mapped_database_name>"
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ public Expr visitCreateTable(Context context, Stack<Expr> stack, CreateTable exp
if (expr.hasSelfDescSchema()) {
// TODO: support other types like Parquet and ORC.
if (!expr.getStorageType().equalsIgnoreCase(BuiltinStorages.JSON) &&
!expr.getStorageType().equalsIgnoreCase(BuiltinStorages.MONGODB) &&
!expr.getStorageType().equalsIgnoreCase(BuiltinStorages.EX_HTTP_JSON)) {
if (expr.getStorageType().equalsIgnoreCase(BuiltinStorages.PARQUET) ||
expr.getStorageType().equalsIgnoreCase(BuiltinStorages.ORC)) {
Expand Down
3 changes: 2 additions & 1 deletion tajo-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<module>tajo-storage-jdbc</module>
<module>tajo-storage-pgsql</module>
<module>tajo-storage-s3</module>
<module>tajo-storage-mongodb</module>
<module>tajo-storage-kafka</module>
</modules>

Expand Down Expand Up @@ -138,8 +139,8 @@
run cp -r ${basedir}/tajo-storage-hdfs/target/tajo-storage-hdfs-${project.version}*.jar .
run cp -r ${basedir}/tajo-storage-hbase/target/tajo-storage-hbase-${project.version}*.jar .
run cp -r ${basedir}/tajo-storage-s3/target/tajo-storage-s3-${project.version}*.jar .
run cp -r ${basedir}/tajo-storage-mongodb/target/tajo-storage-mongodb-${project.version}*.jar .
run cp -r ${basedir}/tajo-storage-kafka/target/tajo-storage-kafka-${project.version}*.jar .

echo
echo "Tajo Storage dist layout available at: ${project.build.directory}/tajo-storage-${project.version}"
echo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"handler": "org.apache.tajo.storage.s3.S3TableSpace",
"default-format": "text"
},
"mongodb": {
"handler": "org.apache.tajo.storage.mongodb.MongoDBTableSpace",
"default-format": "text"
},
"kafka": {
"handler": "org.apache.tajo.storage.kafka.KafkaTablespace",
"default-format": "kafka"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<!--- Registered Scanner Handler -->
<property>
<name>tajo.storage.scanner-handler</name>
<value>text,json,regex,raw,draw,rcfile,row,parquet,orc,sequencefile,avro,hbase,ex_http_json,kafka</value>
<value>text,json,regex,raw,draw,rcfile,row,parquet,orc,sequencefile,avro,hbase,mongodb,ex_http_json,kafka</value>
</property>

<!--- Fragment Class Configurations -->
Expand All @@ -55,6 +55,10 @@
<name>tajo.storage.fragment.kind.jdbc</name>
<value>org.apache.tajo.storage.jdbc.JdbcFragment</value>
</property>
<property>
<name>tajo.storage.fragment.kind.mongodb</name>
<value>org.apache.tajo.storage.mongodb.MongoDBFragment</value>
</property>
<property>
<name>tajo.storage.fragment.kind.example-http</name>
<value>org.apache.tajo.storage.http.ExampleHttpFileFragment</value>
Expand All @@ -75,6 +79,10 @@
<name>tajo.storage.fragment.serde.jdbc</name>
<value>org.apache.tajo.storage.jdbc.JdbcFragmentSerde</value>
</property>
<property>
<name>tajo.storage.fragment.serde.mongodb</name>
<value>org.apache.tajo.storage.mongodb.MongoDBFragmentSerde</value>
</property>
<property>
<name>tajo.storage.fragment.serde.example-http</name>
<value>org.apache.tajo.storage.http.ExampleHttpFileFragmentSerde</value>
Expand Down Expand Up @@ -144,7 +152,10 @@
<name>tajo.storage.scanner-handler.hbase.class</name>
<value>org.apache.tajo.storage.hbase.HBaseScanner</value>
</property>

<property>
<name>tajo.storage.scanner-handler.mongodb.class</name>
<value>org.apache.tajo.storage.mongodb.MongoDBScanner</value>
</property>
<property>
<name>tajo.storage.scanner-handler.ex_http_json.class</name>
<value>org.apache.tajo.storage.http.ExampleHttpJsonScanner</value>
Expand Down
Loading