Github user davidyan74 commented on a diff in the pull request:
https://github.com/apache/apex-malhar/pull/324#discussion_r72001616
--- Diff:
library/src/test/java/org/apache/apex/malhar/lib/state/spillable/SpillableArrayListImplTest.java
---
@@ -0,0 +1,458 @@
+package org.apache.apex.malhar.lib.state.spillable;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+import
org.apache.apex.malhar.lib.state.spillable.inmem.InMemSpillableStateStore;
+import org.apache.apex.malhar.lib.utils.serde.SerdeStringSlice;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Created by tfarkas on 6/19/16.
+ */
+public class SpillableArrayListImplTest
+{
+ public static final byte[] ID1 = new byte[]{(byte)0};
+ public static final byte[] ID2 = new byte[]{(byte)1};
+
+ @Rule
+ public SpillableTestUtils.TestMeta testMeta = new
SpillableTestUtils.TestMeta();
+
+ @Test
+ public void simpleAddGetAndSetTest1()
+ {
+ InMemSpillableStateStore store = new InMemSpillableStateStore();
+
+ simpleAddGetAndSetTest1Helper(store);
+ }
+
+ @Test
+ public void simpleAddGetAndSetManagedStateTest1()
+ {
+ simpleAddGetAndSetTest1Helper(testMeta.store);
+ }
+
+ public void simpleAddGetAndSetTest1Helper(SpillableStateStore store)
+ {
+ SpillableArrayListImpl<String> list = new SpillableArrayListImpl<>(0L,
ID1, store,
+ new SerdeStringSlice(), 1);
+
+ store.setup(testMeta.operatorContext);
+ list.setup(testMeta.operatorContext);
+
+ long windowId = 0L;
+ store.beginWindow(windowId);
+ list.beginWindow(windowId);
+ windowId++;
--- End diff --
Should this increment be done before the next beginWindow()? It looks like
the incremented windowId is used for the checkpoint callbacks later on but
shouldn't the callbacks get the windowId before the increment?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---