Re:Re: [statefun] Add new state failure in Greetings example

2022-02-14 Thread casel.chen
Oh, yes. I missed to add my newly defined ValueSpec as parameter to 
withValueSpec() method. After placed it works, thank you Igal
















At 2022-02-15 01:42:39, "Igal Shilman"  wrote:

Hello,
Make sure that you have added the state when creating the function spec like in 
this example[1]
If that wasn't it, can you send your UserFn?


[1]  
https://github.com/apache/flink-statefun-playground/blob/release-3.2/java/greeter/src/main/java/org/apache/flink/statefun/playground/java/greeter/UserFn.java#L50


Cheers,
Igal.


On Sun, Feb 13, 2022 at 4:03 AM casel.chen  wrote:

Hello,


I am trying Greeting example of Flink Stateful Functions playground. According 
to the README.md guide I tried to add previous login location in the state 
after run the example well in my laptop.
I added one more state named "previous_login_location" in UserFn, and print it 
in GreetingsFn. When I build and run again, it complains the following error. 
It seems the system can NOT find the newly added state. 
Question: How to add a new state in this case? How to ensure state evolution? 
Thanks!


Caused by: 
org.apache.flink.statefun.sdk.java.storage.IllegalStorageAccessException: Error 
accessing state previous_login_location; State does not exist; make sure that 
this state was registered.

greeter-functions_1 |   at 
org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.slowGetCellOrThrow(ConcurrentAddressScopedStorage.java:102)

greeter-functions_1 |   at 
org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.getCellOrThrow(ConcurrentAddressScopedStorage.java:78)







 

Re: [statefun] Add new state failure in Greetings example

2022-02-14 Thread Igal Shilman
Hello,
Make sure that you have added the state when creating the function spec
like in this example[1]
If that wasn't it, can you send your UserFn?

[1]
https://github.com/apache/flink-statefun-playground/blob/release-3.2/java/greeter/src/main/java/org/apache/flink/statefun/playground/java/greeter/UserFn.java#L50

Cheers,
Igal.

On Sun, Feb 13, 2022 at 4:03 AM casel.chen  wrote:

> Hello,
>
> I am trying Greeting example of Flink Stateful Functions playground.
> According to the README.md guide I tried to add previous login location in
> the state after run the example well in my laptop.
> I added one more state named "previous_login_location" in UserFn, and
> print it in GreetingsFn. When I build and run again, it complains the
> following error. It seems the system can NOT find the newly added state.
> Question: How to add a new state in this case? How to ensure state
> evolution?
> Thanks!
>
> *Caused by:
> org.apache.flink.statefun.sdk.java.storage.IllegalStorageAccessException:
> Error accessing state previous_login_location; State does not exist; make
> sure that this state was registered.*
>
> *greeter-functions_1 |   at
> org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.slowGetCellOrThrow(ConcurrentAddressScopedStorage.java:102)*
>
> *greeter-functions_1 |   at
> org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.getCellOrThrow(ConcurrentAddressScopedStorage.java:78)*
>
>
>
>
>


[statefun] Add new state failure in Greetings example

2022-02-12 Thread casel.chen
Hello,


I am trying Greeting example of Flink Stateful Functions playground. According 
to the README.md guide I tried to add previous login location in the state 
after run the example well in my laptop.
I added one more state named "previous_login_location" in UserFn, and print it 
in GreetingsFn. When I build and run again, it complains the following error. 
It seems the system can NOT find the newly added state. 
Question: How to add a new state in this case? How to ensure state evolution? 
Thanks!


Caused by: 
org.apache.flink.statefun.sdk.java.storage.IllegalStorageAccessException: Error 
accessing state previous_login_location; State does not exist; make sure that 
this state was registered.

greeter-functions_1 |   at 
org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.slowGetCellOrThrow(ConcurrentAddressScopedStorage.java:102)

greeter-functions_1 |   at 
org.apache.flink.statefun.sdk.java.storage.ConcurrentAddressScopedStorage.getCellOrThrow(ConcurrentAddressScopedStorage.java:78)