Can I force a Cassandra table flush from the C/C++ driver like nodetool does? -
i'm wondering whether replicate forcekeyspaceflush()
function found in nodetool utility c/c++ driver of cassandra.
the nodetool function looks this:
public class flush extends nodetoolcmd { @arguments(usage = "[<keyspace> <tables>...]", description = "the keyspace followed 1 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); (string keyspace : keyspaces) { try { probe.forcekeyspaceflush(keyspace, tablenames); } catch (exception e) { throw new runtimeexception("error occurred during flushing", e); } } } }
what replicate in c++ software line:
probe.forcekeyspaceflush(keyspace, tablenames);
is possible?
that's unusual request, because cassandra designed distributed, if you're executing query, you'd need perform blocking flush on each of (potentially many) replicas. rather convince you don't need this, i'll attempt answer question - however, don't need this.
nodetool using jmx interface (on tcp/7199) force flush - c/c++ driver talks on native protocol (on tcp/9042). @ time, flush not possible via the native protocol.
work around limitation, you'd need either exec jmx-capable commandline utility (nodetool or other), implement jmx client in c++ (it's been done), or extend native protocol. none of particularly pleasant options, imagine executing jmx cli utility easier other two.
Comments
Post a Comment