hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Trivial Update of "Hbase/Scala" by Joe Stein
Date Wed, 04 Jan 2012 21:02:59 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The "Hbase/Scala" page has been changed by Joe Stein:
http://wiki.apache.org/hadoop/Hbase/Scala?action=diff&rev1=2&rev2=3

  ps auwx|grep java|grep org.apache.hadoop.hbase.master.HMaster|perl -pi -e "s/.*classpath
//"
  }}}
  
+ == Using SBT ==
+ 
+ Your build.sbt file will need this inside of it for your Scala client to work
+ 
+ {{{
+ 
+ resolvers += "Apache HBase" at "https://repository.apache.org/content/repositories/releases"
+ 
+ resolvers += "Thrift" at "http://people.apache.org/~rawson/repo/"
+ 
+ libraryDependencies ++= Seq(
+     "org.apache.hadoop" % "hadoop-core" % "0.20.2",
+     "org.apache.hbase" % "hbase" % "0.90.4"
+ )
+ 
+ }}}
  
  == The Code ==
  Please look at the Java API. Adaptation to scala should be relatively easy. The example
below shows part of the sample Java code adapted to scala:
@@ -20, +36 @@

  {{{
  
  import org.apache.hadoop.hbase.HBaseConfiguration
- import org.apache.hadoop.hbase.client.HBaseAdmin
+ import org.apache.hadoop.hbase.client.{HBaseAdmin,HTable,Put,Get}
- import org.apache.hadoop.hbase.client.HTable
- import org.apache.hadoop.hbase.client.Put
- import org.apache.hadoop.hbase.client.Get
  import org.apache.hadoop.hbase.util.Bytes
- 
  
  
  val conf = new HBaseConfiguration()

Mime
View raw message