dcapwell commented on a change in pull request #721:
URL: https://github.com/apache/cassandra/pull/721#discussion_r479510388
##########
File path: src/java/org/apache/cassandra/fql/FullQueryLogger.java
##########
@@ -117,6 +120,30 @@ public synchronized void enable(Path path, String
rollCycle, boolean blocking, i
}
}
+ public FullQueryLoggerOptions getFullQueryLoggerOptions()
+ {
+ if (isEnabled())
+ {
+ final FullQueryLoggerOptions options = new
FullQueryLoggerOptions();
+ final BinLogOptions binLogOptions = binLog.getBinLogOptions();
+
+ options.archive_command = binLogOptions.archive_command;
Review comment:
since this is the only place that converts between the two, I feel that
this is fine.
##########
File path: test/unit/org/apache/cassandra/tools/GetFullQueryLogTest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools;
+
+import java.io.IOException;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import org.apache.cassandra.cql3.CQLTester;
+import org.apache.cassandra.fql.FullQueryLoggerOptions;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class GetFullQueryLogTest extends CQLTester
+{
+ private static NodeProbe probe;
+ private ToolRunner.Runners runner = new ToolRunner.Runners();
+
+ @ClassRule
+ public static TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+ @BeforeClass
+ public static void setup() throws Exception
+ {
+ startJMXServer();
+ probe = new NodeProbe(jmxHost, jmxPort);
+ }
+
+ @AfterClass
+ public static void teardown() throws IOException
+ {
+ probe.close();
+ }
+
+ @Test
+ public void getGetFullQueryLog()
+ {
+ testDefaultOutput(getFullQueryLog());
+ }
+
+ @Test
+ public void enableFullQueryLogTest()
+ {
+ enableFullQueryLog();
+ testChangedOutput(getFullQueryLog());
+
+ // disable and get and test that it reset configuration as it was
+ disableFullQueryLog();
Review comment:
should call in a finally to avoid the above test corrupting the other
tests
##########
File path: doc/source/new/fqllogging.rst
##########
@@ -171,6 +171,25 @@ For example: ``max_archive_retries: 10``
FQL can also be configured using ``nodetool`` when enabling the feature, and
will override any values set in the `cassandra.yaml` file, as discussed in the
next section.
+Querying the state of FQL
+---------------------
+
+In order to know what state FQL is in, you may use nodetool command
``getfullquerylog``. It will print out whether FQL is enabled
+and with what configuration options, for example, like follows. If you reset
or stop FQL, the configuration displayed will be taken from
Review comment:
feel it reads better if `, for example, like follows. If` gets replaced
with `; if`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]