com.twitter.storehaus.mysql

MySqlStore

class MySqlStore extends Store[MySqlValue, MySqlValue]

Simple storehaus wrapper over finagle-mysql.

Assumes the underlying table's key and value columns are both strings. Supported MySQL column types are: BLOB, TEXT, VARCHAR.

The finagle-mysql client is required to set the user, database and create the underlying table schema prior to this class being used.

Storehaus-mysql also works with pre-populated MySQL tables, based on the assumption that the key column picked is unique. Any table columns other than the picked key and value columns are ignored during reads and writes.

Example usage:

import com.twitter.finagle.exp.mysql.Client
import com.twitter.storehaus.mysql.MySqlStore

val client = Client("localhost:3306", "storehaususer", "test1234", "storehaus_test")
val schema = """CREATE TABLE `storehaus-mysql-test` (
      `key` varchar(40) DEFAULT NULL,
      `value` varchar(100) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"""
// or, use an existing pre-populated table.
client.query(schema).get
val store = MySqlStore(client, "storehaus-mysql-test", "key", "value")
Linear Supertypes
Store[MySqlValue, MySqlValue], WritableStore[MySqlValue, Option[MySqlValue]], ReadableStore[MySqlValue, MySqlValue], Closable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MySqlStore
  2. Store
  3. WritableStore
  4. ReadableStore
  5. Closable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MySqlStore(client: Client, table: String, kCol: String, vCol: String)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val COMMIT_TXN_SQL: String

    Attributes
    protected
  7. val DELETE_SQL: String

    Attributes
    protected
  8. val INSERT_SQL: String

    Attributes
    protected
  9. val MULTI_DELETE_SQL_PREFIX: String

    Attributes
    protected
  10. val MULTI_INSERT_SQL_PREFIX: String

    Attributes
    protected
  11. val MULTI_SELECT_SQL_PREFIX: String

    Attributes
    protected
  12. val MULTI_UPDATE_SQL_INFIX: String

    Attributes
    protected
  13. val MULTI_UPDATE_SQL_PREFIX: String

    Attributes
    protected
  14. val ROLLBACK_TXN_SQL: String

    Attributes
    protected
  15. val SELECT_SQL: String

    Attributes
    protected
  16. val START_TXN_SQL: String

    Attributes
    protected
  17. val UPDATE_SQL: String

    Attributes
    protected
  18. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  19. val client: Client

    Attributes
    protected[com.twitter.storehaus.mysql]
  20. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def close(t: Time): Future[Unit]

    Definition Classes
    MySqlStore → WritableStore → ReadableStore → Closable
  22. def close(after: Duration): Future[Unit]

    Definition Classes
    Closable
  23. final def close(): Future[Unit]

    Definition Classes
    Closable
  24. def commitTransaction: Future[Unit]

    Attributes
    protected[com.twitter.storehaus.mysql]
  25. val deleteStmt: PreparedStatement

    Attributes
    protected
  26. def doDelete(k: MySqlValue): Future[Result]

    Attributes
    protected
  27. def doSet(k: MySqlValue, v: MySqlValue): Future[Result]

    Attributes
    protected
  28. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  29. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  30. def executeMultiInsert[K1 <: MySqlValue](kvs: Map[K1, MySqlValue]): Future[Future[Result]]

    Attributes
    protected[com.twitter.storehaus.mysql]
  31. def executeMultiUpdate[K1 <: MySqlValue](kvs: Map[K1, MySqlValue]): Future[Future[Result]]

    Attributes
    protected[com.twitter.storehaus.mysql]
  32. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def g(s: String): String

    Attributes
    protected
  34. def get(k: MySqlValue): Future[Option[MySqlValue]]

    Definition Classes
    MySqlStore → ReadableStore
  35. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  37. val insertStmt: PreparedStatement

    Attributes
    protected
  38. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  39. def multiGet[K1 <: MySqlValue](ks: Set[K1]): Map[K1, Future[Option[MySqlValue]]]

    Definition Classes
    MySqlStore → ReadableStore
  40. def multiPut[K1 <: MySqlValue](kvs: Map[K1, Option[MySqlValue]]): Map[K1, Future[Unit]]

    Definition Classes
    MySqlStore → WritableStore
  41. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  44. def put(kv: (MySqlValue, Option[MySqlValue])): Future[Unit]

    Definition Classes
    MySqlStore → WritableStore
  45. def rollbackTransaction: Future[Unit]

    Attributes
    protected[com.twitter.storehaus.mysql]
  46. val selectStmt: PreparedStatement

    Attributes
    protected
  47. def set(k: MySqlValue, v: MySqlValue): Future[Result]

    Attributes
    protected
  48. def startTransaction: Future[Unit]

    Attributes
    protected[com.twitter.storehaus.mysql]
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. val updateStmt: PreparedStatement

    Attributes
    protected
  52. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Store[MySqlValue, MySqlValue]

Inherited from WritableStore[MySqlValue, Option[MySqlValue]]

Inherited from ReadableStore[MySqlValue, MySqlValue]

Inherited from Closable

Inherited from AnyRef

Inherited from Any

Ungrouped