Package

com.websudos.phantom.example

basics

Permalink

package basics

Visibility
  1. Public
  2. All

Type Members

  1. sealed class CompositeKeyRecipes extends dsl.CassandraTable[ConcreteCompositeKeyRecipes, Recipe]

    Permalink

    In this example we will create a table storing recipes.

    In this example we will create a table storing recipes. This time we will use a composite key formed by name and id.

  2. abstract class ConcreteCompositeKeyRecipes extends CompositeKeyRecipes with RootConnector

    Permalink
  3. abstract class ConcreteRecipes extends Recipes with RootConnector

    Permalink
  4. abstract class ConcreteSecondaryKeyRecipes extends SecondaryKeyRecipes with RootConnector

    Permalink
  5. abstract class ConcreteThriftTable extends ThriftTable with RootConnector

    Permalink
  6. trait DockerConnector extends Connector

    Permalink
  7. trait ExampleConnector extends Connector

    Permalink

    This is an example of how to connect to Cassandra in the easiest possible way.

    This is an example of how to connect to Cassandra in the easiest possible way. The SimpleCassandraConnector is designed to get you up and running immediately, with almost 0 effort.

    What you have to do now is to tell phantom what keyspace you will be using in Cassandra. This connector will automaticalyl try to connect to localhost:9042. If you want to tell the connector to use a different host:port combination, simply override the address inside it.

    Otherwise, simply mixing this connector in will magically inject a database session for all your queries and you can immediately run them.

  8. trait KeyspaceDefinition extends AnyRef

    Permalink
  9. case class Recipe(id: UUID, name: String, title: String, author: String, description: String, ingredients: Set[String], props: Map[String, String], timestamp: DateTime) extends Product with Serializable

    Permalink

    In this example we will create a simple table storing recipes.

    In this example we will create a simple table storing recipes. Data modeling with com.websudos.phantom is trivial and covers some of the more advanced features of Cassandra.

    Phantom will auto-generate the CQL3 table definition from your Scala code. And you can automatically insert the schema during tests or even live environments.

    This is a very straightforward example, with a non composite Partition key

  10. sealed class Recipes extends dsl.CassandraTable[Recipes, Recipe]

    Permalink
  11. trait SampleModel extends ThriftStruct with Product3[String, String, Option[String]] with Serializable

    Permalink
  12. case class SampleRecord(stuff: String, someList: List[String], thriftModel: SampleModel) extends Product with Serializable

    Permalink
  13. sealed class SecondaryKeyRecipes extends dsl.CassandraTable[ConcreteSecondaryKeyRecipes, Recipe]

    Permalink

    In this example we will create a table storing recipes with a SecondaryKey.

    In this example we will create a table storing recipes with a SecondaryKey. This time we will use a non-composite Primary key with a SecondaryKey on author.

  14. sealed class ThriftTable extends dsl.CassandraTable[ConcreteThriftTable, SampleRecord]

    Permalink

Value Members

  1. object Defaults extends KeyspaceDefinition

    Permalink
  2. object RemoteConnector extends KeyspaceDefinition

    Permalink

    This is an example of how to connect to a custom set of hosts and ports.

    This is an example of how to connect to a custom set of hosts and ports. First, we need to obtain a connector and keep a singleton reference to it. It's really important to guarantee we are using a singleton here, otherwise we will end up spawning a cluster on every call.

  3. object SampleModel extends ThriftStructCodec3[SampleModel] with Serializable

    Permalink

Ungrouped