Как получить имя пространства клавиш из сеанса Кассандры - PullRequest
1 голос
/ 29 мая 2019

Пока я создаю сеанс, в котором в качестве входных данных для API используется API

String cKeyspace="inventory_flip"
Session session = cluster.connect(cKeyspace);

Как получить пространство ключей из существующего сеанса БД cassandra?

session.getXXXXX?

1 Ответ

2 голосов
/ 29 мая 2019
public interface Session extends Closeable {

  /**
   * The keyspace to which this Session is currently logged in, if any.
   *
   * <p>This correspond to the name passed to {@link Cluster#connect(String)}, or to the last
   * keyspace logged into through a "USE" CQL query if one was used.
   *
   * @return the name of the keyspace to which this Session is currently logged in, or {@code null}
   *     if the session is logged to no keyspace.
   */
  String getLoggedKeyspace();
...