Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,226 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
flux_kvs_eventlog_create(3) | ||
=========================== | ||
:doctype: manpage | ||
|
||
|
||
NAME | ||
---- | ||
flux_kvs_eventlog_create, flux_kvs_eventlog_destroy, flux_kvs_eventlog_encode, flux_kvs_eventlog_decode, flux_kvs_eventlog_update, flux_kvs_eventlog_append, flux_kvs_eventlog_first, flux_kvs_eventlog_next - manipulate RFC 18 KVS eventlogs | ||
|
||
|
||
SYNOPSIS | ||
-------- | ||
|
||
struct flux_kvs_eventlog *flux_kvs_eventlog_create (void); | ||
|
||
void flux_kvs_eventlog_destroy (struct flux_kvs_eventlog *eventlog); | ||
|
||
char *flux_kvs_eventlog_encode (const struct flux_kvs_eventlog *eventlog); | ||
|
||
struct flux_kvs_eventlog *flux_kvs_eventlog_decode (const char *s); | ||
|
||
int flux_kvs_eventlog_update (struct flux_kvs_eventlog *eventlog, | ||
const char *s); | ||
|
||
int flux_kvs_eventlog_append (struct flux_kvs_eventlog *eventlog, | ||
const char *s); | ||
|
||
const char *flux_kvs_eventlog_first (struct flux_kvs_eventlog *eventlog); | ||
|
||
const char *flux_kvs_eventlog_next (struct flux_kvs_eventlog *eventlog); | ||
|
||
int flux_kvs_event_decode (const char *s, | ||
double *timestamp, | ||
flux_kvs_event_name_t name, | ||
flux_kvs_event_context_t context); | ||
|
||
char *flux_kvs_event_encode (const char *name, const char *context); | ||
|
||
char *flux_kvs_event_encode_timestamp (double timestamp, | ||
const char *name, | ||
const char *context); | ||
|
||
|
||
|
||
DESCRIPTION | ||
----------- | ||
An RFC 18 KVS eventlog consists of single line log entries of the form: | ||
timestamp name [context ...]\n | ||
Where 'timestamp' is seconds since the UNIX epoch (UTC), in decimal form; | ||
'name' is a 64 character or less event name, and 'context' is an optional | ||
256 character or less free form string. Each event is terminated by a newline | ||
character. | ||
Raw event strings can be atomically appended to an eventlog stored in the KVS | ||
using `flux_kvs_txn_put()` with the the 'FLUX_KVS_APPEND' flag. | ||
The eventlog can be accessed with `flux_kvs_lookup()`, optionally with | ||
the 'FLUX_KVS_WATCH' flag. | ||
`flux_kvs_eventlog_create()` creates an empty eventlog object in memory, | ||
and `flux_kvs_eventlog_destroy()` disposes of it. | ||
`flux_kvs_eventlog_decode()` creates an eventlog object from raw RFC 18 | ||
eventlog data in string form, such as would be returned by | ||
`flux_kvs_lookup_get()`. The caller must free the returned object. | ||
`flux_kvs_eventlog_encode()` performs the opposite function; again, the | ||
caller must free the returned string. | ||
`flux_kvs_eventlog_update()` updates an eventlog object with a new snapshot | ||
of the raw log, such as might be returned from `flux_kvs_lookup_get()`. | ||
This function does not change the iterator cursor. | ||
`flux_kvs_eventlog_append()` appends a single raw event to the eventlog. | ||
The events in an eventlog object may be accessed in raw form with the | ||
iterators `flux_kvs_eventlog_first()` and `flux_kvs_eventlog_next()`. | ||
These functions return NULL when the end of the log has been reached. | ||
Pointers returned by these functions remain valid until the object | ||
is destroyed. | ||
`flux_kvs_event_decode()` decodes a raw event, copying the timestamp, | ||
name, and context fields to the supplied storage. A field may be | ||
ignored by setting the corresponding parameter to zero. If the optional | ||
context is not present, the supplied storage will be filled with the | ||
empty string. | ||
`flux_kvs_event_encode()` creates a raw event from the supplied fields. | ||
The timestamp is assigned the current wallclock time. The caller must | ||
free the returned event string. `flux_kvs_event_encode_timestamp()` is | ||
the same except the timestamp value may be explicitly set. | ||
RETURN VALUE | ||
------------ | ||
|
||
`flux_kvs_eventlog_create()` and `flux_kvs_eventlog_decode()` return | ||
an eventlog object on success, or NULL on failure with errno set. | ||
|
||
`flux_kvs_eventlog_encode()`, `flux_kvs_event_encode()`, and | ||
`flux_kvs_event_encode_timestamp()` return encoded strings on success, | ||
or NULL on failure with errno set. | ||
|
||
`flux_kvs_eventlog_update()`, `flux_kvs_eventlog_append()`, and | ||
`flux_kvs_event_decode()` return 0 on success, or -1 on failure | ||
with errno set. | ||
|
||
`flux_kvs_eventlog_first()` and `flux_kvs_eventlog_next()` return | ||
a const pointer to a raw event, or NULL if the internal cursor has | ||
reached the end of the log. | ||
|
||
ERRORS | ||
------ | ||
EINVAL:: | ||
One of the arguments was invalid. | ||
ENOMEM:: | ||
Out of memory. | ||
AUTHOR | ||
------ | ||
This page is maintained by the Flux community. | ||
|
||
|
||
RESOURCES | ||
--------- | ||
Github: <http://github.com/flux-framework> | ||
COPYRIGHT | ||
--------- | ||
include::COPYRIGHT.adoc[] | ||
|
||
|
||
SEE ALSO | ||
--------- | ||
flux_kvs_lookup (3), flux_kvs_txn_create (3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,3 +444,5 @@ gpus | |
fulfillments | ||
enodata | ||
getroot | ||
eventlog | ||
eventlogs |
Oops, something went wrong.