本文整理了Java中org.kitesdk.data.Dataset.toBefore()
方法的一些代码示例,展示了Dataset.toBefore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dataset.toBefore()
方法的具体详情如下:
包路径:org.kitesdk.data.Dataset
类名称:Dataset
方法名:toBefore
暂无
代码示例来源:origin: kite-sdk/kite-examples
eventsToProcess = eventsDataset.toBefore("timestamp", currentMinute);
代码示例来源:origin: kite-sdk/kite
testDataset.to("timestamp", octInstant));
assertContentEquals(Sets.newHashSet(sepEvent, octEvent),
testDataset.toBefore("timestamp", novStart));
代码示例来源:origin: kite-sdk/kite-examples
@Override
public int run(String[] args) throws Exception {
final long startOfToday = startOfDay();
// the destination dataset
Dataset<Record> persistent = Datasets.load(
"dataset:file:/tmp/data/logs", Record.class);
// the source: anything before today in the staging area
Dataset<Record> staging = Datasets.load(
"dataset:file:/tmp/data/logs_staging", Record.class);
View<Record> ready = staging.toBefore("timestamp", startOfToday);
ReadableSource<Record> source = CrunchDatasets.asSource(ready);
PCollection<Record> stagedLogs = read(source);
getPipeline().write(stagedLogs,
CrunchDatasets.asTarget(persistent), Target.WriteMode.APPEND);
PipelineResult result = run();
if (result.succeeded()) {
// remove the source data partition from staging
ready.deleteAll();
return 0;
} else {
return 1;
}
}
代码示例来源:origin: kite-sdk/kite
@Test
public void testSimpleViews() {
assertViewUriEquivalent("dataset",
"dataset:file:/tmp/test_name", test);
assertViewUriEquivalent("to constraint",
"view:file:/tmp/test_name?timestamp=(,0]",
test.to("timestamp", 0L));
assertViewUriEquivalent("View with toBefore constraint",
"view:file:/tmp/test_name?timestamp=(,0)",
test.toBefore("timestamp", 0L));
assertViewUriEquivalent("View with from constraint",
"view:file:/tmp/test_name?timestamp=[0,)",
test.from("timestamp", 0L));
assertViewUriEquivalent("View with fromAfter constraint",
"view:file:/tmp/test_name?timestamp=(0,)",
test.fromAfter("timestamp", 0L));
assertViewUriEquivalent("View with in(\"\") constraint",
"view:file:/tmp/test_name?color=in()",
test.with("color", ""));
assertViewUriEquivalent("View with in constraint",
"view:file:/tmp/test_name?color=orange,red",
test.with("color", "orange", "red"));
assertViewUriEquivalent("View with exists constraint",
"view:file:/tmp/test_name?id=",
test.with("id"));
}
代码示例来源:origin: kite-sdk/kite
notPartitioned.to("timestamp", now));
Assert.assertNotNull("toBefore should succeed",
notPartitioned.toBefore("timestamp", now));
Assert.assertNotNull("with should succeed",
notPartitioned.with("timestamp", now));
内容来源于网络,如有侵权,请联系作者删除!