org.apache.gobblin.source.workunit.Extract.setFullTrue()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.gobblin.source.workunit.Extract.setFullTrue()方法的一些代码示例,展示了Extract.setFullTrue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Extract.setFullTrue()方法的具体详情如下:
包路径:org.apache.gobblin.source.workunit.Extract
类名称:Extract
方法名:setFullTrue

Extract.setFullTrue介绍

[英]Set full drop date from the given time.
[中]设置从给定时间开始的完全放置日期。

代码示例

代码示例来源:origin: apache/incubator-gobblin

protected List<WorkUnit> generateWorkUnits(SourceEntity sourceEntity, SourceState state, long previousWatermark) {
 List<WorkUnit> workUnits = Lists.newArrayList();
 String nameSpaceName = state.getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY);
 TableType tableType =
   TableType.valueOf(state.getProp(ConfigurationKeys.EXTRACT_TABLE_TYPE_KEY).toUpperCase());
 List<Partition> partitions = new Partitioner(state).getPartitionList(previousWatermark);
 Collections.sort(partitions, Partitioner.ascendingComparator);
 // {@link ConfigurationKeys.EXTRACT_TABLE_NAME_KEY} specify the output path for Extract
 String outputTableName = sourceEntity.getDestTableName();
 log.info("Create extract output with table name is " + outputTableName);
 Extract extract = createExtract(tableType, nameSpaceName, outputTableName);
 // Setting current time for the full extract
 if (Boolean.valueOf(state.getProp(ConfigurationKeys.EXTRACT_IS_FULL_KEY))) {
  extract.setFullTrue(System.currentTimeMillis());
 }
 for (Partition partition : partitions) {
  WorkUnit workunit = WorkUnit.create(extract);
  workunit.setProp(ConfigurationKeys.SOURCE_ENTITY, sourceEntity.getSourceEntityName());
  workunit.setProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY, sourceEntity.getDestTableName());
  workunit.setProp(WORK_UNIT_STATE_VERSION_KEY, CURRENT_WORK_UNIT_STATE_VERSION);
  addLineageSourceInfo(state, sourceEntity, workunit);
  partition.serialize(workunit);
  workUnits.add(workunit);
 }
 return workUnits;
}

代码示例来源:origin: org.apache.gobblin/gobblin-core

protected List<WorkUnit> generateWorkUnits(SourceEntity sourceEntity, SourceState state, long previousWatermark) {
 List<WorkUnit> workUnits = Lists.newArrayList();
 String nameSpaceName = state.getProp(ConfigurationKeys.EXTRACT_NAMESPACE_NAME_KEY);
 TableType tableType =
   TableType.valueOf(state.getProp(ConfigurationKeys.EXTRACT_TABLE_TYPE_KEY).toUpperCase());
 List<Partition> partitions = new Partitioner(state).getPartitionList(previousWatermark);
 Collections.sort(partitions, Partitioner.ascendingComparator);
 // {@link ConfigurationKeys.EXTRACT_TABLE_NAME_KEY} specify the output path for Extract
 String outputTableName = sourceEntity.getDestTableName();
 log.info("Create extract output with table name is " + outputTableName);
 Extract extract = createExtract(tableType, nameSpaceName, outputTableName);
 // Setting current time for the full extract
 if (Boolean.valueOf(state.getProp(ConfigurationKeys.EXTRACT_IS_FULL_KEY))) {
  extract.setFullTrue(System.currentTimeMillis());
 }
 for (Partition partition : partitions) {
  WorkUnit workunit = WorkUnit.create(extract);
  workunit.setProp(ConfigurationKeys.SOURCE_ENTITY, sourceEntity.getSourceEntityName());
  workunit.setProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY, sourceEntity.getDestTableName());
  workunit.setProp(WORK_UNIT_STATE_VERSION_KEY, CURRENT_WORK_UNIT_STATE_VERSION);
  addLineageSourceInfo(state, sourceEntity, workunit);
  partition.serialize(workunit);
  workUnits.add(workunit);
 }
 return workUnits;
}

相关文章