Hi,

State registered to Flink will be managed and checkpointed so that the state is 
fault-tolerant - records will update states with exactly-once guarantees even 
after restoring from job failures.

In contrast, compare this to some normal field you have in your functions, that 
is updated per record. You would of course be able to use whatever data is 
stored in that field as of the last update in your streaming programs.
That data, however, is not managed state and is volatile. If your job fails, 
whatever the value was would be lost.

Another aspect is that managed state can be very large, since you would be able 
to use out-of-core state backends such as RocksDB to hold local state.

The debugger had never 
stepped into any of the state-able functions [initializeState() and 
snapshotState()] and even after I utterly removed all the state’s variables 
The initializeState method and snapshotState method are hooks for you to 
register operator state, and define what the operator state consists of when 
checkpoints are triggered. That means, you could also don’t register any state 
/ have nothing to be checkpointed, and the implementations of those two methods 
would be empty.

Does this answer what you have in doubt?

Cheers,
Gordon

On 21 July 2017 at 5:53:02 PM, ziv (zivm...@gmail.com) wrote:

Hi,  
After following all the instruction for how to manage a states with flink  
for non-keyed stream and after implementing all the required functions and  
defining all the variables (listState and the descriptor and so on), the  
program did actually worked well. But then I had to debug the program and  
surprisingly I found that these tools are never used. The debugger had never  
stepped into any of the state-able functions [initializeState() and  
snapshotState()] and even after I utterly removed all the state’s variables  
I still managed to use data from previous call and the program ran  
successfully.  
So please tell me what all that big stateful API is about?  




--  
View this message in context: 
http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/is-flink-states-functionality-futile-tp18867.html
  
Sent from the Apache Flink Mailing List archive. mailing list archive at 
Nabble.com.  

Reply via email to