You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/09/08 20:00:44 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6374: NIFI-10451 Updating QuestDB based status history rollover mechanism to fit the new major version

exceptionfactory commented on code in PR #6374:
URL: https://github.com/apache/nifi/pull/6374#discussion_r966370275


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/EmbeddedQuestDbRolloverHandler.java:
##########
@@ -91,7 +95,8 @@ private void rolloverTable(final CharSequence tableName) {
 
     private void deletePartition(final CharSequence tableName, final String partition) {
         try (final SqlCompiler compiler = dbContext.getCompiler()) {
-            compiler.compile(String.format(DELETION_QUERY, new Object[]{tableName, partition}), dbContext.getSqlExecutionContext());
+            final CompiledQuery compile = compiler.compile(String.format(DELETION_QUERY, new Object[]{tableName, partition}), dbContext.getSqlExecutionContext());

Review Comment:
   It looks like the wrapping `Object[]` could be removed from String.format():
   ```suggestion
               final CompiledQuery compile = compiler.compile(String.format(DELETION_QUERY, tableName, partition), dbContext.getSqlExecutionContext());
   ```



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/EmbeddedQuestDbRolloverHandler.java:
##########
@@ -91,7 +95,8 @@ private void rolloverTable(final CharSequence tableName) {
 
     private void deletePartition(final CharSequence tableName, final String partition) {
         try (final SqlCompiler compiler = dbContext.getCompiler()) {
-            compiler.compile(String.format(DELETION_QUERY, new Object[]{tableName, partition}), dbContext.getSqlExecutionContext());
+            final CompiledQuery compile = compiler.compile(String.format(DELETION_QUERY, new Object[]{tableName, partition}), dbContext.getSqlExecutionContext());
+            compile.execute(new SCSequence(new TimeoutBlockingWaitStrategy(5, TimeUnit.SECONDS)));

Review Comment:
   Prior to this change, was the delete query not being executed?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org