Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 120 additions & 2 deletions docs/1-using/5-connectors/7-list/2-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ import Tooltip from '@mui/material/Tooltip';

## Latest release

- [conduit-connector-file_0.12.0_Darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Darwin_arm64.tar.gz)
- [conduit-connector-file_0.12.0_Darwin_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Darwin_x86_64.tar.gz)
- [conduit-connector-file_0.12.0_Linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Linux_arm64.tar.gz)
- [conduit-connector-file_0.12.0_Linux_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Linux_i386.tar.gz)
- [conduit-connector-file_0.12.0_Linux_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Linux_x86_64.tar.gz)
- [conduit-connector-file_0.12.0_Windows_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Windows_arm64.tar.gz)
- [conduit-connector-file_0.12.0_Windows_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Windows_i386.tar.gz)
- [conduit-connector-file_0.12.0_Windows_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/conduit-connector-file_0.12.0_Windows_x86_64.tar.gz)
- [file_v0.12.0_darwin_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_darwin_amd64.tar.gz)
- [file_v0.12.0_darwin_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_darwin_amd64.tar.gz.sigstore.json)
- [file_v0.12.0_darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_darwin_arm64.tar.gz)
- [file_v0.12.0_darwin_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_darwin_arm64.tar.gz.sigstore.json)
- [file_v0.12.0_linux_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_linux_amd64.tar.gz)
- [file_v0.12.0_linux_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_linux_amd64.tar.gz.sigstore.json)
- [file_v0.12.0_linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_linux_arm64.tar.gz)
- [file_v0.12.0_linux_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-file/releases/download/v0.12.0/file_v0.12.0_linux_arm64.tar.gz.sigstore.json)

## Description

Expand All @@ -82,11 +98,72 @@ The Destination connector receives records and writes them to a file.
The Source connector only cares to have a valid path, even if the file
doesn't exist, it will still run and wait until a file with the configured
name is there, then it will start listening to changes and sending records.
The file is followed by the connector itself.
A line is read once its newline has been written; a record is never a piece
of a line. A last line without a newline is held until its newline is
written or the file is rotated or truncated. A graceful stop does not emit
it either: the position stays at the start of that line and the whole line
is read after the restart. For writers that never terminate their last line, set
`quietPeriod` (off by default) and the line is also read once the file has
not changed for that long.
A line longer than `maxLineSize` (default 16 MiB) stops the source with
FILE_LINE_TOO_LONG; lines are never truncated. A path that is not a regular
file (a FIFO, a device) is refused.
When the file is rotated (renamed, removed or replaced) the source reads the
old file until its size has been stable for `rotation.settle` (default 1s):
a writer that still holds the old file open keeps appending until it is told
to reopen. Then it reads the new file from its first byte. The old file is
kept open for a few minutes and read again if it grows once more. When the file
is truncated (copytruncate) it is read again from its start; lines that
were written but not yet read when it was truncated now exist only in the
copy: with `rotatedPattern` the source finds the copy by its first bytes and
reads them from there, without it the source stops with
FILE_ROTATION_TAIL_UNREADABLE.
The source never skips the unread data of a rotated file silently. If it
cannot account for it, it stops with error code FILE_ROTATION_TAIL_UNREADABLE
(naming the path and the fix). That happens when the file the saved position
belongs to cannot be found after a restart (deleted, compressed, moved
away, or truncated in place), when a file was written between the rotated
file and the current one that the source never saw at the path (two
rotations in a row), and when a file is truncated with unread data in it. Set
`rotatedPattern`, a glob such as `app.log.*`, and the source finds the
rotation chain itself, orders it by modification time and reads each file
in turn: the old file's tail, the files in between from their first byte,
then the current file. A compressed rotated file cannot be read and stops
the source too. Operators who prefer to continue can set
`rotation.acceptLoss: true`: the source then logs the same code as a
warning, with the size of what it skips, and carries on.
A position records the file's identity (device, inode, a hash of its first
4 KiB) and the byte offset. On restart the source resumes at the offset if
the file at the path is that file (same inode, size at least the offset and
same first bytes; the device number may differ, it changes across remounts); if it was rotated while the connector
was stopped it finishes the rotated-away file (found by inode next to the
path, or among the files `rotatedPattern` matches) and then reads the new
file from its start. Positions written by
v0.10.x (a bare offset) are accepted if the offset is within the file and
follows a newline, with a warning (code FILE_POSITION_UNVERIFIABLE) that
gives the offset, size, inode and modification time, because such a position
carries no file identity: if the file was rotated while upgrading, the first
offset bytes of the current file are skipped. Otherwise the source refuses to
start with error code FILE_POSITION_UNVERIFIABLE. Other codes: FILE_POSITION_INVALID,
FILE_IDENTITY_UNKNOWN. After the first record, positions are in the new
format, which v0.10.x cannot read.

### Destination

> **Output files created by earlier versions stay world-readable (0644).**
> This version creates them 0600, but it never changes the mode of an
> existing file: run `chmod 600` on the output files of existing pipelines.

The Destination connector will create the file if it doesn't exist, and
records with changes will be appended to the destination file when received.
A file created by the connector is readable and writable by its owner only
(mode 0600, further restricted by the process umask). The mode of an
existing file is never changed: **output files created by earlier versions
are world-readable (0644); run `chmod 600` on them after upgrading.**
An embedding engine can supply the open function through `file.WithOpener`
(both the source and the destination use it) and a check for the directories
the source lists to find rotated files through `file.WithDirChecker`.

## Source Parameters

Expand All @@ -104,12 +181,53 @@ pipelines:
# Path is the file path used by the connector to read/write records.
# Type: string
path: ""
# Maximum delay before an incomplete batch is read from the source.
# MaxLineSize is the longest line, in bytes, that is read. A longer
# line stops the source with the error FILE_LINE_TOO_LONG; a line is
# never truncated.
# Type: int
maxLineSize: "16777216"
# QuietPeriod is opt-in and off (0) by default. By default the last
# line of the file, when it has no trailing newline yet, is held until
# its newline is written, the file is rotated or truncated, or the
# connector is stopped gracefully, so a record is never a piece of a
# line. Set a duration to also read such a line once the file has not
# changed for that long, for writers that never terminate their last
# line.
# Type: duration
quietPeriod: "0"
# RotatedPattern is a glob that matches the rotated files of the path,
# for example "app.log.*" (relative to the directory of path unless it
# is absolute). Wildcards are only allowed in the last component, so
# the directory is literal; an embedding engine may refuse it
# (file.WithDirChecker). With it the source finds the rotation chain
# itself, orders it by modification time and reads every file in turn:
# the tail of the file it was reading, the files rotated in between
# from their first byte, then the current file. Without it the source
# stops with the error FILE_ROTATION_TAIL_UNREADABLE when it cannot
# account for a rotated file's unread tail. Compressed files are not
# read.
# Type: string
rotatedPattern: ""
# RotationAcceptLoss makes the source continue, with a warning that
# names the code and the size of what is skipped, when the unread tail
# of a rotated file cannot be read, instead of stopping.
# Type: bool
rotation.acceptLoss: "false"
# RotationSettle is how long a rotated file's size must stay unchanged
# before the source leaves it for the next file. A writer that still
# holds the old file open (logrotate renames, then signals the program
# later) keeps appending to it, and those lines are read first. A file
# that grows again after the source left it is read again for a while.
# 0 switches at once.
# Type: duration
rotation.settle: "1s"
# Maximum delay before an incomplete batch is read from the source. 0
# returns what is already queued without waiting.
# Type: duration
sdk.batch.delay: "0"
# Maximum size of batch before it gets read from the source.
# Type: int
sdk.batch.size: "0"
sdk.batch.size: "100"
# Specifies whether to use a schema context name. If set to false, no
# schema context name will be used, and schemas will be saved with the
# subject name specified in the connector (not safe because of name
Expand Down
37 changes: 19 additions & 18 deletions docs/1-using/5-connectors/7-list/3-generator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ import Tooltip from '@mui/material/Tooltip';

## Latest release

- [conduit-connector-generator_0.10.8_Darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Darwin_arm64.tar.gz)
- [conduit-connector-generator_0.10.8_Darwin_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Darwin_x86_64.tar.gz)
- [conduit-connector-generator_0.10.8_Linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Linux_arm64.tar.gz)
- [conduit-connector-generator_0.10.8_Linux_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Linux_i386.tar.gz)
- [conduit-connector-generator_0.10.8_Linux_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Linux_x86_64.tar.gz)
- [conduit-connector-generator_0.10.8_Windows_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Windows_arm64.tar.gz)
- [conduit-connector-generator_0.10.8_Windows_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Windows_i386.tar.gz)
- [conduit-connector-generator_0.10.8_Windows_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/conduit-connector-generator_0.10.8_Windows_x86_64.tar.gz)
- [generator_v0.10.8_darwin_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_darwin_amd64.tar.gz)
- [generator_v0.10.8_darwin_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_darwin_amd64.tar.gz.sigstore.json)
- [generator_v0.10.8_darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_darwin_arm64.tar.gz)
- [generator_v0.10.8_darwin_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_darwin_arm64.tar.gz.sigstore.json)
- [generator_v0.10.8_linux_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_linux_amd64.tar.gz)
- [generator_v0.10.8_linux_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_linux_amd64.tar.gz.sigstore.json)
- [generator_v0.10.8_linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_linux_arm64.tar.gz)
- [generator_v0.10.8_linux_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.10.8/generator_v0.10.8_linux_arm64.tar.gz.sigstore.json)
- [conduit-connector-generator_0.11.0_Darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Darwin_arm64.tar.gz)
- [conduit-connector-generator_0.11.0_Darwin_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Darwin_x86_64.tar.gz)
- [conduit-connector-generator_0.11.0_Linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Linux_arm64.tar.gz)
- [conduit-connector-generator_0.11.0_Linux_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Linux_i386.tar.gz)
- [conduit-connector-generator_0.11.0_Linux_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Linux_x86_64.tar.gz)
- [conduit-connector-generator_0.11.0_Windows_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Windows_arm64.tar.gz)
- [conduit-connector-generator_0.11.0_Windows_i386.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Windows_i386.tar.gz)
- [conduit-connector-generator_0.11.0_Windows_x86_64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/conduit-connector-generator_0.11.0_Windows_x86_64.tar.gz)
- [generator_v0.11.0_darwin_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_darwin_amd64.tar.gz)
- [generator_v0.11.0_darwin_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_darwin_amd64.tar.gz.sigstore.json)
- [generator_v0.11.0_darwin_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_darwin_arm64.tar.gz)
- [generator_v0.11.0_darwin_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_darwin_arm64.tar.gz.sigstore.json)
- [generator_v0.11.0_linux_amd64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_linux_amd64.tar.gz)
- [generator_v0.11.0_linux_amd64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_linux_amd64.tar.gz.sigstore.json)
- [generator_v0.11.0_linux_arm64.tar.gz](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_linux_arm64.tar.gz)
- [generator_v0.11.0_linux_arm64.tar.gz.sigstore.json](https://conduit.gateway.scarf.sh/connector/download/ConduitIO/conduit-connector-generator/releases/download/v0.11.0/generator_v0.11.0_linux_arm64.tar.gz.sigstore.json)

## Description

Expand Down Expand Up @@ -222,12 +222,13 @@ pipelines:
# Number of records to be generated (0 means infinite).
# Type: int
recordCount: ""
# Maximum delay before an incomplete batch is read from the source.
# Maximum delay before an incomplete batch is read from the source. 0
# returns what is already queued without waiting.
# Type: duration
sdk.batch.delay: "0"
# Maximum size of batch before it gets read from the source.
# Type: int
sdk.batch.size: "0"
sdk.batch.size: "100"
# Specifies whether to use a schema context name. If set to false, no
# schema context name will be used, and schemas will be saved with the
# subject name specified in the connector (not safe because of name
Expand Down
Loading