Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-11399

Cassandra sessions should be (cached) reused per keyspace per host

Details

    • Improvement
    • Status: Triage Needed
    • P3
    • Resolution: Unresolved
    • None
    • None
    • io-java-cassandra
    • None

    Description

      According to the Datastax document for session "As a given session can only be "logged" into one keyspace at a time (where the "logged" keyspace is the one used by queries that don't explicitly use a fully qualified table name), it can make sense to create one session per keyspace used. This is however not necessary when querying multiple keyspaces since it is always possible to use a single session with fully qualified table names in queries."(source: https://docs.datastax.com/en/drivers/java/3.0/com/datastax/driver/core/Session.html). 

      The session fields in Mutator<T> class should be cached and reused for a keyspace and host. 

      https://github.com/apache/beam/blob/master/sdks/java/io/cassandra/src/main/java/org/apache/beam/sdk/io/cassandra/CassandraIO.java#L1225 

      Attachments

        Activity

          People

            Unassigned Unassigned
            manojks Manoj Kumar Singh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: