Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> connecting Hbase using java


Copy link to this message
-
Re: connecting Hbase using java
What's the output of ~/packages/hbase-0.94.6/bin/hbase classpath?

2013/4/3 Alok Singh Mahor <[EMAIL PROTECTED]>:
> thank you Harsha
> with your advice I used command to compile that example code
> alok@alok:~/exp/hbase/exp$ javac -classpath
> `~/packages/hbase-0.94.6/bin/hbase classpath` HBaseExample.java
>
> so errors reduced to 15 from 18
> could you please what else I have to add
>
> please see the error
>
> alok@alok:~/exp/hbase/exp$ javac -classpath
> `~/packages/hbase-0.94.6/bin/hbase classpath` HBaseExample.java
> HBaseExample.java:5: error: cannot find symbol
> import org.apache.hadoop.hbase.client.Scanner;
>                                      ^
>   symbol:   class Scanner
>   location: package org.apache.hadoop.hbase.client
> HBaseExample.java:6: error: cannot find symbol
> import org.apache.hadoop.hbase.io.BatchUpdate;
>                                  ^
>   symbol:   class BatchUpdate
>   location: package org.apache.hadoop.hbase.io
> HBaseExample.java:7: error: cannot find symbol
> import org.apache.hadoop.hbase.io.Cell;
>                                  ^
>   symbol:   class Cell
>   location: package org.apache.hadoop.hbase.io
> HBaseExample.java:8: error: cannot find symbol
> import org.apache.hadoop.hbase.io.RowResult;
>                                  ^
>   symbol:   class RowResult
>   location: package org.apache.hadoop.hbase.io
> HBaseExample.java:20: error: cannot find symbol
>         BatchUpdate batchUpdate = new BatchUpdate("test_row1");
>         ^
>   symbol:   class BatchUpdate
>   location: class HBaseExample
> HBaseExample.java:20: error: cannot find symbol
>         BatchUpdate batchUpdate = new BatchUpdate("test_row1");
>                                       ^
>   symbol:   class BatchUpdate
>   location: class HBaseExample
> HBaseExample.java:25: error: cannot find symbol
>         Cell cell = table.get("test_row1", "columnfamily1:column1");
>         ^
>   symbol:   class Cell
>   location: class HBaseExample
> HBaseExample.java:25: error: no suitable method found for get(String,String)
>         Cell cell = table.get("test_row1", "columnfamily1:column1");
>                          ^
>     method HTable.get(List<Get>) is not applicable
>       (actual and formal argument lists differ in length)
>     method HTable.get(Get) is not applicable
>       (actual and formal argument lists differ in length)
> HBaseExample.java:31: error: cannot find symbol
>         RowResult singleRow = table.getRow(Bytes.toBytes("test_row1"));
>         ^
>   symbol:   class RowResult
>   location: class HBaseExample
> HBaseExample.java:31: error: cannot find symbol
>         RowResult singleRow = table.getRow(Bytes.toBytes("test_row1"));
>                                    ^
>   symbol:   method getRow(byte[])
>   location: variable table of type HTable
> HBaseExample.java:32: error: cannot find symbol
>         Cell cell = singleRow.get(Bytes.toBytes("columnfamily1:column1"));
>         ^
>   symbol:   class Cell
>   location: class HBaseExample
> HBaseExample.java:42: error: cannot find symbol
>         Scanner scanner = table.getScanner(
>         ^
>   symbol:   class Scanner
>   location: class HBaseExample
> HBaseExample.java:42: error: no suitable method found for
> getScanner(String[])
>         Scanner scanner = table.getScanner(
>                                ^
>     method HTable.getScanner(byte[],byte[]) is not applicable
>       (actual and formal argument lists differ in length)
>     method HTable.getScanner(byte[]) is not applicable
>       (actual argument String[] cannot be converted to byte[] by method
> invocation conversion)
>     method HTable.getScanner(Scan) is not applicable
>       (actual argument String[] cannot be converted to Scan by method
> invocation conversion)
> HBaseExample.java:46: error: cannot find symbol
>         RowResult rowResult = scanner.next();
>         ^
>   symbol:   class RowResult
>   location: class HBaseExample
> HBaseExample.java:55: error: cannot find symbol
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB