當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。