Package org.apache.ivory.entity.v0.process

Examples of org.apache.ivory.entity.v0.process.Process


                clusters.add(cluster.getName());
            }
            break;

        case PROCESS:
            Process process = (Process) entity;
            for (org.apache.falcon.entity.v0.process.Cluster cluster : process.getClusters().getClusters()) {
                clusters.add(cluster.getName());
            }
            break;
        default:
        }
View Full Code Here


                    "feed.retry.frequency", "minutes(5)")));
            retry.setPolicy(PolicyType.fromValue(RuntimeProperties.get()
                    .getProperty("feed.retry.policy", "exp-backoff")));
            return retry;
        case PROCESS:
            Process process = (Process) entity;
            return process.getRetry();
        default:
            throw new FalconException("Cannot create Retry for entity:" + entity.getName());
        }
    }
View Full Code Here

            //TODO - Assuming the late workflow is not used
            lateInput.setWorkflowPath("ignore.xml");
            lateProcess.getLateInputs().add(lateInput);
            return lateProcess;
        case PROCESS:
            Process process = (Process) entity;
            return process.getLateProcess();
        default:
            throw new FalconException("Cannot create Late Process for entity:" + entity.getName());
        }
    }
View Full Code Here

            feed.setName(name);
            store.publish(type, feed);
            break;

        case PROCESS:
            Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
            process.setName(name);
            store.publish(type, process);
            break;

        default:
            throw new IllegalArgumentException("Invalid entity type: " + type);
View Full Code Here

        storeEntity(EntityType.CLUSTER, "testCluster");
        storeEntity(EntityType.PROCESS, "sample");
        storeEntity(EntityType.FEED, "raw-logs");
        storeEntity(EntityType.FEED, "clicks");
        Unmarshaller unmarshaller = EntityType.PROCESS.getUnmarshaller();
        Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML2));
        process.setName("sample2");
        store.publish(EntityType.PROCESS, process);
    }
View Full Code Here

        if (entity.getEntityType().equals(EntityType.CLUSTER)) {
            return tagList;
        }

        Process process = null;
        String entityNameToMatch = null;
        if (dependentEntity.getEntityType().equals(EntityType.PROCESS)) {
            process = (Process) dependentEntity;
            entityNameToMatch = entity.getName();
        } else if (dependentEntity.getEntityType().equals(EntityType.FEED)
                && entity.getEntityType().equals(EntityType.PROCESS)) {
            process = (Process) entity;
            entityNameToMatch = dependentEntity.getName();
        }

        if (process != null) {
            for (Input i : process.getInputs().getInputs()) {
                if (i.getFeed().equals(entityNameToMatch)) {
                    tagList.add("Input");
                }
            }
            for (Output o : process.getOutputs().getOutputs()) {
                if (o.getFeed().equals(entityNameToMatch)) {
                    tagList.add("Output");
                }
            }
        }
View Full Code Here

            store(EntityType.valueOf(type.toUpperCase()), xml);
        }

        entity = args[2];
        Entity obj = EntityUtil.getEntity(type, entity);
        Process newEntity = (Process)obj.clone();
        newEntity.setFrequency(Frequency.fromString("minutes(5)"));
        System.out.println("##############OLD ENTITY " + EntityUtil.md5(obj));
        System.out.println("##############NEW ENTITY " + EntityUtil.md5(newEntity));


//        OozieWorkflowEngine engine = new OozieWorkflowEngine();
//        Date start = formatter.parse("2010-01-02 01:05 UTC");
//        Date end = formatter.parse("2010-01-02 01:21 UTC");
//        InstancesResult status = engine.suspendInstances(obj, start, end, new Properties());
//        System.out.println(Arrays.toString(status.getInstances()));
//        AbstractInstanceManager manager = new InstanceManager();
//        InstancesResult result = manager.suspendInstance(new NullServletRequest(), type, entity,
//                "2010-01-02T01:05Z", "2010-01-02T01:21Z", "*");

        DeploymentProperties.get().setProperty("deploy.mode", "standalone");
        StartupProperties.get().setProperty("current.colo", "ua1");
        OozieWorkflowEngine engine = new OozieWorkflowEngine();
        ConfigurationStore.get().initiateUpdate(newEntity);
        engine.update(obj, newEntity, newEntity.getClusters().getClusters().get(0).getName());
        engine.delete(newEntity);
        System.exit(0);
    }
View Full Code Here

                feed.setName(name);
                store.publish(type, feed);
                break;

            case PROCESS:
                Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
                process.setName(name);
                FileSystem fs =dfsCluster.getFileSystem();
                fs.mkdirs(new Path(process.getWorkflow().getPath()));
                if (!fs.exists(new Path(process.getWorkflow()+"/lib"))) {
                  fs.mkdirs(new Path(process.getWorkflow()+"/lib"));
                }
                store.publish(type, process);
                break;
        }
    }
View Full Code Here

    private EntityGraph graph = EntityGraph.get();

    @Test
    public void testOnAdd() throws Exception {

        Process process = new Process();
        process.setName("p1");
        Cluster cluster = new Cluster();
        cluster.setName("c1");
        cluster.setColo("1");
        Feed f1 = addInput(process, "f1", cluster);
        Feed f2 = addInput(process, "f2", cluster);
        Feed f3 = addOutput(process, "f3", cluster);
        Feed f4 = addOutput(process, "f4", cluster);
        org.apache.ivory.entity.v0.process.Cluster processCluster = new org.apache.ivory.entity.v0.process.Cluster();
        processCluster.setName("c1");
        process.setClusters(new org.apache.ivory.entity.v0.process.Clusters());
        process.getClusters().getClusters().add(processCluster);

        store.publish(EntityType.CLUSTER, cluster);
        store.publish(EntityType.FEED, f1);
        store.publish(EntityType.FEED, f2);
        store.publish(EntityType.FEED, f3);
View Full Code Here

        storeEntity(EntityType.FEED, "imp-click-join1");
        storeEntity(EntityType.FEED, "imp-click-join2");
        Feed feed = parser.parseAndValidate(this.getClass()
                .getResourceAsStream(FEED_XML));
        ConfigurationStore.get().publish(EntityType.FEED, feed);
        Process process = processParser.parseAndValidate(this.getClass()
                .getResourceAsStream(PROCESS1_XML));
        ConfigurationStore.get().publish(EntityType.PROCESS, process);
        Process p1 = (Process) process.clone();
        p1.setName("sample2");
        ConfigurationStore.get().publish(EntityType.PROCESS, p1);

        try {
            //Try parsing the same feed xml
            parser.parseAndValidate(this.getClass()
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.process.Process

Copyright © 2018 www.massapicom. 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.