如何从 cassandra 会话中获取键空间名称

How to get the keyspace name from cassandra session

当我创建会话时,将 keyspace_name 作为 API cluster.connect(keyspaceName) 的输入。是否有 anyway/api 我可以获得 keyspace_name 来自会话?

会话创建

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

如何从现有的 cassandra 数据库会话中获取键空间?

session.getXXXXX?
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();