1MK-FIFO-SPLIT(1) User Contributed Perl Documentation MK-FIFO-SPLIT(1)
2
3
4
6 mk-fifo-split - Split files and pipe lines to a fifo without really
7 splitting.
8
10 Read hugefile.txt in chunks of a million lines without physically
11 splitting it:
12
13 mk-fifo-split --lines 1000000 hugefile.txt
14 while [ -e /tmp/mk-fifo-split ]; do cat /tmp/mk-fifo-split; done
15
17 The following section is included to inform users about the potential
18 risks, whether known or unknown, of using this tool. The two main
19 categories of risks are those created by the nature of the tool (e.g.
20 read-only tools vs. read-write tools) and those created by bugs.
21
22 mk-fifo-split creates and/or deletes the "--fifo" file. Otherwise, no
23 other files are modified, and it merely reads lines from the file given
24 on the command-line. It should be very low-risk.
25
26 At the time of this release, we know of no bugs that could cause
27 serious harm to users.
28
29 The authoritative source for updated information is always the online
30 issue tracking system. Issues that affect this tool will be marked as
31 such. You can see a list of such issues at the following URL:
32 http://www.maatkit.org/bugs/mk-fifo-split
33 <http://www.maatkit.org/bugs/mk-fifo-split>.
34
35 See also "BUGS" for more information on filing bugs and getting help.
36
38 mk-fifo-split lets you read from a file as though it contains only some
39 of the lines in the file. When you read from it again, it contains the
40 next set of lines; when you have gone all the way through it, the file
41 disappears. This works only on Unix-like operating systems.
42
43 You can specify multiple files on the command line. If you don't
44 specify any, or if you use the special filename "-", lines are read
45 from standard input.
46
48 --config
49 type: Array
50
51 Read this comma-separated list of config files; if specified, this
52 must be the first option on the command line.
53
54 --fifo
55 type: string; default: /tmp/mk-fifo-split
56
57 The name of the fifo from which the lines can be read.
58
59 --force
60 Remove the fifo if it exists already, then create it again.
61
62 --help
63 Show help and exit.
64
65 --lines
66 type: int; default: 1000
67
68 The number of lines to read in each chunk.
69
70 --offset
71 type: int; default: 0
72
73 Begin at the Nth line. If the argument is 0, all lines are printed
74 to the fifo. If 1, then beginning at the first line, lines are
75 printed (exactly the same as 0). If 2, the first line is skipped,
76 and the 2nd and subsequent lines are printed to the fifo.
77
78 --pid
79 type: string
80
81 Create the given PID file. The file contains the process ID of the
82 script. The PID file is removed when the script exits. Before
83 starting, the script checks if the PID file already exists. If it
84 does not, then the script creates and writes its own PID to it. If
85 it does, then the script checks the following: if the file contains
86 a PID and a process is running with that PID, then the script dies;
87 or, if there is no process running with that PID, then the script
88 overwrites the file with its own PID and starts; else, if the file
89 contains no PID, then the script dies.
90
91 --statistics
92 Print out statistics between chunks. The statistics are the number
93 of chunks, the number of lines, elapsed time, and lines per second
94 overall and during the last chunk.
95
96 --version
97 Show version and exit.
98
100 You can download Maatkit from Google Code at
101 <http://code.google.com/p/maatkit/>, or you can get any of the tools
102 easily with a command like the following:
103
104 wget http://www.maatkit.org/get/toolname
105 or
106 wget http://www.maatkit.org/trunk/toolname
107
108 Where "toolname" can be replaced with the name (or fragment of a name)
109 of any of the Maatkit tools. Once downloaded, they're ready to run; no
110 installation is needed. The first URL gets the latest released version
111 of the tool, and the second gets the latest trunk code from Subversion.
112
114 The environment variable "MKDEBUG" enables verbose debugging output in
115 all of the Maatkit tools:
116
117 MKDEBUG=1 mk-....
118
120 You need Perl, DBI, DBD::mysql, and some core packages that ought to be
121 installed in any reasonably new version of Perl.
122
124 For list of known bugs see http://www.maatkit.org/bugs/mk-fifo-split
125 <http://www.maatkit.org/bugs/mk-fifo-split>.
126
127 Please use Google Code Issues and Groups to report bugs or request
128 support: <http://code.google.com/p/maatkit/>. You can also join
129 #maatkit on Freenode to discuss Maatkit.
130
131 Please include the complete command-line used to reproduce the problem
132 you are seeing, the version of all MySQL servers involved, the complete
133 output of the tool when run with "--version", and if possible,
134 debugging output produced by running with the "MKDEBUG=1" environment
135 variable.
136
138 This program is copyright 2007-2010 Baron Schwartz. Feedback and
139 improvements are welcome.
140
141 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
142 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
143 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
144
145 This program is free software; you can redistribute it and/or modify it
146 under the terms of the GNU General Public License as published by the
147 Free Software Foundation, version 2; OR the Perl Artistic License. On
148 UNIX and similar systems, you can issue `man perlgpl' or `man
149 perlartistic' to read these licenses.
150
151 You should have received a copy of the GNU General Public License along
152 with this program; if not, write to the Free Software Foundation, Inc.,
153 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
154
156 Baron Schwartz
157
159 This tool is part of Maatkit, a toolkit for power users of MySQL.
160 Maatkit was created by Baron Schwartz; Baron and Daniel Nichter are the
161 primary code contributors. Both are employed by Percona. Financial
162 support for Maatkit development is primarily provided by Percona and
163 its clients.
164
166 This manual page documents Ver 1.0.7 Distrib 6839 $Revision: 6831 $.
167
168
169
170perl v5.12.1 2010-08-01 MK-FIFO-SPLIT(1)