* JAVA-18167 Upgrade persistence-modules to JDK 11 (activejdbc and core-java-persistence)
* JAVA-16167 Update pom.xml to include just the updated modules
* JAVA-18167 Added vaadin because it looks that I removed
* JAVA-18167 Migration deltaspike
* JAVA-18167 Migration hbase module
* JAVA-18167 Migration hibernate-mapping-2
* JAVA-18167 Migration hibernate-exceptions
* JAVA-18167 Migration hibernate-jpa module
* JAVA-18167 Migration hibernate-jpa change the name of User entity
* JAVA-18167 Overwriting the version of slf4j and logback for hibernate-jpa
* JAVA-18167 Migrate deltaspike back to jdk8
* JAVA-18167 Remove some modules that was added elsewhere
* Revert "JAVA-18167 Migration deltaspike"
This reverts commit 874b4ba2
* JAVA-18167 Comment failed module (it will be migrated later)
---------
Co-authored-by: timis1 <noreplay@yahoo.com>
36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package com.baeldung.hbase;
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.fs.Path;
|
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
|
import org.apache.hadoop.hbase.MasterNotRunningException;
|
|
import org.apache.hadoop.hbase.client.HBaseAdmin;
|
|
|
|
import java.io.IOException;
|
|
|
|
//install hbase locally & hbase master start
|
|
public class HbaseClientExample {
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
new HbaseClientExample().connect();
|
|
}
|
|
|
|
private void connect() throws IOException {
|
|
Configuration config = HBaseConfiguration.create();
|
|
|
|
String path = this.getClass().getClassLoader().getResource("hbase-site.xml").getPath();
|
|
|
|
config.addResource(new Path(path));
|
|
|
|
try {
|
|
HBaseAdmin.available(config);
|
|
} catch (MasterNotRunningException e) {
|
|
System.out.println("HBase is not running." + e.getMessage());
|
|
return;
|
|
}
|
|
|
|
HBaseClientOperations HBaseClientOperations = new HBaseClientOperations();
|
|
HBaseClientOperations.run(config);
|
|
}
|
|
|
|
} |