Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Nifi clear state

Solved Go to solution
Highlighted

Nifi clear state

New Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Nifi clear state

Super Guru

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

2 REPLIES 2

Re: Nifi clear state

Super Guru

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

Re: Nifi clear state

New Contributor

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.

Don't have an account?
Coming from Hortonworks? Activate your account here