https://github.com/hibuz/hbase-example
https://github.com/hibuz/hbase-example
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hibuz/hbase-example
- Owner: hibuz
- Created: 2022-03-01T10:43:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T10:56:46.000Z (over 3 years ago)
- Last Synced: 2025-07-15T13:01:07.141Z (3 months ago)
- Language: Java
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HBase gradle examples
## Build
``` bash
git clone https://github.com/hibuz/hbase-examplecd hbase-example
# Run and Execute bash on docker container
./docker_up.sh# Build in the docker container
./mvnw package
```## Prepare input files into the distributed filesystem
``` bash
# Make the HDFS directories
hdfs dfs -mkdir -p /user/hadoop/wordcount/input# Create the input files
echo "Hello World Bye World" | hdfs dfs -put - wordcount/input/file01
echo "Hello HBase Goodbye HBase" | hdfs dfs -put - wordcount/input/file02
```## Run some of the examples provided:
``` bash
# WordCount Example
hadoop jar target/examples-0.0.1-SNAPSHOT.jar wordcount wordcount/input wordcount/output# View the output files on the distributed filesystem:
hdfs dfs -cat wordcount/output/*# Result of the output files
Bye 1
Goodbye 1
HBase 2
Hello 2
World 2# Grep Example
hadoop jar target/examples-0.0.1-SNAPSHOT.jar grep wordcount/input output '([G-H])\w+'# View the output files on the distributed filesystem:
hdfs dfs -cat output/*# Result of the output files
2 Hello
2 HBase
1 Goodbye
```## Stops containers and removes containers, networks, and volumes
``` bash
./docker_down.sh -v[+] Running 3/3
⠿ Container hbase Removed
⠿ Network example_default Removed
⠿ Volume hbase-example_hbase-vol Removed
```