GithubHelp home page GithubHelp logo

kvasagiri / sample-hbase-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gelog/sample-hbase-app

0.0 0.0 0.0 155 KB

Sample Java application that communicates with HBase via the HBase API.

License: Apache License 2.0

Java 100.00%

sample-hbase-app's Introduction

Sample HBase App

Sample Java application that communicates with HBase via the HBase API.

Note: the IPC ports of ZooKeeper must be accessible

Maven instructions

  1. Compile on your workstation
mvn package
 
ls -lh target/*.jar
-rw-r--r-- 1 david staff 8.4K Oct  4 23:29 target/hbase-app-0.0.1-SNAPSHOT.jar
-rw-r--r-- 1 david staff  31M Oct  4 23:29 target/hbase-app-0.0.1-SNAPSHOT-all.jar
  1. Start a Docker container that runs your job
docker run --rm -ti \
	-v $HOME/workspace/ets/sys870/sample-hbase-app/target:/opt/target \
	hbase java -jar /opt/target/hbase-app-0.0.1-SNAPSHOT-all.jar

Gradle instructions

  1. Generate the project for import into your IDE
  • For Eclipse: gradle eclipse
  • For IDEA: gradle idea
  1. Compile on your workstation
gradle package
 
ls -lh build/libs/*.jar
-rw-r--r-- 1 michael michael 37426474  5 oct 23:56 hbase-app-0.0.1-SNAPSHOT-all.jar
  1. Start a Docker container
docker run --rm -ti \
	-v $HOME/workspace/ets/sys870/sample-hbase-app/build/libs:/opt/target \
	hbase java -jar /opt/target/hbase-app-0.0.1-SNAPSHOT-all.jar

Improvements

FIXME: Normally, we should be able to run the non-fat jar as follows:

`java -cp .:$(hbase classpath) -jar hbase-app-0.0.1-SNAPSHOT.jar`

but it complains about not being able to find the Hadoop Configuration class.

TODO: The HBase ZooKeeper IP is hardcoded in src/main/resources. It would be great to find an elegant way to override this between local and dev HBase cluster.

TODO: Find a way to connect to Docker container from IDE. Currently, if I need hardcode the "hbase-master" IP address in /etc/hosts. It allows connecting to ZooKeeper, but it fails when connecting to HBase RegionServer. This seems to be because the RegionServer port is always changing when starting the HBase master, so it is impossible to NAT this port from the container through the Docker-Machine / Boot2Docker or through a remote server.

   The port may be randomly assigned since HBase starts in non-distributed
   mode.

sample-hbase-app's People

Contributors

davidonlaptop avatar mikefaille 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.