Comments (4)
I think it may be tricky to support this for partitioned models.
In partitioned models, the state is separately maintained for each partition (devices). And the correct state for correct partition is passed to the $process action when evaluating model for that partition. For $init and $validate action, it is unclear which state to pass. Calling $init and $validate action for each partition is unreasonable as number of partition may be unknown at the startup - for example receiving from all inputs.
If partition agnostic data is store in the state during the $init and $validate call, then we can probably have a separate state for passing to the $init and $validate action and then clone it to create a partition specific state when first input for a specific partition is received.
from apama-analytics-builder-block-sdk.
ok, understood. That makes sense. What about having a field in the Activation object that indicates if this is the first time $process has been called for a partition? Or is there another way to determine that?
from apama-analytics-builder-block-sdk.
Adding action on Activation would not work either because the same activation object is used across all blocks when evaluating a model but you need status per-block and not per-model. Besides that, I don't think it would be too much improvement as you would still have to check if init is already done or not.
Maybe we can support $init
action on the state event itself which can be called when new state object is created for a partition.
event MyBlock_$State {
MyBlock_$Parameters $parameters;
...
action $init() { // Called when new instance of this event is created
...
}
}
Also, if you are computing values from parameters which does not change with inputs and across partitions, you do not need to use state object. You can directly store values in a filed on the block event itself.
from apama-analytics-builder-block-sdk.
Your last comment is spot on: my requirement can actually be fulfilled without storing the derived parameters in a state object. Did not consider this as I needed the state for other purposes anyway. I have a hard time finding other use cases at the moment, so unsure if this feature is really required.
I like your suggestion about $init but not that it would require another field $parameters that you would need to know to add by convention.
from apama-analytics-builder-block-sdk.
Related Issues (9)
- Pysys project template for Block tests HOT 1
- Upload without local Apama install HOT 1
- Add list of defined categories HOT 2
- Build shoud skip .git and .github directories HOT 2
- SDK does not work Apama Core Components installation HOT 2
- TestFramework should inject Cumulocity_Utils.mon HOT 1
- Test framework should support setting the initial correlator time HOT 2
- Documentation link to Apama Python documentation is broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apama-analytics-builder-block-sdk.