我可以像nodetool那样从C/C++驱动程序强制刷新Cassandra表吗
Can I force a Cassandra table flush from the C/C++ driver like nodetool does?
我想知道是否可以从Cassandra的C/C++驱动程序复制nodetool实用程序中的forceKeyspaceFlush()
函数。
nodetool函数如下所示:
public class Flush extends NodeToolCmd
{
@Arguments(usage = "[<keyspace> <tables>...]", description = "The keyspace followed by one or many tables")
private List<String> args = new ArrayList<>();
@Override
public void execute(NodeProbe probe)
{
List<String> keyspaces = parseOptionalKeyspace(args, probe);
String[] tableNames = parseOptionalTables(args);
for (String keyspace : keyspaces)
{
try
{
probe.forceKeyspaceFlush(keyspace, tableNames);
} catch (Exception e)
{
throw new RuntimeException("Error occurred during flushing", e);
}
}
}
}
我想在我的C++软件中复制的是这一行:
probe.forceKeyspaceFlush(keyspace, tableNames);
有可能吗?
这是一个不寻常的请求,主要是因为Cassandra是分布式的,所以如果您正在执行查询,您需要对每个(可能有很多)副本执行阻塞清除。与其让你相信你真的不需要这个,我不如试着回答你的问题——然而,你可能真的并不需要这个。
Nodetool正在使用JMX接口(在tcp/7199上)来强制刷新-您的c/c++驱动程序通过本机协议(在tcp/9042上)进行对话。此时,无法通过本机协议进行刷新。
绕过这个限制,您需要执行一个支持jmx的命令行实用程序(nodetool或其他),用c++实现jmx客户端(已经完成),或者扩展本机协议。这些都不是特别令人愉快的选项,但我认为执行jmx CLI实用程序要比其他两个容易得多。
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 使用mongocxx驱动程序时包含头文件问题
- void*到驱动程序中的UnicodeString
- C++驱动程序看不到头文件
- 用于创建/注册虚拟存储设备的 IOKit 驱动程序
- 员工测试驱动程序数据结构
- 获取 OID(类型::b_oid)作为 MongoDB C++驱动程序中的字符串
- 如何在 c++ 中映射驱动程序?
- 如何在 cuda 中将 kd 树从主机复制到驱动程序
- Visual Studio 如何在内核模式驱动程序项目中使用C++标准库?
- 为什么我的驱动程序只读取部分字符串?
- 为 Sql 服务器实现 odbc 包装器.将数据库数据读取为字符或要求驱动程序将数据转换为 C 类型
- 如何在C++中将OID_PM_WOL_PATTERN_LIST发送到NDIS驱动程序?
- C++ 创建 NdisProt 驱动程序的句柄
- 使用 mongo c++ 驱动程序查询嵌套的 BSON 文档
- 有没有办法使用 mongocxx 驱动程序从 GridFS 集合的文件下载任意范围?
- 使用CMake ExternalProject_Add构建mongo cxx驱动程序
- SQL Server-未找到数据源名称,也未指定默认驱动程序
- 我可以像nodetool那样从C/C++驱动程序强制刷新Cassandra表吗