org.kitesdk.data.Dataset.toBefore()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(205)

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

Dataset.toBefore介绍

暂无

代码示例

代码示例来源:origin: kite-sdk/kite-examples

  1. eventsToProcess = eventsDataset.toBefore("timestamp", currentMinute);

代码示例来源:origin: kite-sdk/kite

  1. testDataset.to("timestamp", octInstant));
  2. assertContentEquals(Sets.newHashSet(sepEvent, octEvent),
  3. testDataset.toBefore("timestamp", novStart));

代码示例来源:origin: kite-sdk/kite-examples

  1. @Override
  2. public int run(String[] args) throws Exception {
  3. final long startOfToday = startOfDay();
  4. // the destination dataset
  5. Dataset<Record> persistent = Datasets.load(
  6. "dataset:file:/tmp/data/logs", Record.class);
  7. // the source: anything before today in the staging area
  8. Dataset<Record> staging = Datasets.load(
  9. "dataset:file:/tmp/data/logs_staging", Record.class);
  10. View<Record> ready = staging.toBefore("timestamp", startOfToday);
  11. ReadableSource<Record> source = CrunchDatasets.asSource(ready);
  12. PCollection<Record> stagedLogs = read(source);
  13. getPipeline().write(stagedLogs,
  14. CrunchDatasets.asTarget(persistent), Target.WriteMode.APPEND);
  15. PipelineResult result = run();
  16. if (result.succeeded()) {
  17. // remove the source data partition from staging
  18. ready.deleteAll();
  19. return 0;
  20. } else {
  21. return 1;
  22. }
  23. }

代码示例来源:origin: kite-sdk/kite

  1. @Test
  2. public void testSimpleViews() {
  3. assertViewUriEquivalent("dataset",
  4. "dataset:file:/tmp/test_name", test);
  5. assertViewUriEquivalent("to constraint",
  6. "view:file:/tmp/test_name?timestamp=(,0]",
  7. test.to("timestamp", 0L));
  8. assertViewUriEquivalent("View with toBefore constraint",
  9. "view:file:/tmp/test_name?timestamp=(,0)",
  10. test.toBefore("timestamp", 0L));
  11. assertViewUriEquivalent("View with from constraint",
  12. "view:file:/tmp/test_name?timestamp=[0,)",
  13. test.from("timestamp", 0L));
  14. assertViewUriEquivalent("View with fromAfter constraint",
  15. "view:file:/tmp/test_name?timestamp=(0,)",
  16. test.fromAfter("timestamp", 0L));
  17. assertViewUriEquivalent("View with in(\"\") constraint",
  18. "view:file:/tmp/test_name?color=in()",
  19. test.with("color", ""));
  20. assertViewUriEquivalent("View with in constraint",
  21. "view:file:/tmp/test_name?color=orange,red",
  22. test.with("color", "orange", "red"));
  23. assertViewUriEquivalent("View with exists constraint",
  24. "view:file:/tmp/test_name?id=",
  25. test.with("id"));
  26. }

代码示例来源:origin: kite-sdk/kite

  1. notPartitioned.to("timestamp", now));
  2. Assert.assertNotNull("toBefore should succeed",
  3. notPartitioned.toBefore("timestamp", now));
  4. Assert.assertNotNull("with should succeed",
  5. notPartitioned.with("timestamp", now));

相关文章