Package

com.twitter.storehaus

mysql

Permalink

package mysql

Visibility
  1. Public
  2. All

Type Members

  1. class MergeableMySqlStore[V] extends ConvertedStore[MySqlValue, MySqlValue, MySqlValue, V] with MergeableStore[MySqlValue, V]

    Permalink

    Mergeable MySQL store that performs merge inside a transaction.

  2. class MySqlLongStore extends MergeableMySqlStore[Long]

    Permalink

    MySQL store for Long values

  3. class MySqlStore extends Store[MySqlValue, MySqlValue]

    Permalink

    Simple storehaus wrapper over finagle-mysql.

    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")
  4. class MySqlValue extends AnyRef

    Permalink

    Wraps finagle-mysql Value ADT.

    Wraps finagle-mysql Value ADT.

    Since finagle maps MySQL column types to specific Value types, we use this type class as an abstraction. MySqlValue objects can then be converted to string, channelbuffer or any other type without having to worry about the underlying finagle type.

Value Members

  1. object ChannelBuffer2MySqlValueInjection extends Injection[ChannelBuffer, MySqlValue]

    Permalink
  2. object LongMySqlInjection extends Injection[Long, MySqlValue]

    Permalink
  3. object MySqlLongStore

    Permalink

    Factory for com.twitter.storehaus.mysql.MySqlLongStore instances.

  4. object MySqlStore

    Permalink

    Factory for com.twitter.storehaus.mysql.MySqlStore instances.

  5. object MySqlValue

    Permalink

    Factory for com.twitter.storehaus.mysql.MySqlValue instances.

  6. object String2MySqlValueInjection extends Injection[String, MySqlValue]

    Permalink
  7. object ValueMapper

    Permalink

    Helper class for mapping finagle-mysql Values to types we care about.

Deprecated Value Members

  1. object MySqlCbInjection extends Injection[MySqlValue, ChannelBuffer]

    Permalink

    Injection from MySqlValue to ChannelBuffer.

    Injection from MySqlValue to ChannelBuffer. Returns a channel buffer containing the Value wrapped by MySqlValue. Both null values and empty values map to empty channel buffer.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use ChannelBuffer2MySqlValueInjection

  2. object MySqlStringInjection extends Injection[MySqlValue, String]

    Permalink

    Injection from MySqlValue to String.

    Injection from MySqlValue to String. Returns string representation of the finagle-mysql Value wrapped by MySqlValue Both null values and empty values map to empty string.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use String2MySqlValueInjection

Ungrouped