hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doss_IPH <d...@intellipowerhive.com>
Subject Re: java api error: connection to HMaster
Date Wed, 21 Oct 2009 04:20:04 GMT

Hi all,
 The below code will explain to connect hbase server using hbase api. you
have to add library both hadoop-0.19.0 and hbase-0.19.3 in you classpath. 

I have created small sample UI application using HBase. I have given source
also you can refer it. 

For more details access URL:

 * @author Arockia Doss S
 * @email doss@intellipowerhive.com
 * @url http://www.intellipowerhive.com,http://www.dossinfotech.com
 * @comments You can use and modify this page for your usage.

package com.iph.hbase.conf;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;

public class IPHConfiguration  implements java.io.Serializable {
    //IP and Home Directory has to be modified according to your environment
    private static final String hbaseMasterValue = "";
    private static final String hbaseHomeDirectory = "/home/hbase-0.19.3/";
    //It is not modified code.
    private static final int hbaseMasterPort = 60000;
    private static final String hbaseMasterName = "hbase.master";
    private static final String hbaseSite =
    private static final String hbaseDefault =
    public static HBaseConfiguration getConf() {
        HBaseConfiguration conf = new HBaseConfiguration();
        conf.set(hbaseMasterName, hbaseMasterValue + ":" + hbaseMasterPort);
        Path hbaseSitePath = new Path(hbaseSite);
        Path hbaseDefaultPath = new Path(hbaseDefault);
        return conf;
View this message in context: http://www.nabble.com/java-api-error%3A-connection-to-HMaster-tp25976824p25986326.html
Sent from the HBase User mailing list archive at Nabble.com.

View raw message