问题标签 [scalardb]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
scala - 如何测试传递给 ScalarDB 函数的参数
我正在使用ScalarDB. 它提供超过Cassandra. - https://scalar-labs.github.io/scalardb/javadoc/
ScalarDB是Java基于的,我在Scala代码中使用它
Cassandra在using中插入值的方法Scalardb是调用Put方法。例如。
我想add通过捕获传递给put. 我被困在一个我不知道如何将Value传递给put. 如何键入强制转换为所需的值?
repository.add(repoTestEnv.mockDistributedTransaction,repoTestEnv.answerTestEnv.answerOfAPracticeQuestion) val argumentCaptor = ArgumentCaptor.forClassPut,Put
{answer_id=TextValue{name=answer_id, value=Optional[11111111-1111-1111-1111-111111111111]}, image=TextValue{name=image, value=Optional[{"image":["image1binarydata","image2binarydata"]}]}, answer=TextValue{name=answer, value=Optional[{"answer":[{"filename":"c.js","answer":"some answer"}]}]}, creation_year=BigIntValue{name=creation_year, value=2019}, creation_month=BigIntValue{name=creation_month, value=12}, notes=TextValue{name=notes, value=Optional[some notes]}}
问题 - 我不知道如何进一步选择每个值并进行比较。
scalardb - PutIfNotExists 不会在 ScalarDB 中的重复项上引发错误
我正在使用scalardb它在Cassandra. 我想对一个方法进行单元测试(add),如果它不是重复的,应该添加一个新行。
在put库的方法中,我可以指定MutationCondition避免重复条目。例如。
MutationCondition我正在使用的价值是PutIfNotExists
但是当我put在我的测试用例中使用重复的分区键调用时,我得到了错误。
问题1)是因为我没有使用clustering columns吗?
问题 2 ) 有没有办法PutIfNotExists只使用partition key或我需要scan明确使用自己?
问题 3)如果我也使用聚类列,那么我会得到异常com.datastax.driver.core.exceptions.InvalidQueryException: The column names contains duplicates。只是为了确认,这是重复的预期例外吗?
表架构是
测试用例是
scalardb - ScalarDB中没有clusterKey的Get返回什么
在ScalarDB上面提供 ACID 功能的库中,如果不存在并且数据库中有多个相同分区键的行,会返回Cassandra什么?Getclustering key
scalardb - 如果最近添加了一条记录,则 PutIfExists 失败
在ScalarDB添加 ACID 功能的库中Cassandra,我收到以下错误
我正在运行一个测试用例,在其中我得到一条记录以检查它是否不存在,然后我添加记录,然后我获取它以查看它是否已成功添加,然后我更新它,然后我再次获取它以查看该值已更新。
方法update调用add有条件_putIfExists
为什么即使字段在现有和更新notes之间发生更改,我也会收到错误消息answeranswer
错误跟踪是(注意它说IF NOT EXISTS!)。不应该IF EXISTS吗?还有一个 trace 是 there was a hit in the statement cache for [INSERT INTO codingjedi.answer_by_user_id_and_question_id (answered_by_user,question_id,tx_id,tx_state,tx_prepared_at,answer_id,image,answer,creation_year,creation_month,notes,tx_version) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) IF NOT EXISTS;].不是表示前一个put还在缓存中,是不是造成了冲突?
更新跟踪
第一个put,putAnswer是
对于第二个put,putAnswer是
notes字段已从 更改notes=TextValue{name=notes, value=Optional[some notes]}},为notes=TextValue{name=notes, value=Optional[some notesupdated]}}
当第二个put被执行时,我可以看到使用的mutation条件是IfNotExists
java - 无法使用 ScalarDB 连接到我自己的 azure cosmos db 实例
在测试 scalardb (2.2.0) 的 cosmosdb 的功能时,当我尝试使用以下代码初始化 DistributedTransaction 或 Cosmos 对象时,我无法通过 scalardb 连接到 azure cosmos db 实例
我收到以下错误
但是,我能够在 nodejs 和 java 客户端上使用 cosmosdb sdk(没有 scalardb)将数据插入到实例中。下面是我的 scalardb 配置。我什至尝试在我的一个 azure vm 上运行 scalardb 初始化代码,但由于同样的错误而无法正常工作。下面是我的scalardb配置
请问是不是我的配置有问题?我该如何设置?提前致谢。
scalardb - 使用 Terraform 构建环境时如何更改 cassandra.yaml?
我将使用以下 Terraform 构建环境。
https://github.com/scalar-labs/scalar-terraform
我想cassandra.yaml用 Terraform 修复放置在 Cassandra 实例中的问题。如何更改 Terraform?
scalardb - 如何使用 Cassy 备份工具恢复到不同的环境?
我想知道如何使用 Cassy 备份将 Scalar DB 恢复到另一个实例。因为我需要一个用于生产环境测试的新实例。
scalardb - 如果从 cqlsh 而不是使用 DistributedTransaction 输入一行,则 tx 字段的值应该是多少
在中,如果从 usingScalarDB输入一行,则 tx 字段的值应该是多少?cqlshDistributedTransaction
我的表的架构是
cqlsh我直接从表中填充了一些条目INSERT INTO supported_tags (course, subject, topic) VALUES ('coding','Perl','empty' ) IF NOT EXISTS;
但这离开tx_committed_at tx_id, tx_prepared_at, tx_state, tx_version null。我认为这在我执行get. 我得到一个例外invalid id specified.. Cause: null。
我可以在表中添加行cqlsh吗?
scalardb - 我们可以使用@Transaction 注解管理 ScalarDB Transaction 吗?
Spring 可以使用 @Transaction 注解来管理事务。我们可以使用@Transaction 注解管理ScalarDB 事务吗?
scalardb - 关于卡西的问题
我想问一些关于支持 ScalarDB 的名为 Cassy 的工具的问题。
https://github.com/scalar-labs/cassy
- 我可以相信 rpc.Cassy.ListBackups 的“状态”来确认备份成功吗?还是我需要手动检查文件?
- 假设 rpc.Cassy.ListBackups 的输出是“created_at”的 desc 顺序是否安全?
- 当我手动删除备份文件时,Cassy 会做什么?例如,rpc.Cassy.ListBackups 是否继续显示已删除的文件?当我在 rpc.Cassy.RestoreBackup 中指定一个已删除的快照时会发生什么?
- 关于restore restore_type=2, no target_ips和restore_type=1有什么区别