Skip to content

HBASE-1015 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

*.bat text eol=crlf
*.cmd text eol=crlf
6 changes: 6 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ for details: https://github.com/jruby/jruby/blob/master/COPYING

The JRuby community went out of their way to make JRuby compatible with Apache
projects: See https://issues.apache.org/jira/browse/HBASE-3374)

AsyncHBase (https://github.com/OpenTSDB/asynchbase) is a fully asynchronous,
non-blocking, thread-safe, high-performance HBase client.

Gradle (http://www.gradle.org/) is used to build the native HBase client
under ASL v2.0. See http://www.gradle.org/license.
22 changes: 22 additions & 0 deletions hbase-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,26 @@
<version>${project.version}</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>hbase-native-client</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-native-client</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.hbase</groupId>
<artifactId>asynchbase</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
9 changes: 7 additions & 2 deletions hbase-assembly/src/main/assembly/hadoop-two-compat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!--This 'all' id is not appended to the produced bundle because we do this: http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers -->
<id>bin</id>
<formats>
<format>tar.gz</format>
<format>dir</format>
</formats>
<componentDescriptors>
<componentDescriptor>src/main/assembly/components.xml</componentDescriptor>
Expand All @@ -33,12 +33,17 @@
<!-- Enable access to all projects in the current multimodule build. Eclipse
says this is an error, but builds from the command line just fine. -->
<useAllReactorProjects>true</useAllReactorProjects>
<!-- Without the following line, the native client dependencies will get
packaged with the other HBase jars -->
<excludes><exclude>org.apache.hbase:hbase-native-client</exclude></excludes>
<!-- Binaries for the dependencies also go in the hbase-jars directory -->
<binaries>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<dependencySets>
<dependencySet/>
<dependencySet>
<excludes><exclude>org.apache.hbase:hbase-native-client</exclude></excludes>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
Expand Down
50 changes: 13 additions & 37 deletions hbase-native-client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
# Compiled Object files
*.slo
*.lo
*.o

# Compiled Dynamic libraries
*.so

# Compiled Static libraries
*.lai
*.la
*.a

#python
*.pyc

# CMake Generated Files
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.CMakeCache
cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake
.classpath
.cproject
.debug_dll
.debug_exe
.gradle
.perf_test
.project
.settings
build
Testing



# Thirdparty dirs

thirdparty/glog-*
thirdparty/gtest-*
thirdparty/gtest
thirdparty/protobuf-*
thirdparty/libevent-*
thirdparty/libev-*
thirdparty/installed
gradle-wrapper.properties
gradle-wrapper.jar
target
*~
*.patch
153 changes: 0 additions & 153 deletions hbase-native-client/CMakeLists.txt

This file was deleted.

92 changes: 58 additions & 34 deletions hbase-native-client/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,58 @@
# hbase-native-client

Native client for HBase 0.96

This is a C library that implements a
HBase client. It's thread safe and libEv
based.


## Design Philosphy

Synchronous and Async versions will both be built
on the same foundation. The core foundation will
be C++. External users wanting a C library will
have to choose either async or sync. These
libraries will be thin veneers ontop of the C++.

We should try and follow pthreads example as much
as possible:

* Consistent naming.
* Opaque pointers as types so that binary compat is easy.
* Simple setup when the defaults are good.
* Attr structs when lots of paramters could be needed.


## Naming
All public C files will start with hbase_*.{h, cc}. This
is to keep naming conflicts to a minimum. Anything without
the hbase_ prefix is assumed to be implementation private.

All C apis and typedefs will be prefixed with hb_.

All typedefs end with _t.
# libHBase

Native client for Apache HBase
This is a JNI based, thread safe C library that implements an HBase client.

## Building the native client
```
mvn install -Phbase-native-client -DskipTests
```

This will build the tarball containing the headers, shared library and the jar
files in the `target` directory with the following structure.

```
/
+---bin/
+---conf/
+---include/
| +--hbase/
+---lib/
| +---native/
+---src
+---examples/
| +---async/
+---test/
+---native/
+---common/
```

The headers can be found under `include` folder while the shared library to link
against is under `lib/native`.

## Building and Running Unit Tests
libHBase uses [GTest](https://code.google.com/p/googletest/) as the test framework
for unit/integration tests. During the build process, it automatically downloads
and build the GTest. You will need to have `cmake` installed on the build machine
to build the GTest framwork.

Runnig the unit tests currently requires you to set `LIBHBASE_ZK_QUORUM` to a valid
HBase Zookeeper quorum. The default is `"localhost:2181"`. This can be either set
as an environment variable or in [this configuration file](src/test/resources/config.properties).
```
LIBHBASE_ZK_QUORUM="<zk_host>:<zk_port>,..." mvn integration-test
```

## Building Applications with libHBase
For examples on how to use the APIs, please take a look at [this sample source]
(src/examples/async/example_async.c).

As the library uses JNI, you will need to have both `libhbase` and `libjvm` shared
libraries in your application's library search path. The jars required for the
library can be specified through either of the environment variables `CLASSPATH`
or `HBASE_LIB_DIR`. Custom JVM options, for example `-Xmx`, etc can be specified
using the environment variable `LIBHBASE_OPTS`.

## Performance Testing
A performance test is included with the library which currently support sequential/
random gets and puts. You can run the tests using this [shell script](bin/perftest.sh).
Loading