Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to latest versions #285

Merged
merged 1 commit into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ val testCleanup = Seq(

val sharedSettings = extraSettings ++ ciSettings ++ Seq(
organization := "com.twitter",
scalaVersion := "2.10.5",
crossScalaVersions := Seq("2.10.5", "2.11.7"),
scalaVersion := "2.11.7",
crossScalaVersions := Seq("2.10.6", "2.11.7"),
javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
javacOptions in doc := Seq("-source", "1.6"),
libraryDependencies += "org.scalatest" %% "scalatest" % scalatestVersion % "test",
Expand Down Expand Up @@ -115,10 +115,10 @@ def youngestForwardCompatible(subProj: String) =
.filterNot(unreleasedModules.contains(_))
.map { s => "com.twitter" % ("storehaus-" + s + "_2.10") % "0.12.0" }

val algebirdVersion = "0.11.0"
val bijectionVersion = "0.8.0"
val algebirdVersion = "0.12.0"
val bijectionVersion = "0.9.1"
val utilVersion = "6.26.0"
val scaldingVersion = "0.15.1-RC9"
val scaldingVersion = "0.16.0-RC1"
val finagleVersion = "6.27.0"
val scalatestVersion = "2.2.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,18 @@ class AsyncHBaseLongStore(protected val quorumNames: Seq[String],
protected val threads: Int) extends Store[String, Long] with AsyncHBaseStore {


import com.twitter.bijection.hbase.HBaseInjections.{string2BytesInj, long2BytesInj}
/** get a single key from the store.
* Prefer multiGet if you are getting more than one key at a time
*/
override def get(k: String): Future[Option[Long]] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
implicit val LongInj = fromBijectionRep[Long, LongBytes]
getValue[String, Long](k)
}
override def get(k: String): Future[Option[Long]] =
getValue(k)(string2BytesInj, long2BytesInj)

/**
* replace a value
* Delete is the same as put((k,None))
*/
override def put(kv: (String, Option[Long])): Future[Unit] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
implicit val LongInj = fromBijectionRep[Long, LongBytes]
putValue(kv)
}
override def put(kv: (String, Option[Long])): Future[Unit] =
putValue(kv)(string2BytesInj, long2BytesInj)

/** Close this store and release any resources.
* It is undefined what happens on get/multiGet after close
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,19 @@ class AsyncHBaseStringStore(protected val quorumNames: Seq[String],
protected val column: String,
protected val client: HBaseClient,
protected val threads: Int) extends Store[String, String] with AsyncHBaseStore {
import com.twitter.bijection.hbase.HBaseInjections.string2BytesInj
/** get a single key from the store.
* Prefer multiGet if you are getting more than one key at a time
*/
override def get(k: String): Future[Option[String]] = {
import com.twitter.bijection.hbase.HBaseBijections._
getValue[String, String](k)
}
override def get(k: String): Future[Option[String]] =
getValue(k)(string2BytesInj, string2BytesInj)

/**
* replace a value
* Delete is the same as put((k,None))
*/
override def put(kv: (String, Option[String])): Future[Unit] = {
import com.twitter.bijection.hbase.HBaseBijections._
putValue(kv)
}
override def put(kv: (String, Option[String])): Future[Unit] =
putValue(kv)(string2BytesInj, string2BytesInj)

/** Close this store and release any resources.
* It is undefined what happens on get/multiGet after close
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,18 @@ class HBaseLongStore(protected val quorumNames: Seq[String],
protected val conf: Configuration,
protected val threads:Int) extends Store[String, Long] with HBaseStore {

import com.twitter.bijection.hbase.HBaseInjections.{string2BytesInj, long2BytesInj}
/** get a single key from the store.
* Prefer multiGet if you are getting more than one key at a time
*/
override def get(k: String): Future[Option[Long]] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
implicit val LongInj = fromBijectionRep[Long, LongBytes]
getValue[String, Long](k)
}
override def get(k: String): Future[Option[Long]] =
getValue[String, Long](k)(string2BytesInj, long2BytesInj)

/**
* replace a value
* Delete is the same as put((k,None))
*/
override def put(kv: (String, Option[Long])): Future[Unit] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
implicit val LongInj = fromBijectionRep[Long, LongBytes]
putValue(kv)
}
override def put(kv: (String, Option[Long])): Future[Unit] =
putValue(kv)(string2BytesInj, long2BytesInj)

/** Close this store and release any resources.
* It is undefined what happens on get/multiGet after close
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.twitter.storehaus.hbase
import org.apache.hadoop.hbase.client._
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, HBaseConfiguration}
import com.twitter.bijection.hbase.HBaseBijections._
import com.twitter.bijection.hbase.HBaseInjections.string2BytesInj
import com.twitter.bijection.Conversion._
import com.twitter.bijection.Injection
import com.twitter.util.{FuturePool, Future}
Expand Down Expand Up @@ -71,10 +71,11 @@ trait HBaseStore {
val tbl = pool.getTable(table)
futurePool {
val g = new Get(keyInj(key))
g.addColumn(columnFamily.as[StringBytes], column.as[StringBytes])
g.addColumn(string2BytesInj(columnFamily), string2BytesInj(column))

val result = tbl.get(g)
val value = result.getValue(columnFamily.as[StringBytes], column.as[StringBytes])
val value = result.getValue(string2BytesInj(columnFamily),
string2BytesInj(column))

Option(value).map(v => valueInj.invert(v).get)
} ensure tbl.close
Expand All @@ -85,7 +86,7 @@ trait HBaseStore {
kv match {
case (k, Some(v)) => futurePool {
val p = new Put(keyInj(k))
p.add(columnFamily.as[StringBytes], column.as[StringBytes], valueInj(v))
p.add(string2BytesInj(columnFamily), string2BytesInj(column), valueInj(v))
tbl.put(p)
} ensure tbl.close

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,18 @@ class HBaseStringStore(protected val quorumNames: Seq[String],
protected val pool: HTablePool,
protected val conf: Configuration,
protected val threads: Int) extends Store[String, String] with HBaseStore {
import com.twitter.bijection.hbase.HBaseInjections.string2BytesInj
/** get a single key from the store.
* Prefer multiGet if you are getting more than one key at a time
*/
override def get(k: String): Future[Option[String]] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
getValue[String, String](k)
}
override def get(k: String): Future[Option[String]] =
getValue[String, String](k)(string2BytesInj, string2BytesInj)

/**
* replace a value
* Delete is the same as put((k,None))
*/
override def put(kv: (String, Option[String])): Future[Unit] = {
import com.twitter.bijection.hbase.HBaseBijections._
implicit val stringInj = fromBijectionRep[String, StringBytes]
putValue(kv)
}
override def put(kv: (String, Option[String])): Future[Unit] =
putValue(kv)(string2BytesInj, string2BytesInj)

/** Close this store and release any resources.
* It is undefined what happens on get/multiGet after close
Expand Down