java


running my first program Hbase with java


This is my first program with Hbase:
package hbase;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HBaseAdmin;
public class Parsinghbase {
static final String USERS_TABLE_NAME = "users";
static final String USERS_COLUMN_FAMILY_INFO = "info";
static final String USERS_COLUMN_FAMILY_PROFESSION = "profession";
#SuppressWarnings({ "deprecation", "resource" })
public static void main (String[] args) throws Exception {
Configuration conf = HBaseConfiguration.create();
conf.addResource(new Path("/etc/hbase/conf/core-site.xml"));
conf.addResource(new Path("/etc/hbase/conf/hbase-site.xml"));
HBaseAdmin admin = new HBaseAdmin(conf);
HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(USERS_TABLE_NAME));
tableDescriptor.addFamily(new HColumnDescriptor(USERS_COLUMN_FAMILY_INFO));
tableDescriptor.addFamily(new HColumnDescriptor(USERS_COLUMN_FAMILY_PROFESSION));
admin.createTable(tableDescriptor);
System.out.println("tableAvailable = " + admin.isTableAvailable(USERS_TABLE_NAME));
}
}
i'm using Hbase 1.1.2, and I connect prom putty system. So, I create the package on eclipse then I export it int jar file and finally I send the file to Hadoop server hdp2.2.
My problem that I can't run my program even though I can run hbase shell successfully. I find this problem but I can't modify my CLASSPATH while I have limited access to this server:
the error is
Exception in thread "main" java.lang.ClassNotFoundException: hbase.Parsinghbas
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

Related Links

How to figure out if range is allowed without accept-ranges header
How to set System properties (awt.toolkit) in Java 1.7 Or how to set java runtime parameters in Java 1.7?
Partial update in an API
elaticsearch update doc with index api or update api.which is more efficient?
Custom exception handle with spring boot
Smart gwt grid grouping doesn't work when records are over 1000
Switching between log4j configs
Taglib to display java.time.LocalDate formatted
Using Timestamp in java sql prepared statement
Maven - xmlbeans : working with multiple schema files to generate a single jar file
How can we call multiple threads in Java?
Overriding vs Overloading in JAVA inheritance
Run java web application in only one browser
JDBC SQL Server join not returning any results
How to update huge XLSM or XLSX file
difference between a.equals(b) and array.equals(a,b) [duplicate]

Categories

HOME
multithreading
gitlab
azure-data-factory
google-api-php-client
react-virtualized
malloc
serverspec
azure-storage-tables
swagger-ui
upload
portia
node-notifier
iggrid
postgres-xl
windows-azure-storage
vb.net-2010
ibm-odm
vaadin7
windows-7-x64
excel-vba-mac
beyondcompare
jprofiler
custom-wordpress-pages
amazonsellercentral
dcevm
php-openssl
claims-based-identity
sparse-matrix
nhapi
windows-error-reporting
windows-server-2000
c++-amp
newline
bcd
binary-data
semantic-versioning
suricata
qwerty
space-complexity
libvpx
code-search-engine
sharefile
hilbert-curve
vao
acoustics
qwt
auto-update
scrollable
worksheet
clean-architecture
yii2-extension
slickedit
diagnostics
knpmenubundle
cubes
nxt
py2app
etsy
merge-conflict-resolution
testng-dataprovider
bluemix-app-scan
maven-tomcat-plugin
r-tree
citrus-pay
tarjans-algorithm
splash
createprocessasuser
lustre
modalpopup
bitcoinj
eol
aapt
jubula
valuechangelistener
poller
floating-point-precision
page-layout
commoncrypto
dir
web2py-modules
flash-builder4.5
ora-00911
shellexecute
django-nonrel
xamlparseexception
wsdl-2.0
sublist
twrequest
osql
asyncfileupload
adk
joyent
psi
locationlistener
imac
wise
modelstate
filtered-index
preference
sector
genealogy
caching-application-block

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile