本文整理匯總了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());
}