[GitHub] apex-malhar pull request #334: APEXMALHAR-2136 1) Fixed the null pointer exc...

2016-07-07 Thread chaithu14
Github user chaithu14 commented on a diff in the pull request:

https://github.com/apache/apex-malhar/pull/334#discussion_r69947853
  
--- Diff: 
library/src/main/java/org/apache/apex/malhar/lib/state/managed/AbstractManagedStateImpl.java
 ---
@@ -536,6 +538,16 @@ public void setDurationPreventingFreeingSpace(Duration 
durationPreventingFreeing
 this.durationPreventingFreeingSpace = durationPreventingFreeingSpace;
   }
 
+  public IncrementalCheckpointManager getCheckpointManager()
+  {
+return checkpointManager;
+  }
+
+  public void setCheckpointManager(IncrementalCheckpointManager 
checkpointManager)
--- End diff --

Updated as per the comment.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] apex-malhar pull request #334: APEXMALHAR-2136 1) Fixed the null pointer exc...

2016-07-07 Thread chaithu14
Github user chaithu14 commented on a diff in the pull request:

https://github.com/apache/apex-malhar/pull/334#discussion_r69860038
  
--- Diff: 
library/src/main/java/org/apache/apex/malhar/lib/state/managed/AbstractManagedStateImpl.java
 ---
@@ -203,7 +203,12 @@ public void setup(OperatorContext context)
   //delete all the wal files with windows > activationWindow.
   //All the wal files with windows <= activationWindow are loaded and 
kept separately as recovered data.
   try {
-for (long recoveredWindow : 
checkpointManager.getWindowIds(operatorContext.getId())) {
+long[] recoveredWindows = 
checkpointManager.getWindowIds(operatorContext.getId());
+if (recoveredWindows == null) {
+  readerService = Executors.newFixedThreadPool(numReaders, new 
NameableThreadFactory("managedStateReaders"));
+  return;
+}
+for (long recoveredWindow : recoveredWindows) {
--- End diff --

Done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] apex-malhar pull request #334: APEXMALHAR-2136 1) Fixed the null pointer exc...

2016-07-07 Thread chandnisingh
Github user chandnisingh commented on a diff in the pull request:

https://github.com/apache/apex-malhar/pull/334#discussion_r69857656
  
--- Diff: 
library/src/main/java/org/apache/apex/malhar/lib/state/managed/AbstractManagedStateImpl.java
 ---
@@ -203,7 +203,12 @@ public void setup(OperatorContext context)
   //delete all the wal files with windows > activationWindow.
   //All the wal files with windows <= activationWindow are loaded and 
kept separately as recovered data.
   try {
-for (long recoveredWindow : 
checkpointManager.getWindowIds(operatorContext.getId())) {
+long[] recoveredWindows = 
checkpointManager.getWindowIds(operatorContext.getId());
+if (recoveredWindows == null) {
+  readerService = Executors.newFixedThreadPool(numReaders, new 
NameableThreadFactory("managedStateReaders"));
+  return;
+}
+for (long recoveredWindow : recoveredWindows) {
--- End diff --

You can put this block within ```if (recoveredWindows == null)```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] apex-malhar pull request #334: APEXMALHAR-2136 1) Fixed the null pointer exc...

2016-07-07 Thread chandnisingh
Github user chandnisingh commented on a diff in the pull request:

https://github.com/apache/apex-malhar/pull/334#discussion_r69857595
  
--- Diff: 
library/src/main/java/org/apache/apex/malhar/lib/state/managed/AbstractManagedStateImpl.java
 ---
@@ -203,7 +203,12 @@ public void setup(OperatorContext context)
   //delete all the wal files with windows > activationWindow.
   //All the wal files with windows <= activationWindow are loaded and 
kept separately as recovered data.
   try {
-for (long recoveredWindow : 
checkpointManager.getWindowIds(operatorContext.getId())) {
+long[] recoveredWindows = 
checkpointManager.getWindowIds(operatorContext.getId());
+if (recoveredWindows == null) {
+  readerService = Executors.newFixedThreadPool(numReaders, new 
NameableThreadFactory("managedStateReaders"));
--- End diff --

This is already being done at the end. why do you need to duplicate the 
stmt here?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] apex-malhar pull request #334: APEXMALHAR-2136 1) Fixed the null pointer exc...

2016-07-06 Thread chaithu14
GitHub user chaithu14 opened a pull request:

https://github.com/apache/apex-malhar/pull/334

APEXMALHAR-2136 1) Fixed the null pointer exception issue. 2) Added getter 
and setter for IncrementalCheckpointManager



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/chaithu14/incubator-apex-malhar 
APEXMALHAR-2136-NPE-RecoverWindows

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/apex-malhar/pull/334.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #334


commit 15b4858b72955ff2ce83e1817ac3f64c15347106
Author: Chaitanya 
Date:   2016-07-07T05:42:45Z

APEXMALHAR-2136 1) Fixed the null pointer exception issue. 2) Added getter 
and setter for IncrementalCheckpointManager




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---