Skip to content
This repository was archived by the owner on Apr 4, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
622cae4
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz Dec 20, 2016
daa3ffc
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz Dec 20, 2016
46042fd
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz Dec 23, 2016
7f572a1
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 2, 2017
b20f044
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 4, 2017
066c8e2
Merge branch 'master' of https://github.com/apache/falcon
Jan 5, 2017
e3728d5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal Jan 6, 2017
a93d71a
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal Jan 6, 2017
fda3b28
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 7, 2017
a932633
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal Jan 10, 2017
e39808d
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 22, 2017
778c579
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz Jan 22, 2017
9cd8c17
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 23, 2017
9c2f0a5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 30, 2017
9ff05df
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jan 31, 2017
ed65aa0
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 2, 2017
ba60452
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 2, 2017
7814fba
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 10, 2017
fc6ef2b
Merge branch 'master' of https://github.com/apache/falcon
Feb 20, 2017
41da933
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal Feb 20, 2017
2e12279
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Feb 22, 2017
7f3932c
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal Feb 23, 2017
03bedde
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Apr 20, 2017
f8fde4f
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz Jul 20, 2017
fdc9b82
FALCON-795 logging statements added
PracheerAgarwal-zz Aug 2, 2017
73d47e3
test
PracheerAgarwal-zz Aug 3, 2017
1bf815f
FALCON-795 logging statements added
PracheerAgarwal-zz Aug 4, 2017
afdf0bd
Removing unused imports
PracheerAgarwal-zz Aug 4, 2017
b367f34
checkstyle errors
PracheerAgarwal-zz Aug 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public void onRemove(Entity entity) throws FalconException {
}
Process process = (Process) entity;
if (process.getSla() != null) {
LOG.debug("Removing process:{} from monitoring", process.getName());
backlogMetricStore.deleteEntityBackLogInstances(entity.getName(), entity.getEntityType().name());
entityBacklogs.remove(entity);
process = EntityUtil.getEntity(entity.getEntityType(), entity.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void processSLACandidates(){
if (pendingInstanceBeanList == null || pendingInstanceBeanList.isEmpty()){
return;
}
LOG.trace("In processSLACandidates :" + pendingInstanceBeanList.size());
LOG.debug("In processSLACandidates :" + pendingInstanceBeanList.size());
try{
for (PendingInstanceBean pendingInstanceBean : pendingInstanceBeanList) {

Expand All @@ -129,7 +129,7 @@ void processSLACandidates(){
if (schedulableEntityInstances.isEmpty()){
store.deleteEntityAlertInstance(entityName, cluster.getName(), nominalTime,
entityType);
return;
continue;
}
List<SchedulableEntityInstance> schedulableEntityList = new ArrayList<>(schedulableEntityInstances);
SchedulableEntityInstance schedulableEntityInstance = schedulableEntityList.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.apache.falcon.security.CurrentUser;
import org.apache.falcon.util.DateUtil;
import org.apache.falcon.util.DeploymentUtil;
import org.apache.falcon.util.RuntimeProperties;
import org.apache.falcon.util.StartupProperties;
import org.apache.falcon.workflow.WorkflowEngineFactory;
import org.apache.falcon.workflow.engine.AbstractWorkflowEngine;
Expand Down Expand Up @@ -207,6 +208,7 @@ public void onRemove(Entity entity) throws FalconException {
if (feed.getSla() != null && feed.getLocations() != null) {
for (Cluster cluster : feed.getClusters().getClusters()) {
if (currentClusters.contains(cluster.getName()) && FeedHelper.getSLA(cluster, feed) != null) {
LOG.debug("Removing feed:{} for monitoring", feed.getName());
MONITORING_JDBC_STATE_STORE.deleteMonitoringEntity(feed.getName(), EntityType.FEED.toString());
MONITORING_JDBC_STATE_STORE.deletePendingInstances(feed.getName(), cluster.getName(),
EntityType.FEED.toString());
Expand All @@ -218,6 +220,7 @@ public void onRemove(Entity entity) throws FalconException {
Process process = (Process) entity;
if (process.getSla() != null){
for (org.apache.falcon.entity.v0.process.Cluster cluster : process.getClusters().getClusters()) {
LOG.debug("Removing process:{} for monitoring", process.getName());
if (currentClusters.contains(cluster.getName())) {
MONITORING_JDBC_STATE_STORE.deleteMonitoringEntity(process.getName(),
EntityType.PROCESS.toString());
Expand Down Expand Up @@ -316,6 +319,7 @@ public void init() throws FalconException {

freq = StartupProperties.get().getProperty("entity.sla.lookAheadWindow.millis", "900000");
lookAheadWindowMillis = Integer.parseInt(freq);

ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
addPendingEntityInstances(now());
executor.scheduleWithFixedDelay(new Monitor(), 0, statusCheckFrequencySeconds, TimeUnit.SECONDS);
Expand Down Expand Up @@ -364,6 +368,8 @@ public void run() {
// add Instances from last checked time to 10 minutes from now(some buffer for status check)
Date newCheckPointTime = new Date(now().getTime() + lookAheadWindowMillis);
addPendingEntityInstances(newCheckPointTime);
} else {
LOG.debug("No entities present for sla monitoring.");
}
} catch (Throwable e) {
LOG.error("Feed SLA monitoring failed: ", e);
Expand Down Expand Up @@ -449,8 +455,13 @@ private boolean checkEntityInstanceAvailability(String entityName, String cluste
if (entityType.equalsIgnoreCase(EntityType.PROCESS.toString())){
LOG.trace("Checking instance availability status for entity:{}, cluster:{}, "
+ "instanceTime:{}", entity.getName(), clusterName, nominalTime, entityType);
AbstractWorkflowEngine wfEngine = WorkflowEngineFactory.getWorkflowEngine();

if ((System.currentTimeMillis() - nominalTime.getTime())/(1000*60*60*24) >= Integer.parseInt(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the else part of if (instancesResult.getInstances().length > 0) .. Lets not eagerly assume the instance info is not available.

RuntimeProperties.get().getProperty("worklflow.expiration.period", "7"))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the property name to a constant field. Also, the property name can be : workflow.history.expiration.period.days (more intuitive and also indicates the time unit)

return true;
}

AbstractWorkflowEngine wfEngine = WorkflowEngineFactory.getWorkflowEngine();
InstancesResult instancesResult = wfEngine.getStatus(entity, nominalTime,
new Date(nominalTime.getTime() + 200), PROCESS_LIFE_CYCLE, false);
if (instancesResult.getInstances().length > 0) {
Expand Down
3 changes: 3 additions & 0 deletions src/conf/runtime.properties
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ falcon.current.colo=local

### Timeout factor for processes ###
instance.timeout.factor=5

### Workflow expiration period for oozie ###
worklflow.expiration.period=7