Loading Data

Documentation

Looking for the latest stable documentation?

API documentation

Loading Data

Choosing an ingestion method

Druid supports streaming (real-time) and file-based (batch) ingestion methods. The most popular configurations are:

  • Files - Load data from HDFS, S3, local files, or any supported Hadoop filesystem in batches. We recommend this method if your dataset is already in flat files.

  • Stream push - Push a data stream into Druid in real-time using Tranquility, a client library for sending streams to Druid. We recommend this method if your dataset originates in a streaming system like Kafka, Storm, Spark Streaming, or your own system.

  • Stream pull - Pull a data stream directly from an external data source into Druid using Realtime Nodes.

Getting started

The easiest ways to get started with loading your own data are the three included tutorials.

Hybrid batch/streaming

You can combine batch and streaming methods in a hybrid batch/streaming architecture. In a hybrid architecture, you use a streaming method to do initial ingestion, and then periodically re-ingest older data in batch mode (typically every few hours, or nightly). When Druid re-ingests data for a time range, the new data automatically replaces the data from the earlier ingestion.

All streaming ingestion methods currently supported by Druid do introduce the possibility of dropped or duplicated messages in certain failure scenarios, and batch re-ingestion eliminates this potential source of error for historical data.

Batch re-ingestion also gives you the option to re-ingest your data if you needed to revise it for any reason.

该错误 `FileNotFoundError: val: Error loading data from F:\Deep\datasets\images\val` 表明程序在尝试从指定路径 `F:\Deep\datasets\images\val` 加载数据时,未能找到相应文件或目录。可以参考以下方法解决: ### 检查路径是否正确 仔细确认路径 `F:\Deep\datasets\images\val` 是否准确无误,尤其要注意大小写、反斜杠的使用。在 Windows 系统中,路径分隔符通常使用反斜杠 `\`,但在 Python 字符串里,反斜杠是转义字符,所以需要使用双反斜杠 `\\` 或者原始字符串(在字符串前加 `r`)。 示例代码: ```python import os # 使用原始字符串 data_path = r'F:\Deep\datasets\images\val' if os.path.exists(data_path): print("路径存在") else: print("路径不存在,请检查") ``` ### 检查文件和目录是否存在 要保证 `F:\Deep\datasets\images\val` 目录确实存在,并且该目录下包含所需的数据文件。可以手动查看该目录,或者使用 Python 代码进行检查。 示例代码: ```python import os data_path = r'F:\Deep\datasets\images\val' if os.path.exists(data_path): files = os.listdir(data_path) if len(files) == 0: print("目录为空,请确保包含所需数据文件") else: print("目录包含以下文件:", files) else: print("路径不存在,请检查") ``` ### 权限问题 确认运行程序的用户账户具备访问 `F:\Deep\datasets\images\val` 目录及其文件的权限。若该目录位于受保护的系统目录或者其他需要特殊权限的位置,可能会因为权限不足而无法访问。 ### 路径配置错误 若代码中存在路径配置文件,要检查该文件里的路径是否正确。有时候,路径可能在配置文件中被错误地设置,从而导致程序尝试从错误的路径加载数据。 ### 数据文件损坏或缺失 若路径和权限都没有问题,可能是数据文件本身损坏或者缺失。可以尝试重新下载或者复制数据文件到该目录。 ### 参考深度学习中路径确认方法 参考在深度学习中确定路径的方法,要确定 Python 所在的位置、数据集测试和训练集代码所在位置以及图片存储位置。确保所有路径都正确配置,脚本的后缀等也符合要求 [^3]。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值