本文整理汇总了Java中org.apache.oozie.client.CoordinatorJob.Timeunit类的典型用法代码示例。如果您正苦于以下问题:Java Timeunit类的具体用法?Java Timeunit怎么用?Java Timeunit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Timeunit类属于org.apache.oozie.client.CoordinatorJob包,在下文中一共展示了Timeunit类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOptionalInputProperties
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private void addOptionalInputProperties(Properties properties, Input in, String clusterName) throws IvoryException {
Feed feed = EntityUtil.getEntity(EntityType.FEED, in.getFeed());
org.apache.ivory.entity.v0.feed.Cluster cluster = FeedHelper.getCluster(feed, clusterName);
String inName = in.getName();
properties.put(inName + ".frequency", String.valueOf(feed.getFrequency().getFrequency()));
properties.put(inName + ".freq_timeunit", mapToCoordTimeUnit(feed.getFrequency().getTimeUnit()).name());
properties.put(inName + ".timezone", feed.getTimezone().getID());
properties.put(inName + ".end_of_duration", Timeunit.NONE.name());
properties.put(inName + ".initial-instance", SchemaHelper.formatDateUTC(cluster.getValidity().getStart()));
properties.put(inName + ".done-flag", "notused");
String locPath = FeedHelper.getLocation(feed, LocationType.DATA, clusterName).getPath().replace('$', '%');
properties.put(inName + ".uri-template", new Path(locPath).toUri().getScheme()!=null?locPath:"${nameNode}"+locPath);
properties.put(inName + ".start-instance", in.getStart());
properties.put(inName + ".end-instance", in.getEnd());
}
示例2: mapToCoordTimeUnit
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private Timeunit mapToCoordTimeUnit(TimeUnit tu) {
switch(tu) {
case days:
return Timeunit.DAY;
case hours:
return Timeunit.HOUR;
case minutes:
return Timeunit.MINUTE;
case months:
return Timeunit.MONTH;
}
throw new IllegalArgumentException("Unhandled time unit " + tu);
}
示例3: addOptionalInputProperties
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private void addOptionalInputProperties(Properties properties, Input in, String clusterName)
throws FalconException {
Feed feed = EntityUtil.getEntity(EntityType.FEED, in.getFeed());
org.apache.falcon.entity.v0.feed.Cluster cluster = FeedHelper.getCluster(feed, clusterName);
String inName = in.getName();
properties.put(inName + ".frequency", String.valueOf(feed.getFrequency().getFrequency()));
properties.put(inName + ".freq_timeunit", mapToCoordTimeUnit(feed.getFrequency().getTimeUnit()).name());
properties.put(inName + ".timezone", feed.getTimezone().getID());
properties.put(inName + ".end_of_duration", Timeunit.NONE.name());
properties.put(inName + ".initial-instance", SchemaHelper.formatDateUTC(cluster.getValidity().getStart()));
properties.put(inName + ".done-flag", "notused");
String locPath = FeedHelper.getLocation(feed, LocationType.DATA, clusterName).getPath().replace('$', '%');
properties.put(inName + ".uri-template",
new Path(locPath).toUri().getScheme() != null ? locPath : "${nameNode}" + locPath);
properties.put(inName + ".start-instance", in.getStart());
properties.put(inName + ".end-instance", in.getEnd());
}
示例4: mapToCoordTimeUnit
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private Timeunit mapToCoordTimeUnit(TimeUnit tu) {
switch (tu) {
case days:
return Timeunit.DAY;
case hours:
return Timeunit.HOUR;
case minutes:
return Timeunit.MINUTE;
case months:
return Timeunit.MONTH;
}
throw new IllegalArgumentException("Unhandled time unit " + tu);
}
示例5: createFrequency
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private Frequency createFrequency(int frequency, Timeunit timeUnit) {
return new Frequency(frequency, OozieTimeUnit.valueOf(timeUnit.name())
.getIvoryTimeUnit());
}
示例6: createFrequency
import org.apache.oozie.client.CoordinatorJob.Timeunit; //导入依赖的package包/类
private Frequency createFrequency(int frequency, Timeunit timeUnit) {
return new Frequency(frequency, OozieTimeUnit.valueOf(timeUnit.name())
.getFalconTimeUnit());
}