Cassandra:使用键空间和表名获取元数据

时间:2017-08-24 05:25:40

标签: triggers cassandra metadata

我正在为casssandra创建自定义触发器。

因此,要获取元数据,给定example trigger file fails.

中的语句
 TableMetadata metadata = Schema.instance.getTableMetadata(auditKeyspace, auditTable);

构建

时出现此错误
AuditTrigger.java:27: error: package org.apaceh.cassandra.schema does not exist
[javac] import org.apaceh.cassandra.schema.TableMetadata;
[javac]                                   ^
[javac] /home/bkoganti/cassandra/examples/triggers/src/org/apache/cassandra/triggers/AuditTrigger.java:28: error: cannot find symbol
[javac] import org.apache.cassandra.schema.Schema;
[javac]                                   ^
[javac]   symbol:   class Schema
[javac]   location: package org.apache.cassandra.schema
[javac] /home/bkoganti/cassandra/examples/triggers/src/org/apache/cassandra/triggers/AuditTrigger.java:50: error: cannot find symbol
[javac]         TableMetadata metadata = Schema.instance.getTableMetadata(auditKeyspace, auditTable);
[javac]         ^
[javac]   symbol:   class TableMetadata
[javac]   location: class AuditTrigger
[javac] /home/bkoganti/cassandra/examples/triggers/src/org/apache/cassandra/triggers/AuditTrigger.java:50: error: package Schema does not exist
[javac]         TableMetadata metadata = Schema.instance.getTableMetadata(auditKeyspace, auditTable);
[javac]                                        ^
[javac] 4 errors

没有类TableMetadata和Schema可用。

那么,我如何使用键空间名称和表名来获取元数据。

1 个答案:

答案 0 :(得分:1)

这是一些错误在一些重构中错过。我创建了一个jira并在此处提供了修补程序https://docs.chainer.org/en/stable/reference/core/generated/chainer.GradientMethod.html?highlight=gradient,您可以看到更改CASSANDRA-13796

-=