Skip to main content
chauvin_christo
Silver ⭐️
June 12, 2019
Solved

Nifi clear state

Is there a way to clear the state of a processor using another processor or groovy scripting (in an ExecuteStateProcessor) ?

The goal is to reset the state of a ScrollElasticSearchHttp processor to be able to run it more than once.

Important. I don't want do it manually using the UI ("state management" then "clear state", as it is explained in https://community.hortonworks.com/questions/64405/nifi-clear-state.html)

I want this operation be done after a scroll execution.

Refer the nifi doc : https://help.syncfusion.com/data-integration/processors/scrollelasticsearchhttp

...

Scrolls through an Elasticsearch query using the specified connection properties. This processor is intended to be run on the primary node, and is designed for scrolling through huge result sets, as in the case of a reindex. The state must be cleared before another query can be run.

...

But how do that ?

Thanks by advance.

Shu_ashu
Shu_ashuAnswer
Gold ⭐️⭐️⭐️
June 13, 2019

@chauvin christophe

You can use NiFi RestApi /processors/{id}/state/clear-requests call, to clear the state stored in the processor.

We can make restapi call by using invokehttp processor (or) groovy script and triggered by using NiFi.

3 replies

Shu_ashu
Shu_ashuAnswer
Gold ⭐️⭐️⭐️
June 13, 2019

@chauvin christophe

You can use NiFi RestApi /processors/{id}/state/clear-requests call, to clear the state stored in the processor.

We can make restapi call by using invokehttp processor (or) groovy script and triggered by using NiFi.

Translate
chauvin_christo
Silver ⭐️
June 13, 2019

Thank you Shu !

It seems to solve my problem. I can't test it now because of an error when retrieving the state("Failed to obtain value from ZooKeeper for component with ID 8a2d3c3d-5eb5-1331-8be1-6f5fda823456 with exception code CONNECTIONLOSS").

But it's on my side now.

Thanks again.

Translate