gdp / apps / README @ master
History | View | Annotate | Download (3.1 KB)
1 | ad18c802 | Eric Allman | This file summarizes the usage of at least some of the applications |
---|---|---|---|
2 | in this directory (more to come). |
||
3 | |||
4 | GCL means "GDP Channel/Log". GCLs consist of a series of opaque |
||
5 | (to the GDP) records numbered from 1. Although records also have |
||
6 | commit timestamps it is not possible to use those as keys at this |
||
7 | time; in particular, timestamps are not necessarily unique. |
||
8 | |||
9 | Nearly all programs accept a "-D" flag to set debugging options. |
||
10 | |||
11 | |||
12 | NAMING |
||
13 | |||
14 | Internal GCL names are represented as binary strings of 256 bits. |
||
15 | Externally this is shown as a 43-character string that is a variant |
||
16 | on base64 encoding designed to be compatible with URIs. |
||
17 | |||
18 | Alternatively, a user may use an arbitrary string. It is recommended |
||
19 | that this look like a UNIX pathname but using another character as |
||
20 | the separator (to make the names easy to encode in a URI). The valid |
||
21 | characters for URIs are "-", "_", ".", and "~". This string is |
||
22 | hashed to an internal name using sha256. For example, the name |
||
23 | "x" is the same as "LXEWQrcmsEQBYnyp-6wy9chTD7GQPMTbAiWHF5IaSIE". |
||
24 | At the moment all users share a namespace, but in the future the |
||
25 | user's public key will be included. |
||
26 | |||
27 | |||
28 | 6e2cccae | Eric Allman | GDP-WRITER |
29 | ad18c802 | Eric Allman | |
30 | 6e2cccae | Eric Allman | The gdp-writer program creates or appends to a GCL. Although |
31 | ad18c802 | Eric Allman | the GDP accepts binary input, this program reads newline terminated |
32 | text from the standard input. Each line is written to the GCL |
||
33 | named on the command line, or if no name is given, to a GCL with |
||
34 | a random name (which will be printed). |
||
35 | |||
36 | GCLs are created unless the -a (append) flag is included. |
||
37 | |||
38 | |||
39 | 6e2cccae | Eric Allman | GDP-READER |
40 | ad18c802 | Eric Allman | |
41 | 6e2cccae | Eric Allman | The gdp-reader program (unsurprisingly) reads and prints data from |
42 | ad18c802 | Eric Allman | a GCL. It assumes that the data is text; if not it will print random |
43 | binary gibberish. |
||
44 | |||
45 | There are three "modes" for reading. The default does individual |
||
46 | read calls for each record being returned. The "-m" flag enables |
||
47 | "multiread" which does one call to the GDP that returns multiple |
||
48 | results. The "-s" flag enables "subscribe" mode, which is like |
||
49 | multiread but waits for new data to be written to a GCL (i.e., it |
||
50 | doesn't necessarily complete in finite time). |
||
51 | |||
52 | All modes take a "-f" flag to specify the first record number and a |
||
53 | "-n" flag to set the number of records to be returned. If the -f |
||
54 | value is negative it counts from the end of the GCL, i.e., the |
||
55 | most recently written records. If a negative -f value would specify |
||
56 | a non-positive record number (i.e., a record before the start of the |
||
57 | GCL) then 1 is used. |
||
58 | |||
59 | If the -n value is zero it means "infinite" (this is also the |
||
60 | default). For all but -s mode this really means "end of GCL", as |
||
61 | does a value larger than the actual number of records in the GCL. |
||
62 | Hence, "-n N" really means "at most N records". |
||
63 | |||
64 | In -s mode the read will will continue to wait for more data to be |
||
65 | published to the GCL. For example, the following commands will act |
||
66 | as a transmission channel: |
||
67 | |||
68 | 6e2cccae | Eric Allman | Window 1> gdp-writer xyzzy |
69 | Window 2> gdp-reader -s xyzzy |
||
70 | ad18c802 | Eric Allman | Window 1> (input data) |
71 | |||
72 | 6e2cccae | Eric Allman | Note that the gdp-writer has to be started first so that xyzzy |
73 | exists when gdp-reader starts up. |
||
74 | ad18c802 | Eric Allman | |
75 | |||
76 | GDP-REST |
||
77 | |||
78 | This is the REST interface to the GDP. Its use is described in the |
||
79 | README file in the parent directory. |
||
80 | |||
81 | |||
82 | RW-BENCH |
||
83 | |||
84 | Simple performance testing. Documentation is To Be Done. |