|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectstreamcruncher.api.WindowSizeProvider
public class WindowSizeProvider
This Provider Class enables Window sizes in Partitions to be customized at Run-time. The default value is the one provided in the Query as part of the Partition definition.
If the Partition definition is
.. from test (partition by country, state, city store latest 10) .. .,
then the size is 10.
Note: This object is not Thread-safe.
provideSize(Object[])| Field Summary | |
|---|---|
static java.lang.String |
name
|
| Constructor Summary | |
|---|---|
WindowSizeProvider()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getName()
|
int |
getSize()
|
int |
provideSize(java.lang.Object[] levelValues)
|
void |
setSize(int size)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String name
| Constructor Detail |
|---|
public WindowSizeProvider()
| Method Detail |
|---|
public static java.lang.String getName()
public int getSize()
public void setSize(int size)
public int provideSize(java.lang.Object[] levelValues)
levelValues - The Partition values at each level for that Partition.
Ex: For
.. from test (partition by country, state, city store latest 10) ..,
where there are 2 Events -
("US", "California", "San Jose", "warp-drive", .. more properties)
and
("India", "Karnataka", "Bangalore", "force-field" .. other props)
the parameter will contain
["US", "California", "San Jose"] and
["India", "Karnataka", "Bangalore"]
respectively.
This method is invoked before creating a Window for that Partition (level values). Also, if the Partition gets destroyed - in Time based Windows and Tumbling Windows, and gets re-created later, then this method gets invoked for that Partition.
Once the Window gets created with the specified size (default or otherwise), this method will not get invoked unless it gets re-created.
If the Partition is anonymous(.. partition by store latest 10.. ), then
this parameter will be a zero length Array.
size.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||