Questions tagged [phantom-dsl]

Phantom DSL is the reactive type safe Scala DSL For Apache Cassandra and Datastax Enterprise. It is the official Scala driver built by Websudos and it features full support for the CQL query language by offering a powerful type safe DSL to define Scala objects that replicate CQL tables.

Phantom DSL is the reactive type safe Scala DSL For Apache Cassandra and Datastax Enterprise. It is the official Scala driver built by Outworkers and it features full support for the CQL query language by offering a powerful type safe DSL to define Scala objects that replicate CQL tables.

Phantom will prevent invalid queries at compile time and help you automate concerns like testing, connecting to Cassandra, and automating a lot of the operations pipeline.

150 questions
2
votes
1 answer

Cassandra performance: update columns per rows

Does cassandra performance increase or decrease when we increase the number of columns to be updated per row in one query. Saying that we have a table groups (for example FB groups) which approches is the best: 1/ table Group ( groupId Int, name…
SaKou
  • 259
  • 1
  • 13
2
votes
1 answer

Setting default consistency level

Is this the right way to set the default (read and write) consistency level val connector: KeySpaceDef = ContactPoints(hosts, port).withClusterBuilder { builder => builder.withQueryOptions(new…
EugeneMi
  • 3,475
  • 3
  • 38
  • 57
2
votes
1 answer

How risky is it to call Await.result on db calls

When using phantom how dangerous is it to be following this pattern in db calls: Await.result(dbOperationFut, 30.seconds) This isn't really phantom specific but it is the scala driver being used. I am weary of this pattern because of the potential…
cool breeze
  • 4,461
  • 5
  • 38
  • 67
2
votes
3 answers

Cassandra auto create table code in production

Is it a good practise to keep the table generation in your production code? I'm referring too: Await.ready(database.autocreate().future(), 2 minutes) Are there any potential issues with leaving this in? Just looking for some explanation on if it…
cool breeze
  • 4,461
  • 5
  • 38
  • 67
2
votes
1 answer

How to model enum types in phantom dsl?

My case class contains enum parameter like as follows: case class User(role: UserRole.UserRole, name: String) object UserRole extends Enumeration { type UserRole = Value val ADMIN, USER = Value } How to model this case as in this example? Any…
PainPoints
  • 461
  • 8
  • 20
2
votes
1 answer

Dealing with NoHostAvailableException with phantom DSL

When trying to insert several thousand records at once into a remote Cassandra db, I reproducibly run into timeouts (with 5 to 6 thousand elements on a slow connection) error: All host(s) tried for query failed (tried:…
kostja
  • 60,521
  • 48
  • 179
  • 224
2
votes
1 answer

Types MapColumn, SetColumn, JsonColumn needs owner and record. What actually are these values?

For example, I have type MapColumn[Owner <: com.websudos.phantom.dsl.CassandraTable[Owner, Record], Record, K, V] = com.websudos.phantom.column.MapColumn[Owner, Record, K, V] K and V are obvious, but owner and record? what should I input…
Azula
  • 457
  • 2
  • 5
  • 13
2
votes
1 answer

Failing to connect to Cassandra through Phantom (NoHostAvailableException)

Am getting the following error code when trying to insert into Cassandra through Phantom from a Scala application. Cassandra version is that bundled with: dsc-cassandra-3.0.1 [error] (run-main-0)…
dan-mi-sun
  • 551
  • 2
  • 4
  • 18
2
votes
2 answers

How to define column name that is Scala predefined

On Websudos Phantom DSL, how to define column name but it's already Scala's predefined variable, like type? Example: class MyTable extends CassandraTable[ConcreteValues, Value] { object id extends UUIDColumn(this) with PartitionKey[UUID] …
Andi N. Dirgantara
  • 2,050
  • 13
  • 20
2
votes
2 answers

Apache Cassandra crashes under heavy read load

I've been working on an application which requires regular writes and massive reads at once. The application is storing a few text columns which are not very big in size and a map of which is the biggest column in the table. Working with…
chbh
  • 336
  • 2
  • 13
2
votes
1 answer

Multiple Order By clauses in Phantom for Cassandra

I had a query using phantom v1.5.0 that had multiple orderBy clauses as the orderBy function took one or more OrderingConditions. In the update to 1.11.0 (1.8.0 really) the Query API changed to only allow one ordering condition. When I try to chain…
NKijak
  • 1,174
  • 9
  • 19
2
votes
1 answer

Phantom DSL modeling case classes

I know scala and/or JVM have a limitation with 22 more fields on case classes and the best way is to split into more than one case class eg: case class User(id: Long, username: String, password: String, address: Address) case class Address(id: Long,…
Thiago Pereira
  • 1,724
  • 1
  • 17
  • 31
2
votes
1 answer

How to update a field which is indexed?

I want to update a field in Cassandra which is indexed using phantom scala sdk like: this.update.where(_.id eqs folderId) .and(_.owner eqs owner) .modify(_.parent setTo parentId) the parent field is a indexed field in table. But the…
wherby
  • 704
  • 1
  • 5
  • 16
1
vote
1 answer

Insertion into scylladb table using phantom library in scala not working

I'm new to ScyllaDB, and trying to perform CRUD operations using phantom library in scala. First I've made 3-node cluster and its running fine. Datacenter: DC1 =============== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address …
Zaryab Ali
  • 161
  • 7
1
vote
1 answer

Cassandra insert without batch

I'm learning to use the PhantomDSL driver (Scala) for Cassandra. There's an excellent sample here: https://github.com/iamthiago/cassandra-phantom For example to add a Song to Cassandra: def saveOrUpdate(songs: Song): Future[ResultSet] = { …
M.G.
  • 369
  • 1
  • 14
1 2
3
9 10