本文整理汇总了Java中org.apache.falcon.entity.v0.cluster.Cluster.setColo方法的典型用法代码示例。如果您正苦于以下问题:Java Cluster.setColo方法的具体用法?Java Cluster.setColo怎么用?Java Cluster.setColo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.falcon.entity.v0.cluster.Cluster
的用法示例。
在下文中一共展示了Cluster.setColo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEvaluateExpression
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
@Test
public void testEvaluateExpression() throws Exception {
Cluster cluster = new Cluster();
cluster.setName("name");
cluster.setColo("colo");
cluster.setProperties(new Properties());
Property prop = new Property();
prop.setName("pname");
prop.setValue("pvalue");
cluster.getProperties().getProperties().add(prop);
Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.colo}/*/US"), "colo/*/US");
Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "${cluster.name}/*/${cluster.pname}"),
"name/*/pvalue");
Assert.assertEquals(FeedHelper.evaluateClusterExp(cluster, "IN"), "IN");
}
示例2: testOnRemove
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
@Test
public void testOnRemove() throws Exception {
Process process = new Process();
process.setName("rp1");
Cluster cluster = new Cluster();
cluster.setName("rc1");
cluster.setColo("2");
org.apache.falcon.entity.v0.process.Cluster processCluster = new org.apache.falcon.entity.v0.process.Cluster();
processCluster.setName("rc1");
process.setClusters(new org.apache.falcon.entity.v0.process.Clusters());
process.getClusters().getClusters().add(processCluster);
store.publish(EntityType.CLUSTER, cluster);
store.publish(EntityType.PROCESS, process);
Set<Entity> entities = graph.getDependents(process);
Assert.assertEquals(entities.size(), 1);
Assert.assertTrue(entities.contains(cluster));
entities = graph.getDependents(cluster);
Assert.assertEquals(entities.size(), 1);
Assert.assertTrue(entities.contains(process));
store.remove(EntityType.PROCESS, process.getName());
entities = graph.getDependents(cluster);
Assert.assertTrue(entities == null);
entities = graph.getDependents(process);
Assert.assertTrue(entities == null);
}
示例3: newCluster
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
private Cluster newCluster(String name, String colo) {
Cluster cluster = new Cluster();
cluster.setName(name);
cluster.setColo(colo);
return cluster;
}
示例4: testOnAdd
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
@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.falcon.entity.v0.process.Cluster processCluster = new org.apache.falcon.entity.v0.process.Cluster();
processCluster.setName("c1");
process.setClusters(new org.apache.falcon.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);
store.publish(EntityType.FEED, f4);
store.publish(EntityType.PROCESS, process);
Set<Entity> entities = graph.getDependents(process);
Assert.assertEquals(entities.size(), 5);
Assert.assertTrue(entities.contains(cluster));
Assert.assertTrue(entities.contains(f1));
Assert.assertTrue(entities.contains(f2));
Assert.assertTrue(entities.contains(f3));
Assert.assertTrue(entities.contains(f4));
entities = graph.getDependents(f1);
Assert.assertEquals(entities.size(), 2);
Assert.assertTrue(entities.contains(process));
Assert.assertTrue(entities.contains(cluster));
entities = graph.getDependents(f2);
Assert.assertEquals(entities.size(), 2);
Assert.assertTrue(entities.contains(process));
Assert.assertTrue(entities.contains(cluster));
entities = graph.getDependents(f3);
Assert.assertEquals(entities.size(), 2);
Assert.assertTrue(entities.contains(process));
Assert.assertTrue(entities.contains(cluster));
entities = graph.getDependents(f4);
Assert.assertEquals(entities.size(), 2);
Assert.assertTrue(entities.contains(process));
Assert.assertTrue(entities.contains(cluster));
entities = graph.getDependents(cluster);
Assert.assertEquals(entities.size(), 5);
Assert.assertTrue(entities.contains(process));
Assert.assertTrue(entities.contains(f1));
Assert.assertTrue(entities.contains(f2));
Assert.assertTrue(entities.contains(f3));
Assert.assertTrue(entities.contains(f4));
}