You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@falcon.apache.org by Pallavi Rao <pa...@inmobi.com> on 2015/10/13 13:53:30 UTC

Re: Review Request 35724: Base framework of the native scheduler

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/
-----------------------------------------------------------

(Updated Oct. 13, 2015, 11:53 a.m.)


Review request for Falcon and Srikanth Sundarrajan.


Changes
-------

Addressed all review comments, except, splitting up of ExecutionInstance to bean and executor. That will be taken up as part of the StateStore JIRA (so the bean can cleanly address the store requirements too).


Bugs: FALCON-1213
    https://issues.apache.org/jira/browse/FALCON-1213


Repository: falcon-git


Description
-------

The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.


Diffs (updated)
-----

  common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
  pom.xml 54e6cd1 
  scheduler/pom.xml PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
  scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
  scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
  scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
  webapp/pom.xml e63aa44 

Diff: https://reviews.apache.org/r/35724/diff/


Testing
-------

New UTs have been added.


Thanks,

Pallavi Rao


Re: Review Request 35724: Base framework of the native scheduler

Posted by Pallavi Rao <pa...@inmobi.com>.

> On Oct. 19, 2015, 5:50 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/StateService.java, line 72
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097312#file1097312line72>
> >
> >     Why is this required? Won't stateStore handle this during onAdd itself?

Valid point. This code path doesn't get executed as long as we have config store. The reason I put that in is that eventually when we move to a single store (both config and state), submits will also be handled by StateService. This part of the code is a little futuristic.


> On Oct. 19, 2015, 5:50 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/StateService.java, line 65
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097312#file1097312line65>
> >
> >     There seems to be a conflict in case of responsibilities here. StateStore seems to be managing some of the events itself through ConfigurationChangeListener interface and they also seem to be handled through this interface also.

Eventually, when we merge state and config store, the StateService is supposed to be self-sufficient. But, till that time, State store will piggy back on config store for add/remove. Any intermediate state change is handled only here.


> On Oct. 19, 2015, 5:50 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java, line 31
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097292#file1097292line31>
> >
> >     It seems like this is used solely for the purpose of determining the type of the event. It will be much better to have an enum type instead of using source to determine the type of event.

Not really. It is also used during lookup and redirect of registration to Notification Services.


- Pallavi


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review103098
-----------------------------------------------------------


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Ajay Yadava <aj...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review103098
-----------------------------------------------------------



scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java (line 31)
<https://reviews.apache.org/r/35724/#comment160986>

    It seems like this is used solely for the purpose of determining the type of the event. It will be much better to have an enum type instead of using source to determine the type of event.



scheduler/src/main/java/org/apache/falcon/state/StateService.java (line 65)
<https://reviews.apache.org/r/35724/#comment160990>

    There seems to be a conflict in case of responsibilities here. StateStore seems to be managing some of the events itself through ConfigurationChangeListener interface and they also seem to be handled through this interface also.



scheduler/src/main/java/org/apache/falcon/state/StateService.java (line 72)
<https://reviews.apache.org/r/35724/#comment160988>

    Why is this required? Won't stateStore handle this during onAdd itself?


- Ajay Yadava


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Pallavi Rao <pa...@inmobi.com>.

> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > common/src/main/java/org/apache/falcon/entity/EntityUtil.java, line 1041
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097275#file1097275line1041>
> >
> >     This function assumes that all jobs for an entity run with same priority, which is not true in case of feed.

Ok. So, a single method cannot handle both process and Feed as stage will also be an input for Feed. I modified this method to return priority only for Process. We can have a separate method to return the priority for a stage of a feed.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java, line 25
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097281#file1097281line25>
> >
> >     Since there are several state stores, can we disambiguate it by something like "SchedulerStateStoreException"?

There shouldn't be multiple state stores. There is config store, there is a graph store and there should only be one state store. Hence the name.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java, line 50
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097282#file1097282line50>
> >
> >     This class contains the get(..) method and it is also inherited by ProcessExecutor and FeedExecutor which also inherits this. 
> >     
> >     Getting the relevant exectuor should not be part of the executor and this inheritance seems counter intuitive.

Agreed. Removed that method and moved creation to FalconExecutionService.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java, line 36
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097283#file1097283line36>
> >
> >     Can you please create a JIRA for all the pending TODOs and remove them from the code?

This will done when we do the state store (FALCON 1234) where we'll separate the ExecutionInstance bean and InstanceExecutor. But, would still to keep the todo around as a quick note to whoever implements this.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java, line 62
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097284#file1097284line62>
> >
> >     There are two ways of doing the same thing - get an entity executor.
> >     1. EntityExecutor.get(..)
> >     2. getEntityExecutor(..)
> >     
> >     There should actually be one way of doing it which takes care of caching and initialization both. Otherwise caching advantage is not guaranteed, right?

Agreed. I would like to have creation and retrieval separate, hence, have 2 methods. But, yes, agreed and removed EntityExecutor.get() method.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java, line 71
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097284#file1097284line71>
> >
> >     create JIRA and remove todo?

Part of the migration JIRA (FALCON 1233), but, would still like to keep the TODO around as quick note till it is addressed.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java, line 121
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097286#file1097286line121>
> >
> >     please create JIRA and remove TODO

Part of the data notification service JIRA (FALCON 1230), but, would still like to keep the TODO around as quick note till it is addressed.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java, line 139
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097286#file1097286line139>
> >
> >     Please create JIRA and remove TODO.

Unnecessary todo, as this was taken care of. Removed TODO


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java, line 144
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097286#file1097286line144>
> >
> >     Please create JIRA and remove TODO.

Unnecessary todo, as this was taken care of. Removed TODO


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java, line 276
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097286#file1097286line276>
> >
> >     There should be a way to unregister from all notifications.

Correct. There was already a method. Somehow missed using it here. Updated.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/pom.xml, line 57
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097277#file1097277line57>
> >
> >     Why is this dependency required?

The Builders are still part of that package and hence the dependency. Will take up the refactor a little later.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 73
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line73>
> >
> >     Please create JIRA and remove TODO.

Removed TODO as it is no longer relevant.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 73
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line73>
> >
> >     Please remove TODO and create JIRA if needed.

Package is different. So, should be fine.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 369
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line369>
> >
> >     Use ProcessHelper.getCluster() method instead.

Totally makes sense. Made the change.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java, line 95
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097296#file1097296line95>
> >
> >     Please remove TODO and create JIRA.

No functionality is affected to add a JIRA. Right now there is no support in quartz. We should just use Quartz when the support is added. Just updated the TODO for future.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java, line 104
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097296#file1097296line104>
> >
> >     Delay should be calculated from lastInstanceTime instead of currentTime, otherwise it can result in an error.

Good Catch. Fixed it.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java, line 33
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097315#file1097315line33>
> >
> >     Please remove TODO and create JIRA.

JIRA already present (FALCON-1234). Just a handy note for whoever implements it.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/ID.java, line 33
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097308#file1097308line33>
> >
> >     This class should be subclassed into two classes.
> >     1. EntityId
> >     2. InstanceId
> >     
> >     This will ensure that the objects are always well constructed. 
> >     
> >     It will also make it easier for use instead of remembering which method to use.
> >     
> >     It will improve readability and modularity.

Agree that it is bit overloaded. I tried separating this out into EntityID and InstanceID (as subclasses of ID) and the code got a lot messier, with instanceof checks all over the place as the notification services accept ID (and that I don't want to change).

I made the changes and had to revert becaue the checks to see which sub-class of the ID was meant to be used in that place. So, prefer to keep it this way for now.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java, line 34
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097315#file1097315line34>
> >
> >     We should divide it into separate interfaces(entity related, instance related) and finally extend one interface from all of them to be implemented by all implementations. This will make the code more manageable.

Makes sense. Done.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java, line 32
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097316#file1097316line32>
> >
> >     This looks like hugely overlapping with AbstractWorkflowEngine (if not duplicate)

Yes. It is because this is the interface that talks to a DAG Engine and the only DAG Engine we know of and need to support right now is Oozie.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java, line 105
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097316#file1097316line105>
> >
> >     Is it always specific to Oozie?

Nope. Fixed it.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java, line 43
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097317#file1097317line43>
> >
> >     So there can never be two DAGEngines for a cluster? Why is this a restriction?

A DAG Engine can only be tied to a cluster mainly because the engine endpoints (such as oozie) is currently abstracted out at the cluster level. Individual entities do not specify the endpoints. An entity can belong to multiple clusters though if 2 different DAG Engines need to be used. Just preserving the current semantics.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java, line 133
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097318#file1097318line133>
> >
> >     Please create JIRA and remove TODO.

Warrants a new JIRA. Created FALCON-1547.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java, line 31
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097317#file1097317line31>
> >
> >     This property is not defined in startup.properties. I think this will throw an error in runtime.

Will fail during startup itself because the Services that use this are initialized during startup.


- Pallavi


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review102859
-----------------------------------------------------------


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Pallavi Rao <pa...@inmobi.com>.

> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java, line 46
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097315#file1097315line46>
> >
> >     Passing string is error prone, can we change it to accept an object which represents EntityKey/InstanceKey? This will result in stronger contract.

Makes sense. Addressed it.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java, line 99
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097282#file1097282line99>
> >
> >     Entity and instance level operations are all in one class. Can we please separate entity level operations and instance level operations in different classes?

Will be addressed in FALCON-1548


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 224
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line224>
> >
> >     Can we separate out the entity and instance level operations?

Will be addressed in FALCON-1548


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 236
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line236>
> >
> >     We should avoid typecasting and should leverage compile time checks as much as possible.

In general, yes. But, in this case, since the method signature has ExecutionInstance as it should, it is difficult to avoid this.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java, line 269
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097286#file1097286line269>
> >
> >     Please create JIRA and remove TODO.

FALCON-1549. Still want to keep the TODO in code for easy reference.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 174
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line174>
> >
> >     Please create JIRA and remove TODO.

FALCON-1549. Still want to keep the TODO in code for easy reference.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 174
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line174>
> >
> >     Please remove TODO and create JIRA.

FALCON-1549. Still want to keep the TODO in code for easy reference.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 312
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line312>
> >
> >     Please create JIRA and remove TODO.

FALCON-1549. Still want to keep the TODO in code for easy reference.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 379
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line379>
> >
> >     Please create JIRA and remove todos.

FALCON-1549. Still want to keep the TODO in code for easy reference.


> On Oct. 19, 2015, 4:51 a.m., Ajay Yadava wrote:
> > scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java, line 380
> > <https://reviews.apache.org/r/35724/diff/3/?file=1097287#file1097287line380>
> >
> >     Please create JIRA and remove TODO.

FALCON-1549. Still want to keep the TODO in code for easy reference.


- Pallavi


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review102859
-----------------------------------------------------------


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Ajay Yadava <aj...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review102859
-----------------------------------------------------------


There are lots of feedback from earlier review, which are not yet addressed. Can you please address them?


common/src/main/java/org/apache/falcon/entity/EntityUtil.java (line 1041)
<https://reviews.apache.org/r/35724/#comment160653>

    This function assumes that all jobs for an entity run with same priority, which is not true in case of feed.



common/src/main/java/org/apache/falcon/entity/EntityUtil.java (line 1055)
<https://reviews.apache.org/r/35724/#comment160654>

    We already support different priorities for different stages in the feed. This may cause correctional issues.



common/src/main/java/org/apache/falcon/entity/EntityUtil.java (line 1067)
<https://reviews.apache.org/r/35724/#comment160655>

    This should throw an exception because priority doesn't make sense for other entities like cluster.



scheduler/pom.xml (line 57)
<https://reviews.apache.org/r/35724/#comment160943>

    Why is this dependency required?



scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java (line 25)
<https://reviews.apache.org/r/35724/#comment160944>

    nit: ServiceException sounds too generic and doesn't convey a lot of information about the exception. Can we make it something more specific to scheduler? NotificationServiceException?



scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java (line 25)
<https://reviews.apache.org/r/35724/#comment160945>

    Since there are several state stores, can we disambiguate it by something like "SchedulerStateStoreException"?



scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java (line 50)
<https://reviews.apache.org/r/35724/#comment160960>

    This class contains the get(..) method and it is also inherited by ProcessExecutor and FeedExecutor which also inherits this. 
    
    Getting the relevant exectuor should not be part of the executor and this inheritance seems counter intuitive.



scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java (line 53)
<https://reviews.apache.org/r/35724/#comment160946>

    Will UnsupportedOperationException be more appropriate for this case?



scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java (line 99)
<https://reviews.apache.org/r/35724/#comment160947>

    Entity and instance level operations are all in one class. Can we please separate entity level operations and instance level operations in different classes?



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 36)
<https://reviews.apache.org/r/35724/#comment160948>

    Can you please create a JIRA for all the pending TODOs and remove them from the code?



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 45)
<https://reviews.apache.org/r/35724/#comment160972>

    Make it final.



scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java (line 62)
<https://reviews.apache.org/r/35724/#comment160950>

    There are two ways of doing the same thing - get an entity executor.
    1. EntityExecutor.get(..)
    2. getEntityExecutor(..)
    
    There should actually be one way of doing it which takes care of caching and initialization both. Otherwise caching advantage is not guaranteed, right?



scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java (line 71)
<https://reviews.apache.org/r/35724/#comment160949>

    create JIRA and remove todo?



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 121)
<https://reviews.apache.org/r/35724/#comment160951>

    please create JIRA and remove TODO



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 139)
<https://reviews.apache.org/r/35724/#comment160952>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 144)
<https://reviews.apache.org/r/35724/#comment160953>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 269)
<https://reviews.apache.org/r/35724/#comment160954>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 276)
<https://reviews.apache.org/r/35724/#comment160955>

    There should be a way to unregister from all notifications.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 72)
<https://reviews.apache.org/r/35724/#comment160977>

    This method should accept only Process instead of Entity. This will ensure compile time checks.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 73)
<https://reviews.apache.org/r/35724/#comment160956>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 73)
<https://reviews.apache.org/r/35724/#comment160976>

    Please remove TODO and create JIRA if needed.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 174)
<https://reviews.apache.org/r/35724/#comment160957>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 174)
<https://reviews.apache.org/r/35724/#comment160978>

    Please remove TODO and create JIRA.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 224)
<https://reviews.apache.org/r/35724/#comment160981>

    Can we separate out the entity and instance level operations?



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 236)
<https://reviews.apache.org/r/35724/#comment160982>

    We should avoid typecasting and should leverage compile time checks as much as possible.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 312)
<https://reviews.apache.org/r/35724/#comment160958>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 369)
<https://reviews.apache.org/r/35724/#comment160979>

    Use ProcessHelper.getCluster() method instead.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 379)
<https://reviews.apache.org/r/35724/#comment160980>

    Please create JIRA and remove todos.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 380)
<https://reviews.apache.org/r/35724/#comment160959>

    Please create JIRA and remove TODO.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java (line 95)
<https://reviews.apache.org/r/35724/#comment160962>

    Please remove TODO and create JIRA.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java (line 104)
<https://reviews.apache.org/r/35724/#comment160963>

    Delay should be calculated from lastInstanceTime instead of currentTime, otherwise it can result in an error.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java (line 58)
<https://reviews.apache.org/r/35724/#comment160667>

    Make it final?



scheduler/src/main/java/org/apache/falcon/state/ID.java (line 33)
<https://reviews.apache.org/r/35724/#comment160971>

    This class should be subclassed into two classes.
    1. EntityId
    2. InstanceId
    
    This will ensure that the objects are always well constructed. 
    
    It will also make it easier for use instead of remembering which method to use.
    
    It will improve readability and modularity.



scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java (line 33)
<https://reviews.apache.org/r/35724/#comment160964>

    Please remove TODO and create JIRA.



scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java (line 34)
<https://reviews.apache.org/r/35724/#comment160965>

    We should divide it into separate interfaces(entity related, instance related) and finally extend one interface from all of them to be implemented by all implementations. This will make the code more manageable.



scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java (line 46)
<https://reviews.apache.org/r/35724/#comment160966>

    Passing string is error prone, can we change it to accept an object which represents EntityKey/InstanceKey? This will result in stronger contract.



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java (line 32)
<https://reviews.apache.org/r/35724/#comment160968>

    This looks like hugely overlapping with AbstractWorkflowEngine (if not duplicate)



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java (line 105)
<https://reviews.apache.org/r/35724/#comment160967>

    Is it always specific to Oozie?



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java (line 31)
<https://reviews.apache.org/r/35724/#comment160969>

    This property is not defined in startup.properties. I think this will throw an error in runtime.



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java (line 34)
<https://reviews.apache.org/r/35724/#comment160975>

    Make it final.



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java (line 39)
<https://reviews.apache.org/r/35724/#comment160970>

    Repeated code. The two methods can be refactored to avoid repetition by calling the overloaded version.



scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java (line 43)
<https://reviews.apache.org/r/35724/#comment160973>

    So there can never be two DAGEngines for a cluster? Why is this a restriction?



scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java (line 133)
<https://reviews.apache.org/r/35724/#comment160974>

    Please create JIRA and remove TODO.


- Ajay Yadava


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Pallavi Rao <pa...@inmobi.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/#review101609
-----------------------------------------------------------



scheduler/pom.xml (line 92)
<https://reviews.apache.org/r/35724/#comment159041>

    Moved version to parent pom. Updated to latest version.



scheduler/pom.xml (line 103)
<https://reviews.apache.org/r/35724/#comment159043>

    Need it at 1.9.5 because PowerMock uses that and I intend to use PowerMock.



scheduler/pom.xml (line 109)
<https://reviews.apache.org/r/35724/#comment159042>

    Moved version to parent pom. Updated to latest release.



scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java (line 23)
<https://reviews.apache.org/r/35724/#comment159046>

    Oops.. Fixed.



scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java (line 33)
<https://reviews.apache.org/r/35724/#comment159064>

    Has a different package name, so NotificationHandler should be ok.



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 38)
<https://reviews.apache.org/r/35724/#comment159066>

    External ID is the ID used to identify the Job submitted to the DAG Engine, as returned by the DAG Engine. For example, for Oozie this would be the workflow Id. Added some doc.
    
    Regarding tracking URL, right now, the URL can be easily constructed given a DAGEngine and externalId, so don't intend to store it. But, I'm open to adding it, if required in the future.



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 39)
<https://reviews.apache.org/r/35724/#comment159067>

    Renamed to instanceTime. 
    
    You are right. It is not mandatory. But, in case of a-periodic, it will still indicate at what time the instance was created. Added another constructor without instanceTime.



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 104)
<https://reviews.apache.org/r/35724/#comment159069>

    My current thought is to create a new instance per run, in which the instance Id will be a combination of entity name, cluster, instanceTime and runId. Will implement as part of FALCON-1512.



scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java (line 145)
<https://reviews.apache.org/r/35724/#comment159068>

    Well. Individual instances may need to be suspended too by a user and not the the entity itself. Hence, this method.
    
    But, yes, like we have EntityExecutor and Entity bean. I do want to separate out InstanceExecutor and Instance bean. Will take that up as a separate JIRA and the instance bean will also have to cater to state store.



scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java (line 46)
<https://reviews.apache.org/r/35724/#comment159071>

    Yes. Changed.



scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java (line 50)
<https://reviews.apache.org/r/35724/#comment159072>

    The private constructor is invoked during class loading itself as it is assigned to a private static variable. So, there can only be single instance.



scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java (line 53)
<https://reviews.apache.org/r/35724/#comment159076>

    Changed to return Entity and not EntityState



scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java (line 26)
<https://reviews.apache.org/r/35724/#comment159063>

    Since the package name is different, it should be ok.



scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java (line 33)
<https://reviews.apache.org/r/35724/#comment159077>

    Makes sense. Changed to onEvent.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 60)
<https://reviews.apache.org/r/35724/#comment159078>

    The reason I didn't make this a plain bean was to support instance level operations such as suspend, kill, resume. I can split ExecutionInstance as InstanceExecutor and the bean to make things simpler.
    
    Makes sense to use DI for DAGEngine and ExecutionService.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 108)
<https://reviews.apache.org/r/35724/#comment159397>

    Since inputs are feeds, In line 100, I check if input is null. If no input, the execution does not  reach here.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 109)
<https://reviews.apache.org/r/35724/#comment159398>

    Oops. Fixed it.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 120)
<https://reviews.apache.org/r/35724/#comment159399>

    This and next few lines are only illustrative, to say, we'll have to register to DataAvailabilityService, as the TODO above indicates. I'll remove these to avoid confusion.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 241)
<https://reviews.apache.org/r/35724/#comment159400>

    Corrected it.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java (line 273)
<https://reviews.apache.org/r/35724/#comment159401>

    1. Awaited predicates is not cleaned up on purpose. destroy() is called during abnormal termination such as suspend or killed. In which case, we want to keep the awaited predicates around for resume/rerun. Are you are suggesting that we re-evaluate the predicates on resumption or re-run?
    
    2. Not sure what you mean here.. Will discuss offline.



scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java (line 141)
<https://reviews.apache.org/r/35724/#comment159246>

    Could be. EntityExecutor has this method too. When we introduce the FeedExecutor will refactor to move the common code into EntityExecutor.



scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java (line 36)
<https://reviews.apache.org/r/35724/#comment159242>

    Changed.



scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java (line 43)
<https://reviews.apache.org/r/35724/#comment159244>

    The request object parameters in addition to handler and callbackID that the notification service uses. For example, the dataLocation, type, etc. in case of data availability. However, handler and callbackID are sufficient to unregister. 
    
    I could use request. But, that would mean keeping the bulkier request object around although it won't be used.



scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java (line 48)
<https://reviews.apache.org/r/35724/#comment159241>

    Not really. Now, it returns a request builder.



scheduler/src/main/java/org/apache/falcon/notification/service/ServicesRegistry.java (line 32)
<https://reviews.apache.org/r/35724/#comment159237>

    Oops.. understand. Renamed this this NotificationServicesRegistry.



scheduler/src/main/java/org/apache/falcon/notification/service/ServicesRegistry.java (line 39)
<https://reviews.apache.org/r/35724/#comment159238>

    Done.



scheduler/src/main/java/org/apache/falcon/notification/service/ServicesRegistry.java (line 40)
<https://reviews.apache.org/r/35724/#comment159239>

    Done.



scheduler/src/main/java/org/apache/falcon/notification/service/ServicesRegistry.java (line 63)
<https://reviews.apache.org/r/35724/#comment159240>

    Yes. In fact, it is. This registry acts more like a router to the notification services.



scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java (line 33)
<https://reviews.apache.org/r/35724/#comment159236>

    Have knocked this off. This isn't used. Latest patch for DataNotification is in FALCON-1230



scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java (line 58)
<https://reviews.apache.org/r/35724/#comment159235>

    Have knocked this off. This isn't used. Latest patch for DataNotification is in FALCON-1230



scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java (line 28)
<https://reviews.apache.org/r/35724/#comment159080>

    Done.



scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java (line 37)
<https://reviews.apache.org/r/35724/#comment159213>

    Agreed. Fixed it.



scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java (line 30)
<https://reviews.apache.org/r/35724/#comment159214>

    Done.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java (line 72)
<https://reviews.apache.org/r/35724/#comment159217>

    The intention is as follows : When a listener registers and says "let me know when this Job completes". We check if the job has already completed, if so, we generate an event immediately. If the job is not complete, we expect that this class will get notified when the job completes as this class is a listener to WorkflowJobEndNotificationService.
    
    JobEndNotificationService has been made reliable as part of FALCON-1231.
    
    Added this clarification as comment.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java (line 124)
<https://reviews.apache.org/r/35724/#comment159218>

    Sure. I have moved out the common code to an onEnd method.
    However, the onSuccess and onFailure methods need to be there as the class implements WorkflowExecutionListener.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 99)
<https://reviews.apache.org/r/35724/#comment159219>

    My bad. Fixed that.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 220)
<https://reviews.apache.org/r/35724/#comment159220>

    When the cache exceeds its size, it is possible that the instance (which is running) can be evicted from cache. That is why, to handle such cases, the onRemoval method persists it in the state upon eviction.
    
    The cache is backed by state (loading cache), so, when we receive a completion event for a particular instance, it will be loaded back into cache.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 288)
<https://reviews.apache.org/r/35724/#comment159221>

    Makes sense. Done



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 335)
<https://reviews.apache.org/r/35724/#comment159222>

    Makes sense. Moved.



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 375)
<https://reviews.apache.org/r/35724/#comment159223>

    Same instance will not have a second run because the State has changed. A new instance can be scheduled (based on parallelism)



scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java (line 430)
<https://reviews.apache.org/r/35724/#comment159224>

    From docs:    
         *  @return a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
         int compare(T o1, T o2);
         
    So, I guess it is ok?



scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java (line 30)
<https://reviews.apache.org/r/35724/#comment159225>

    Done



scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java (line 37)
<https://reviews.apache.org/r/35724/#comment159226>

    Put them in there, to just illustrate my thought process. Will leave it for now. These have already been refactored in FALCON-1230, anyway.



scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java (line 43)
<https://reviews.apache.org/r/35724/#comment159227>

    Yep. As before, just to illustrate. Has been refactored in FALCON-1230.



scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java (line 38)
<https://reviews.apache.org/r/35724/#comment159228>

    Shouldn't be abstract class, knocked it off.



scheduler/src/main/java/org/apache/falcon/notification/service/request/TimeNotificationRequest.java (line 31)
<https://reviews.apache.org/r/35724/#comment159229>

    I agree with the partial construction and that all mandatory parameters should be part of constructor. Introduced builders to be consistent.



scheduler/src/main/java/org/apache/falcon/state/EntityState.java (line 71)
<https://reviews.apache.org/r/35724/#comment159232>

    Thanks. Rectified.



scheduler/src/main/java/org/apache/falcon/state/ID.java (line 33)
<https://reviews.apache.org/r/35724/#comment159538>

    Agree that it is bit overloaded. I tried separating this out into EntityID and InstanceID (as subclasses of ID) and the code got a lot messier, with instanceof checks all over the place as the notification services accept ID (and that I don't want to change).
    
    So, prefer to keep it this way for now.



scheduler/src/main/java/org/apache/falcon/state/ID.java (line 189)
<https://reviews.apache.org/r/35724/#comment159234>

    You are right. Fixed it.



scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java (line 80)
<https://reviews.apache.org/r/35724/#comment159079>

    Yes. Otherwise there is no singleton guarantee. Corrected it.


- Pallavi Rao


On Oct. 13, 2015, 11:53 a.m., Pallavi Rao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35724/
> -----------------------------------------------------------
> 
> (Updated Oct. 13, 2015, 11:53 a.m.)
> 
> 
> Review request for Falcon and Srikanth Sundarrajan.
> 
> 
> Bugs: FALCON-1213
>     https://issues.apache.org/jira/browse/FALCON-1213
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
>   pom.xml 54e6cd1 
>   scheduler/pom.xml PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/ServiceException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
>   scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
>   scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
>   scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
>   webapp/pom.xml e63aa44 
> 
> Diff: https://reviews.apache.org/r/35724/diff/
> 
> 
> Testing
> -------
> 
> New UTs have been added.
> 
> 
> Thanks,
> 
> Pallavi Rao
> 
>


Re: Review Request 35724: Base framework of the native scheduler

Posted by Pallavi Rao <pa...@inmobi.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35724/
-----------------------------------------------------------

(Updated Oct. 19, 2015, 12:08 p.m.)


Review request for Falcon and Srikanth Sundarrajan.


Changes
-------

Review comments addressed


Bugs: FALCON-1213
    https://issues.apache.org/jira/browse/FALCON-1213


Repository: falcon-git


Description
-------

The patch has the basic framework for the scheduler. Each of the individual service needs to be implemented completely and will be done as separate JIRAs. The intention of the patch is ensure the base framework satisfies all use cases and get any early feedback in terms of course correction.


Diffs (updated)
-----

  common/src/main/java/org/apache/falcon/entity/EntityUtil.java 3ab9339 
  pom.xml 54e6cd1 
  scheduler/pom.xml PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/DAGEngineException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/InvalidStateTransitionException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/NotificationServiceException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/exception/StateStoreException.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/EntityExecutor.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ExecutionInstance.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/FalconExecutionService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/NotificationHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutionInstance.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/ProcessExecutor.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/execution/SchedulerUtil.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/FalconNotificationService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/NotificationServicesRegistry.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/DataEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/Event.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/JobCompletedEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/JobScheduledEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/event/TimeElapsedEvent.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/AlarmService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/DataAvailabilityService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/JobCompletionService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/impl/SchedulerService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/AlarmRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/DataNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/JobCompletionNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/JobScheduleNotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/notification/service/request/NotificationRequest.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/predicate/Predicate.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/EntityState.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/EntityStateChangeHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/ID.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/InstanceState.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/InstanceStateChangeHandler.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/StateMachine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/StateService.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/AbstractStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/EntityStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/InMemoryStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/InstanceStateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/state/store/StateStore.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/DAGEngineFactory.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/FalconWorkflowEngine.java PRE-CREATION 
  scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/FalconExecutionServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/MockDAGEngine.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/execution/SchedulerUtilTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/notification/service/AlarmServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/notification/service/SchedulerServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/predicate/PredicateTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/state/EntityStateServiceTest.java PRE-CREATION 
  scheduler/src/test/java/org/apache/falcon/state/InstanceStateServiceTest.java PRE-CREATION 
  scheduler/src/test/resources/config/cluster/cluster-0.1.xml PRE-CREATION 
  scheduler/src/test/resources/config/feed/feed-0.1.xml PRE-CREATION 
  scheduler/src/test/resources/config/process/process-0.1.xml PRE-CREATION 
  webapp/pom.xml e63aa44 

Diff: https://reviews.apache.org/r/35724/diff/


Testing
-------

New UTs have been added.


Thanks,

Pallavi Rao