This function makes it possible to efficiently read the
terms which have been appended to a log. It minimises disk
@@ -70,29 +72,29 @@
The first time chunk is called an initial
continuation returned from the open/1, open/2 must be provided.
- When chunk/3 is called, N controls the
+
When chunk/3 is called, N controls the
maximum number of terms that are read from the log in each
chunk. Default is infinity, which means that all the
terms contained in the 8K chunk are read. If less than
- N terms are returned, this does not necessarily mean
+ N terms are returned, this does not necessarily mean
that end of file is reached.
The chunk function returns a tuple
- {Continuation2, Terms}, where Terms is a list
- of terms found in the log. Continuation2 is yet
+ {Continuation2, Terms}, where Terms is a list
+ of terms found in the log. Continuation2 is yet
another continuation which must be passed on into any
subsequent calls to chunk. With a series of calls to
chunk it is then possible to extract all terms from a
log.
The chunk function returns a tuple
- {Continuation2, Terms, Badbytes} if the log is opened
- in read only mode and the read chunk is corrupt. Badbytes
+ {Continuation2, Terms, Badbytes} if the log is opened
+ in read only mode and the read chunk is corrupt. Badbytes
indicates the number of non-Erlang terms found in the chunk.
Note also that the log is not repaired.
- chunk returns {Continuation2, eof} when the end of the log is
- reached, and {error, Reason} if an error occurs.
+
chunk returns {Continuation2, eof} when the end of the log is
+ reached, and {error, Reason} if an error occurs.
The returned continuation may or may not be valid in the next call to
chunk. This is because the log may wrap and delete
@@ -103,37 +105,29 @@