- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Astyanax 驱动程序列出 Cassandra 中的列族。它列出了键空间,但输出中缺少许多列族。
我有一个简单的程序:
import com.netflix.astyanax.AstyanaxContext;
import com.netflix.astyanax.Cluster;
import com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl;
import com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor;
import com.netflix.astyanax.ddl.ColumnFamilyDefinition;
import com.netflix.astyanax.ddl.KeyspaceDefinition;
import com.netflix.astyanax.impl.AstyanaxConfigurationImpl;
import com.netflix.astyanax.thrift.ThriftFamilyFactory;
public class App {
public static void main(String[] args) throws Exception {
ConnectionPoolConfigurationImpl cpool = new ConnectionPoolConfigurationImpl("ConnectionPool")
.setPort(9160)
.setSeeds("localhost");
AstyanaxConfigurationImpl astyanaxConfiguration = new AstyanaxConfigurationImpl();
AstyanaxContext.Builder ctxBuilder = new AstyanaxContext.Builder();
ctxBuilder.forCluster("Cluster")
.withAstyanaxConfiguration(astyanaxConfiguration)
.withConnectionPoolConfiguration(cpool)
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor());
AstyanaxContext<Cluster> clusterContext = ctxBuilder.buildCluster(ThriftFamilyFactory.getInstance());
clusterContext.start();
Cluster cluster = clusterContext.getClient();
for (KeyspaceDefinition ksDef : cluster.describeKeyspaces()) {
List<ColumnFamilyDefinition> cfDefList = ksDef.getColumnFamilyList();
System.out.println("there are " + cfDefList.size() + " column families in keyspace " + ksDef.getName());
for (ColumnFamilyDefinition cfDef : cfDefList) System.out.println(" - " + cfDef.getName());
}
它可以列出键空间,但缺少许多列族。这是输出。可以看到很多默认的键空间都有,但是很多列族缺失了。
there are 0 column families in keyspace system_distributed
there are 3 column families in keyspace system
- hints
- schema_keyspaces
- IndexInfo
there are 2 column families in keyspace system_auth
- role_members
- resource_role_permissons_index
there are 0 column families in keyspace system_traces
我可以使用 cqlsh 来确认列族确实存在
cqlsh> DESCRIBE COLUMNFAMILIES
Keyspace system_traces
----------------------
events sessions
Keyspace system_auth
--------------------
resource_role_permissons_index role_permissions role_members roles
Keyspace system
---------------
available_ranges size_estimates schema_usertypes compactions_in_progress
range_xfers peers paxos schema_aggregates
schema_keyspaces schema_triggers batchlog schema_columnfamilies
schema_columns sstable_activity schema_functions local
"IndexInfo" peer_events compaction_history hints
Keyspace system_distributed
---------------------------
repair_history parent_repair_history
上面的输出使用的是 cassandra 2.2,但我已经确认了其他版本的 cassandra 和 scylla 中的行为。
最佳答案
Thrift 已弃用,默认情况下 Cassandra 不再启用。您需要启用它才能使用它。请记住,在 Cassandra 的下一个版本中,它甚至不存在。即使启用它并使用它,也很可能无法正常工作。没有什么真正使用它了,也没有那么多测试使用它。表的存储和检索方式在版本之间发生了变化,因此驱动程序必须意识到这一点。由于 Astyanax 没有得到维护,它可能不会正确。
Astyanax 已退役,仅适用于较旧的应用程序。你真的应该使用 java driver (与 Astyanax 页面上的推荐相同)。
关于java - Astyanax 无法读取某些列族,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52632314/
我是astyanax的新手,尝试了一些示例程序并遇到此错误。这是一个简单的编写,看起来像是在做一些基本错误的事情。不使用复合键。 Caused by: InvalidRequestException(
尝试编写一个查询,该查询将使用 astyanax 客户端和 RowSliceQuery 对列族中的所有行进行分页。 keyspace.prepareQuery(COLUMN_FAMILY).getKe
我正在尝试使用 Astyanax 驱动程序列出 Cassandra 中的列族。它列出了键空间,但输出中缺少许多列族。 我有一个简单的程序: import com.netflix.astyanax.As
我最近开始使用Cassandra在我们的Production environment 。我们有一个24 node cluster与 replication factor of 4 。含义2 copie
这是我的设置: 4 个节点 Cassandra 1.2.19 Astyanax 1.56.49 我正在设置配置 AstyanaxContext context = new AstyanaxContex
我正在使用 Astyanax 客户端从 Cassandra 数据库读取数据。 我在 Cassandra 数据库中有大约一百万行。我有一个十字colocation centre具有四个节点的集群。 这是
如何使用 astyanax 客户端创建带有复合键的表。现在我已经用 cqlsh -3 创建了它,这就是它在 cli 中的样子: [default@KS] describe my_cf; Col
我正在尝试将 Astyanax 用于带有 Java 的 Cassandra。我在 https://github.com/Netflix/astyanax/wiki/Getting-Started 尝试
我编写了一些相当简单的代码来试验 astyanax。当与本地主机上的单节点 Cassandra 数据库通信时,它工作正常,但是当我将相同的架构写入两节点集群(绝对可以从我的主机访问)时,我得到一个 T
我最近开始使用 Cassandra 数据库,并且正在考虑使用 Netflix 客户端 astyanax。我进入了这个页面- https://github.com/Netflix/astyanax 我想
我从事的项目使用astyanax驱动程序来访问Cassandra。我想实现一个异步操作: MutationBatch m; //… ListenableFuture> lf = m.executeAs
Astyanax 通过其 AnnotatedCompositeSerializer 支持 Cassandra 中的复合列。我有一个包含 3 个字段的复合列名称的列族,类似于此示例,改编自 Astyan
过去几周我们一直在尝试评估不同的 Cassandra 客户端,所以现在看来我们将继续使用 Netflix/Astyanax 客户端。 我们正在尝试优化 Cassandra 数据库,主要是为了读
我正在尝试使用 Astyanax 客户端插入 Cassandra 列族中的复合列。下面是我在 Cassandra 中的列族。 create column family USER_DATA with k
我正在开发一个项目,其中我需要使用 Astyanax 客户端删除 Cassandra 中除一列及其数据之外的所有列及其数据。 我有一个如下所示的动态列族,并且该列族中已经有几百万条记录。 create
您好,我正在使用 Astyanax 客户端在我的程序中使用 CQL 访问 Cassandra。我遇到的问题是,当我执行查询时,OperationResult 的行数设置为最大值 10 000。我需要根
我使用 astyanax 连接池定义如下: ipSeeds = "LOAD_BALANCER_HOST:9160"; conPool.setSeeds(ipSeeds) .setDiscoveryTy
我正在尝试从具有 double 类型列的Cassandra表中获取 double 值。我已经使用CQL3语法创建了表: CREATE TABLE data_double ( datetime
我想将 Astyanax 包含在我的项目中。我从 github checkout 代码并用“gradlew build”编译它。我不熟悉gradle。 我将 Astyanx jar 文件手动包含到我的
有没有办法检查当前上下文中是否存在 Astyanax Keyspace?现在我的代码执行以下操作: keyspace = context.getClient(); try{ keyspace.d
我是一名优秀的程序员,十分优秀!