Package org.apache.falcon.expression

Examples of org.apache.falcon.expression.ExpressionHelper.evaluate()


                String instEndEL = input.getEnd();
                ExpressionHelper evaluator = ExpressionHelper.get();

                Validity processValidity = ProcessHelper.getCluster(process, clusterName).getValidity();
                ExpressionHelper.setReferenceDate(processValidity.getStart());
                Date instStart = evaluator.evaluate(instStartEL, Date.class);
                if (instStart.before(feedStart)) {
                    throw new ValidationException("Start instance  " + instStartEL + " of feed " + feed.getName()
                            + " is before the start of feed " + feedValidity.getStart() + " for cluster "
                            + clusterName);
                }
View Full Code Here


                    throw new ValidationException("Start instance  " + instStartEL + " of feed " + feed.getName()
                            + " is before the start of feed " + feedValidity.getStart() + " for cluster "
                            + clusterName);
                }

                Date instEnd = evaluator.evaluate(instEndEL, Date.class);
                if (instEnd.after(feedEnd)) {
                    throw new ValidationException("End instance  " + instEndEL + " of feed " + feed.getName()
                            + " is before the start of feed " + feedValidity.getStart() + " for cluster "
                            + clusterName);
                }
View Full Code Here

        String feedRetention = FeedHelper.getCluster(feed, clusterName).getRetention().getLimit().toString();
        ExpressionHelper evaluator = ExpressionHelper.get();

        Date now = new Date();
        ExpressionHelper.setReferenceDate(now);
        Date instStart = evaluator.evaluate(startInstance, Date.class);
        long feedDuration = evaluator.evaluate(feedRetention, Long.class);
        Date feedStart = new Date(now.getTime() - feedDuration);

        if (instStart.before(feedStart)) {
            throw new ValidationException("StartInstance :" + startInstance + " of process is out of range for Feed: "
View Full Code Here

        ExpressionHelper evaluator = ExpressionHelper.get();

        Date now = new Date();
        ExpressionHelper.setReferenceDate(now);
        Date instStart = evaluator.evaluate(startInstance, Date.class);
        long feedDuration = evaluator.evaluate(feedRetention, Long.class);
        Date feedStart = new Date(now.getTime() - feedDuration);

        if (instStart.before(feedStart)) {
            throw new ValidationException("StartInstance :" + startInstance + " of process is out of range for Feed: "
                    + feed.getName() + "  in cluster: " + clusterName + "'s retention limit :" + feedRetention);
View Full Code Here

                String instEL = output.getInstance();
                ExpressionHelper evaluator = ExpressionHelper.get();
                Validity processValidity = ProcessHelper.getCluster(process, clusterName).getValidity();
                ExpressionHelper.setReferenceDate(processValidity.getStart());
                Date inst = evaluator.evaluate(instEL, Date.class);
                if (inst.before(feedStart)) {
                    throw new ValidationException("Instance  " + instEL + " of feed " + feed.getName()
                            + " is before the start of feed " + feedValidity.getStart() + " for cluster" + clusterName);
                }
View Full Code Here

    @Override
    public long getDelay(Frequency delay, Date nominalTime, Date cutOffTime) throws FalconException {
        ExpressionHelper evaluator = ExpressionHelper.get();
        Date now = new Date();
        Date lateTime = nominalTime;
        long delayMilliSeconds = evaluator.evaluate(delay.toString(), Long.class);
        int factor = 1;
        // TODO we can get rid of this using formula
        while (lateTime.compareTo(now) <= 0) {
            lateTime = addTime(lateTime, (int) (factor * delayMilliSeconds));
            factor *= getPower();
View Full Code Here

                return feedCutOff;
            }
            String lateCutOff = ((Feed) entity).getLateArrival().getCutOff()
                    .toString();
            endTime = EntityUtil.parseDateUTC(nominalTime);
            long feedCutOffPeriod = evaluator.evaluate(lateCutOff, Long.class);
            endTime = addTime(endTime, feedCutOffPeriod);
            return endTime;
        } else if (entity.getEntityType() == EntityType.PROCESS) {
            Process process = (Process) entity;
            ConfigurationStore store = ConfigurationStore.get();
View Full Code Here

                            + " late arrival cut-off is not configured, ignoring this feed");
                    continue;
                }
                String lateCutOff = feed.getLateArrival().getCutOff()
                        .toString();
                endTime = evaluator.evaluate(endInstanceTime, Date.class);
                long feedCutOffPeriod = evaluator.evaluate(lateCutOff,
                        Long.class);
                endTime = addTime(endTime, feedCutOffPeriod);

                if (endTime.after(feedCutOff)) {
View Full Code Here

*/
public abstract class AbstractRerunPolicy {

    public long getDurationInMilliSec(Frequency frequency) throws FalconException {
        ExpressionHelper helper = ExpressionHelper.get();
        return helper.evaluate(frequency.toString(), Long.class);
    }

    public static Date addTime(Date date, int milliSecondsToAdd) {
        return new Date(date.getTime() + milliSecondsToAdd);
    }
View Full Code Here

                    continue;
                }
                String lateCutOff = feed.getLateArrival().getCutOff()
                        .toString();
                endTime = evaluator.evaluate(endInstanceTime, Date.class);
                long feedCutOffPeriod = evaluator.evaluate(lateCutOff,
                        Long.class);
                endTime = addTime(endTime, feedCutOffPeriod);

                if (endTime.after(feedCutOff)) {
                    feedCutOff = endTime;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.