You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Silvia <si...@gmail.com> on 2011/11/28 10:53:58 UTC

Hbase and Eclipse on ubuntu

Hi,
i'm trying to connect eclipse with hbase on ubuntu, but i can't find any
guide for do it.
Some one can explain me how i can do it or link me a tutorial?
Thanks.
Silvia 

--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-and-Eclipse-on-ubuntu-tp3541797p3541797.html
Sent from the HBase - Developer mailing list archive at Nabble.com.

Re: Hbase and Eclipse on ubuntu

Posted by Silvia <si...@gmail.com>.
Hi,
first of all i'm running Hbase and Ubuntu on the same machine. 
I have write this code. I took the helper classe from this 
https://github.com/larsgeorge/hbase-book/blob/master/ch03/src/main/java/util/HBaseHelper.java
link 

import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

public class PutExample {
	public static void main(String[] args) throws IOException {
		Configuration conf = HBaseConfiguration.create(); //Crea una
configurazione
		HBaseHelper helper = HBaseHelper.getHelper(conf);
		helper.dropTable("testtable");
		helper.createTable("testtable", "colfam1");
		HTable table = new HTable(conf, "testtable"); //tabelle testtable
		Put put = new Put(Bytes.toBytes("row1")); 
		put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"),
		Bytes.toBytes("val1"));
		put.add(Bytes.toBytes("colfam1"), Bytes.toBytes("qual2"),
		Bytes.toBytes("val2"));
		table.put(put);
		}
	}


when i run this code the Eclipse's console give me the message "Usage:
MapFile inFile outFile" and the table "testtable" there isn't in hbase.

Thanks Silvia

--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-and-Eclipse-on-ubuntu-tp3541797p3545191.html
Sent from the HBase - Developer mailing list archive at Nabble.com.

Re: Hbase and Eclipse on ubuntu

Posted by Lars George <la...@gmail.com>.
Hi,

Not sure exactly what you are trying. Could you please elaborate? Are you running Eclipse and HBase both on the same Ubuntu machine? Or is this across machine boundaries?

Lars

On Nov 28, 2011, at 10:53 AM, Silvia wrote:

> Hi,
> i'm trying to connect eclipse with hbase on ubuntu, but i can't find any
> guide for do it.
> Some one can explain me how i can do it or link me a tutorial?
> Thanks.
> Silvia 
> 
> --
> View this message in context: http://apache-hbase.679495.n3.nabble.com/Hbase-and-Eclipse-on-ubuntu-tp3541797p3541797.html
> Sent from the HBase - Developer mailing list archive at Nabble.com.