当前位置: 首页>>代码示例>>Java>>正文


Java Timeunit类代码示例

本文整理汇总了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());
  }
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:18,代码来源:OozieProcessWorkflowBuilder.java

示例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);
}
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:17,代码来源:OozieProcessWorkflowBuilder.java

示例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());
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:20,代码来源:OozieProcessWorkflowBuilder.java

示例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);
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:17,代码来源:OozieProcessWorkflowBuilder.java

示例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());
}
 
开发者ID:sriksun,项目名称:ivry-security,代码行数:5,代码来源:OozieWorkflowEngine.java

示例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());
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:5,代码来源:OozieWorkflowEngine.java


注:本文中的org.apache.oozie.client.CoordinatorJob.Timeunit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。