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], ReadableStore[MySqlValue, MySqlValue], Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MySqlStore
  2. Store
  3. ReadableStore
  4. Closeable
  5. AutoCloseable
  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 DELETE_SQL: String

  7. val INSERT_SQL: String

  8. val MULTI_SELECT_SQL_PREFIX: String

  9. val SELECT_SQL: String

  10. val UPDATE_SQL: String

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def close(): Unit

    Definition Classes
    MySqlStore → ReadableStore → Closeable → AutoCloseable
  14. val deleteStmt: PreparedStatement

  15. def doDelete(k: MySqlValue): Future[Result]

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

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

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

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

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

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

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

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

    Definition Classes
    AnyRef → Any
  24. val insertStmt: PreparedStatement

  25. final def isInstanceOf[T0]: Boolean

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

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

    Definition Classes
    Store
  28. final def ne(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    MySqlStore → Store
  32. val selectStmt: PreparedStatement

  33. def set(k: MySqlValue, v: MySqlValue): Future[Result]

    Attributes
    protected
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. val updateStmt: PreparedStatement

  37. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Store[MySqlValue, MySqlValue]

Inherited from ReadableStore[MySqlValue, MySqlValue]

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped