本文整理汇总了Java中org.embulk.spi.Exec.newTaskReport方法的典型用法代码示例。如果您正苦于以下问题:Java Exec.newTaskReport方法的具体用法?Java Exec.newTaskReport怎么用?Java Exec.newTaskReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.embulk.spi.Exec
的用法示例。
在下文中一共展示了Exec.newTaskReport方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport run(TaskSource taskSource,
Schema schema, int taskIndex,
PageOutput output)
{
PluginTask task = taskSource.loadTask(PluginTask.class);
Integer rows = task.getRows();
final HashMap<Column, Map<String, Integer>> columnOptions = getColumnOptions(task);
try (PageBuilder pagebuilder =
new PageBuilder(Exec.getBufferAllocator(), schema, output)) {
IntStream.rangeClosed(
taskIndex * rows + 1,
taskIndex * rows + rows
).boxed().forEach(rowNumber -> {
RandomjColumnVisitor visitor = new RandomjColumnVisitor(pagebuilder, task, rowNumber, columnOptions);
schema.visitColumns(visitor);
pagebuilder.addRecord();
});
pagebuilder.finish();
}
TaskReport taskReport = Exec.newTaskReport();
taskReport.set("columns", schema.size());
taskReport.set("rows", rows);
return taskReport;
}
示例2: ingestServiceData
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport ingestServiceData(T task, RecordImporter recordImporter, int taskIndex, PageBuilder pageBuilder)
{
MarketoService marketoService = new MarketoServiceImpl(createMarketoRestClient(task));
Iterator<ServiceRecord> serviceRecords = getServiceRecords(marketoService, task);
int imported = 0;
while (serviceRecords.hasNext() && (imported < PREVIEW_RECORD_LIMIT || !Exec.isPreview())) {
ServiceRecord next = serviceRecords.next();
recordImporter.importRecord(next, pageBuilder);
imported++;
}
return Exec.newTaskReport();
}
示例3: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit()
{
TaskReport report = Exec.newTaskReport();
report.set("file_list", fileList);
return report;
}
示例4: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit()
{
TaskReport report = Exec.newTaskReport();
report.set("files", storageObjects);
return report;
}
示例5: open
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TransactionalFileInput open(TaskSource taskSource, int taskIndex) {
return new TransactionalFileInput() {
private boolean eof = false;
private int index = 0;
@Override
public Buffer poll() {
if (index < list.size()) {
String s = list.get(index++) + "\n";
return Buffer.copyOf(s.getBytes(StandardCharsets.UTF_8));
}
eof = true;
return null;
}
@Override
public boolean nextFile() {
return !eof;
}
@Override
public void close() {
}
@Override
public void abort() {
}
@Override
public TaskReport commit() {
return Exec.newTaskReport();
}
};
}
示例6: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit() {
TaskReport report = Exec.newTaskReport();
return report;
}
示例7: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit()
{
return Exec.newTaskReport();
}
示例8: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
public TaskReport commit()
{
return Exec.newTaskReport();
}
示例9: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit()
{
return Exec.newTaskReport();
//TODO
}
示例10: commit
import org.embulk.spi.Exec; //导入方法依赖的package包/类
@Override
public TaskReport commit()
{
TaskReport report = Exec.newTaskReport();
return report;
}