Class/Object

com.twitter.storehaus.mysql

MySqlStore

Related Docs: object MySqlStore | package mysql

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. val COMMIT_TXN_SQL: String

    Permalink
    Attributes
    protected
  5. val DELETE_SQL: String

    Permalink
    Attributes
    protected
  6. val INSERT_SQL: String

    Permalink
    Attributes
    protected
  7. val MULTI_DELETE_SQL_PREFIX: String

    Permalink
    Attributes
    protected
  8. val MULTI_INSERT_SQL_PREFIX: String

    Permalink
    Attributes
    protected
  9. val MULTI_SELECT_SQL_PREFIX: String

    Permalink
    Attributes
    protected
  10. val MULTI_UPDATE_SQL_INFIX: String

    Permalink
    Attributes
    protected
  11. val MULTI_UPDATE_SQL_PREFIX: String

    Permalink
    Attributes
    protected
  12. val ROLLBACK_TXN_SQL: String

    Permalink
    Attributes
    protected
  13. val SELECT_SQL: String

    Permalink
    Attributes
    protected
  14. val START_TXN_SQL: String

    Permalink
    Attributes
    protected
  15. val UPDATE_SQL: String

    Permalink
    Attributes
    protected
  16. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  17. val client: Client

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

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

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

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

    Permalink
    Definition Classes
    Closable
  22. def commitOrRollback(): Future[Unit]

    Permalink
    Attributes
    protected[com.twitter.storehaus.mysql]
  23. def commitTransaction: Future[Unit]

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  36. val insertStmt: PreparedStatement

    Permalink
    Attributes
    protected
  37. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

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

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

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

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

    Permalink
    Attributes
    protected
  47. def startTransaction: Future[Unit]

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

    Permalink
    Definition Classes
    AnyRef
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. val updateStmt: PreparedStatement

    Permalink
    Attributes
    protected
  51. final def wait(): Unit

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

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

    Permalink
    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