我正在使用 HttpClient 源将文件从 HTTP url 流式传输到 Hadoop 目标,但目标中的文件名附加了一些随机 uuid。我希望文件名与源文件相同。
示例:源文件名为 README.txt ,目标文件名为 README_112e5d4b-4d85-4764-ab81-1d7b6e0237b2.txt
我希望目标文件名是 README.txt
我会告诉你我的配置。
HTTP Client :
General
Name : HTTP Client 1
Description :
On Record Error : Send to Error
HTTP
Resource URL : http://files.data.gouv.fr/sirene/README.txt
Headers :
Mode : Streaming
Per-Status Actions
HTTP Statis Code : 500 | Action for status : Retry with exponential backoff |
Base Backoff Interval (ms) : 1000 | Max Retries : 10
HTTP Method : GET
Body Time Zone : UTC (UTC)
Request Transfert Encoding : BUFFERED
HTTP Compression : None
Connect Timeout : 0
Read Timeout : 0
Authentication Type : None
Use OAuth 2
Use Proxy
Max Batch Size (records) : 1000
Batch Wait Time (ms) : 2000
Pagination
Pagination Mode : None
TLS
UseTLS
Timeout Handling
Action for timeout : Retry immediately
Max Retries : 10
Data Format
Date Format : Text
Compression Format : None
Max Line Length : 1024
Use Custom Delimiter
Charset : UTF-8
Ignore Control Characters
Logging
Enable Request Logging
Hadoop FS Destination :
General
Name : Hadoop FS 1
Description : Writing into HDFS
Stage Library : CDH 5.10.1
Produce Events
Required Fields
Preconditions
On Record Error : Send to Error
Output Files
File Type : Text Files
Files Prefix : README
File Suffix : txt
Directory in Header
Directory Template : /user/username/
Data Time Zone : UTC (UTC)
Time Basis : ${time:now()}
Max Records in File : 0
Max File Size (MB) : 0
Idle Timeout : ${1 * HOURS}
Compression Codec : None
Use Roll Attribute
Validate HDFS Permissions : ON
Skip file recovery
Late Records
Late Record Time Limit (secs) : ${1 * HOURS}
Late Record Handling : Send to error
Data Format
Data Format : Text
Text Field Path : /text
Record Separator : \n
On Missing Field : Report Error
Charset : UTF-8