Skip to content

Commit

Permalink
add hbase backend to Travis CI tests
Browse files Browse the repository at this point in the history
Change-Id: I01cd1b8d764249f2f6570129409f889fd8e06ceb
  • Loading branch information
zhoney authored and Linary committed Sep 5, 2018
1 parent be3f8b2 commit 26f8856
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ addons:
- mysql-server
- mysql-client

cache:
directories:
- $HOME/downloads

install: mvn compile

before_script:
- |
if [ "$BACKEND" == "hbase" ]; then
$TRAVIS_DIR/install-hbase.sh
fi
script: mvn test -Pcore-test,$BACKEND

before_deploy:
Expand Down Expand Up @@ -55,8 +65,10 @@ env:
- BACKEND=scylladb
- BACKEND=rocksdb
- BACKEND=mysql
- BACKEND=hbase
global:
- DEPLOYED=false
- TRAVIS_DIR=hugegraph-dist/src/assembly/travis
- secure: dYmFTVeEtRzLNaHp9ToTV/+CkTD0/rEj+K7dRN8wsv/yg4pbqwnyWbSXcqMlj6iNFzAz3nPbmFLCvAWON9/SMN9iJIT6x/xfcf+LqCT8QWczo2nc9xeX144ij2VHX1Drvtk5fRTMaTXRfWEQIrjqx2yrJTIdrXWzWSaZLFv1CRCUizEiGGCePnzUWxx9dBypNyC6IaH6lIv8uN5E6+10SYhb7UJGjWUMDg1bCeW9X7X2wg4QpsGDzlGFXT2EBPU/dAb5attTAtW8dKxrCZqZJTPWe0BarXDBR4PO15BC+a0V1g8LwexedtDjJeFRcGPaJ5NN4d3jDSusCzt5Jf4U0Wa1gDRMVTU3jT+KYkm5eoV4wOZMySobjh6VpQH/LyL0QTDy5apRPAxw+wO+tc91P+nkJmnlr3pN8abtMZ6NciZizUBYQRgR/m2Ir0stvtbZxBQOATuPtBgNDKiDgVdSYcRJzSqYEMFOn35AvsDZ9aUsyC8k29PCUZ0gQO2Is6cV1ClFBnM52hfU9XX0gu+NviSnYNGvcokod8z9VjGtnM7V3LYjqXSFqO9k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jlq5suMhtQENcPqWxaORL69s6Y/uF+RAdmnRHPZnXFhjRvq3rQAdMKM/DBOcaYlu1aIxCJJmWLm+b+75EQgdtwYGtwDpunzKXzH7ewB6rTYAghJNjGxt/KfROniooAs8mO3DqhygV5/BInJk0aKab5GlHCAioesV7TKSObhSDlKU8CSBRr/j8T7anL+lkXVZ89fkGg+EBSoXkVCNwQjank1NrHWCJQpNVndHzWIoGk0gcjTf01+iMDGIJDQZhcEuLu8wZbvDjLo/qEah247G0JabDMNBdyMZpg96bWDgArMkWa2FnWX25A7Cfgm1JymXdOZCIJrHbYWWAyoaXNrjZezQ8NPnE5uOWJIKfBnjnyPtKPoWjLuqpXmqcggbl8iRiy1EdWs/N39Q7qcFtJ5lTN9q1kDeI=
Expand Down
24 changes: 24 additions & 0 deletions hugegraph-dist/src/assembly/travis/hbase-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>/tmp/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/tmp/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>0</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>1200000</value>
</property>
<property>
<name>hbase.zookeeper.property.tickTime</name>
<value>6000</value>
</property>
</configuration>
18 changes: 18 additions & 0 deletions hugegraph-dist/src/assembly/travis/install-hbase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -ev

TRAVIS_DIR=`dirname $0`

# download hbase
if [ ! -f $HOME/downloads/hbase-2.0.1-bin.tar.gz ]; then
sudo wget -q -O $HOME/downloads/hbase-2.0.1-bin.tar.gz http://apache.cs.utah.edu/hbase/2.0.1/hbase-2.0.1-bin.tar.gz
fi

# decompress hbase
sudo cp $HOME/downloads/hbase-2.0.1-bin.tar.gz hbase-2.0.1-bin.tar.gz && tar xzf hbase-2.0.1-bin.tar.gz

# config hbase
sudo rm -f hbase-2.0.1/conf/hbase-site.xml && sudo cp $TRAVIS_DIR/hbase-site.xml hbase-2.0.1/conf

# start hbase service
sudo hbase-2.0.1/bin/start-hbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ public IndexTable(String table) {
super(table);
}

@Override
public void eliminate(Session session, BackendEntry entry) {
assert entry.columns().size() == 1;
super.delete(session, entry);
}

@Override
public void delete(Session session, BackendEntry entry) {
/*
Expand All @@ -164,6 +170,7 @@ public void delete(Session session, BackendEntry entry) {
*/
int count = 0;
for (BackendColumn column : entry.columns()) {
session.commit();
// Prefix query index label related indexes
RowIterator iter = session.scan(this.table(), column.name);
while (iter.hasNext()) {
Expand Down
2 changes: 1 addition & 1 deletion hugegraph-test/src/main/resources/hugegraph.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cassandra.read_timeout=120

# hbase backend config
hbase.hosts=localhost
hbase.port=8218
hbase.port=2181

# mysql backend config
jdbc.driver=com.mysql.jdbc.Driver
Expand Down

0 comments on commit 26f8856

Please sign in to comment.