本文整理汇总了Java中org.apache.falcon.entity.v0.cluster.Cluster.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Cluster.setName方法的具体用法?Java Cluster.setName怎么用?Java Cluster.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.falcon.entity.v0.cluster.Cluster
的用法示例。
在下文中一共展示了Cluster.setName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeEntity
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
protected void storeEntity(EntityType type, String name) throws Exception {
Unmarshaller unmarshaller = type.getUnmarshaller();
ConfigurationStore store = ConfigurationStore.get();
store.remove(type, name);
switch (type) {
case CLUSTER:
Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
cluster.setName(name);
ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
store.publish(type, cluster);
break;
case FEED:
Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
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;
}
}
示例2: storeEntity
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
private void storeEntity(EntityType type, String name) throws Exception {
Unmarshaller unmarshaller = type.getUnmarshaller();
ConfigurationStore store = ConfigurationStore.get();
store.remove(type, name);
switch (type) {
case CLUSTER:
Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
cluster.setName(name);
store.publish(type, cluster);
break;
case FEED:
Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
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:
}
}
示例3: 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");
}
示例4: storeEntity
import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
protected void storeEntity(EntityType type, String name) throws Exception {
Unmarshaller unmarshaller = type.getUnmarshaller();
ConfigurationStore store = ConfigurationStore.get();
store.remove(type, name);
switch (type) {
case CLUSTER:
Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
cluster.setName(name);
ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
store.publish(type, cluster);
break;
case FEED:
Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
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;
default:
}
}
示例5: 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);
}
示例6: 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;
}
示例7: 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));
}