[windup-dev] Where to store intermediate data?

Brad Davis bdavis at redhat.com
Fri Jul 25 14:55:26 EDT 2014


If you want something to keep data around for the whole run, it makes sense to put it to the graph.  The idea for the graph is to keep data out of memory full time, because if the data is being kept around a long time, you want to have the graph purge that from memory to keep your heap tidy.  Otherwise, like Windup 1, large applications or apps with a lot of meta information in memory can cause a out of memory exception.

So, to me it makes sense to have an in-memory context for the execution of a rule.  But, if you are having data beyond one rule that you plan to keep around to reason on potentially by other rules, it would get put to the graph.

Example:
You have an XML file ... 
You have a rule that says "when i have the root node /example,"
  - extract the xml's name to a temporary variable
And a sub-rule that says "for each node //somevalue"
  - extract the //somevalue/@somexpath locally for the context
And an outcome for each of those //somevalue nodes: Add in the Hint to the somevalue's XML Line position in the XML of: "This is an example of $somevalue within the XML named $xmlName"

So the hint itself would be added to the Graph since you want that to be around for a long time after this rule runs... but the variable of the XML file's name, and specifically the local context when it is looping (for each) on some XPath Expression would be in memory and not written to the graph.  Make sense?



Brad Davis
Red Hat Consulting
Email: bdavis at redhat.com | c: 980.226.7865 | http://www.redhat.com 


----- Original Message -----
From: "Ondrej Zizka" <ozizka at redhat.com>
To: windup-dev at lists.jboss.org
Sent: Friday, July 25, 2014 2:44:51 PM
Subject: Re: [windup-dev] Where to store intermediate data?

A rule, or perhaps during whole execution.
Actually those are 2 different things.

Currently, I need whole runtime scope - for Model metadata.

And also, I was thinking about a rule computing a sum of e.g. JMS queues 
capacities (or anything such).
That would need an iteration, and within iteration, we have VarStack, 
but that's only for WindupVertexFrames, so I was thinking what the user 
has to store data like this, which are not to be reported.

Ondra



On 25.7.2014 20:39, Brad Davis wrote:
> Oh gotcha.  So you mean like a map to pass data along during the execution of a rule itself?
>
> Brad Davis
> Red Hat Consulting
> Email: bdavis at redhat.com | c: 980.226.7865 | http://www.redhat.com
>
>
> ----- Original Message -----
> From: "Ondrej Zizka" <ozizka at redhat.com>
> To: windup-dev at lists.jboss.org
> Sent: Friday, July 25, 2014 2:21:47 PM
> Subject: Re: [windup-dev] Where to store intermediate data?
>
> Right, but Lincoln doesn't want the intermediate data in the graph, if I
> understand him correctly.
> That's why I am looking for some Map in our Java data structures.
>
> Ondra
>
>
>
> On 25.7.2014 20:11, Brad Davis wrote:
>> Alternative to adding data to the graph vertex directly, you could create a intermediate vertex that has a reference to another vertex you are referring to.
>>
>> IntermediateMapVertex -> SomeOtherVertex
>>
>> Brad Davis
>> Red Hat Consulting
>> Email: bdavis at redhat.com | c: 980.226.7865 | http://www.redhat.com
>>
>>
>> ----- Original Message -----
>> From: "Brad Davis" <bdavis at redhat.com>
>> To: "Windup-dev List" <windup-dev at lists.jboss.org>
>> Sent: Friday, July 25, 2014 2:09:57 PM
>> Subject: Re: [windup-dev] Where to store intermediate data?
>>
>> The Titan implementation already provides caching.  When you say a Map like API, you mean to access the data on the nodes?
>>
>> >From an intermediate data perspective, you can always get the underlying vertex from the Framed Vertex, and then write to it like a Map (Key, Value pair).
>>
>> Brad Davis
>> Red Hat Consulting
>> Email: bdavis at redhat.com | c: 980.226.7865 | http://www.redhat.com
>>
>>
>> ----- Original Message -----
>> From: "Ondrej Zizka" <ozizka at redhat.com>
>> To: "Windup-dev List" <windup-dev at lists.jboss.org>
>> Sent: Friday, July 25, 2014 2:02:06 PM
>> Subject: [windup-dev] Where to store intermediate data?
>>
>> Hi,
>>
>> where should I cache intermediate data? E.g. the model metadata.
>> I expected GraphContext to have some Map-like API, there's none.
>> Should I add it? Or should I clutter the API with it? Or will it be
>> better to store it in the graph afterall?
>>
>> Thanks,
>> Ondra
>> _______________________________________________
>> windup-dev mailing list
>> windup-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/windup-dev
>> _______________________________________________
>> windup-dev mailing list
>> windup-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/windup-dev
>> _______________________________________________
>> windup-dev mailing list
>> windup-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/windup-dev
> _______________________________________________
> windup-dev mailing list
> windup-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/windup-dev
> _______________________________________________
> windup-dev mailing list
> windup-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/windup-dev

_______________________________________________
windup-dev mailing list
windup-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/windup-dev


More information about the windup-dev mailing list