13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
collection of artifacts. Each artifact is identified by its SHA1 hash
expressed as a 40-character lower-case hexadecimal string.
Synchronization is simply the process of sharing artifacts between
servers so that all servers have copies of all artifacts. Because
artifacts are unordered, the order in which artifacts are received
at a server is inconsequential. It is assumed that the SHA1 hashes
of artifacts are unique - that every artifact has a different SHA1 hash.
To first approximation, synchronization proceeds by sharing lists
SHA1 hashes of available artifacts, then sharing those artifacts that
are not found on one side or the other of the connection. In practice,
a repository might contain millions of artifacts. The list of
SHA1 hashes for this many artifacts can be large. So optimizations are
employed that usually reduce the number of SHA1 hashes that need to be
shared to a few hundred.</p>
<h2>2.0 Transport</h2>
<p>All communication between client and server is via HTTP requests.
The server is listening for incoming HTTP requests. The client
issues one or more HTTP requests and receives replies for each
request.</p>
|
|
>
>
>
>
>
>
>
>
>
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
collection of artifacts. Each artifact is identified by its SHA1 hash
expressed as a 40-character lower-case hexadecimal string.
Synchronization is simply the process of sharing artifacts between
servers so that all servers have copies of all artifacts. Because
artifacts are unordered, the order in which artifacts are received
at a server is inconsequential. It is assumed that the SHA1 hashes
of artifacts are unique - that every artifact has a different SHA1 hash.
To a first approximation, synchronization proceeds by sharing lists
SHA1 hashes of available artifacts, then sharing those artifacts that
are not found on one side or the other of the connection. In practice,
a repository might contain millions of artifacts. The list of
SHA1 hashes for this many artifacts can be large. So optimizations are
employed that usually reduce the number of SHA1 hashes that need to be
shared to a few hundred.</p>
<p>Each repository also has local state. The local state determines
the web-page formatting preferences, authorized users, ticket formats,
and similar information that varies from one repository to another.
The local state is not transfered by the <b>push</b>, <b>pull</b>,
and <b>sync</b> command, though some local state is transfered during
a <b>clone</b> in order to initialize the local state of the new
repository. The <b>configuration push</b> and <b>configuration pull</b>
commands can be used to send or receive local state.</p>
<h2>2.0 Transport</h2>
<p>All communication between client and server is via HTTP requests.
The server is listening for incoming HTTP requests. The client
issues one or more HTTP requests and receives replies for each
request.</p>
|
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
its next request. Or the client might send a cookie from a different
server on the next request. So the server must not depend on the
cookie and the server must structure the cookie payload in such
a way that it can tell if the cookie it sees is its own cookie or
a cookie from another server. (Typically the server will embed
its servercode as part of the cookie.)</p>
<h3>3.9 Error Cards</h3>
<p>If the server discovers anything wrong with a request, it generates
an error card in its reply. When the client sees the error card,
it displays an error message to the user and aborts the sync
operation. An error card looks like this:</p>
<blockquote>
<b>error</b> <i>error-message</i>
</blockquote>
<p>The error message is English text that is encoded in order to
be a single token.
A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A
newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash
(ASCII 0x5C) is represented as two backslashes "\\". Apart from
space and newline, no other whitespace characters nor any
unprintable characters are allowed in
the error message.</p>
<h3>3.10 Unknown Cards</h3>
<p>If either the client or the server sees a card that is not
described above, then it generates an error and aborts.</p>
<h2>4.0 Phantoms And Clusters</h2>
<p>When a repository knows that a artifact exists and knows the ID of
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
|
its next request. Or the client might send a cookie from a different
server on the next request. So the server must not depend on the
cookie and the server must structure the cookie payload in such
a way that it can tell if the cookie it sees is its own cookie or
a cookie from another server. (Typically the server will embed
its servercode as part of the cookie.)</p>
<h3>3.9 Request-Configuration Cards</h3>
<i>TBD...</i>
<h3>3.10 Configuration Cards</h3>
<i>TBD...</i>
<h3>3.11 Error Cards</h3>
<p>If the server discovers anything wrong with a request, it generates
an error card in its reply. When the client sees the error card,
it displays an error message to the user and aborts the sync
operation. An error card looks like this:</p>
<blockquote>
<b>error</b> <i>error-message</i>
</blockquote>
<p>The error message is English text that is encoded in order to
be a single token.
A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A
newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash
(ASCII 0x5C) is represented as two backslashes "\\". Apart from
space and newline, no other whitespace characters nor any
unprintable characters are allowed in
the error message.</p>
<h3>3.12 Comment Cards</h3>
<p>Any card that begins with "#" (ASCII 0x23) is a comment card and
is silently ignored.</p>
<h3>3.13 Unknown Cards</h3>
<p>If either the client or the server sees a card that is not
described above, then it generates an error and aborts.</p>
<h2>4.0 Phantoms And Clusters</h2>
<p>When a repository knows that a artifact exists and knows the ID of
|
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
<li> <b>pull</b> <i>servercode projectcode</i>
<li> <b>clone</b>
<li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
<li> <b>file</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
<li> <b>igot</b> <i>artifact-id</i>
<li> <b>gimme</b> <i>artifact-id</i>
<li> <b>cookie</b> <i>cookie-text</i>
<li> <b>error</b> <i>error-message</i>
</ul>
<li>Phantoms are artifacts that a repository knows exist but does not possess.
<li>Clusters are artifacts that contain IDs of other artifacts.
<li>Clusters are created automatically on the server during a pull.
<li>Repositories keep track of all artifacts that are not named in any
cluster and send igot messages for those artifacts.
<li>Repositories keep track of all the phantoms they hold and send
gimme messages for those artifacts.
</ol>
|
>
>
>
|
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
<li> <b>pull</b> <i>servercode projectcode</i>
<li> <b>clone</b>
<li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
<li> <b>file</b> <i>artifact-id delta-artifact-id size</i> <b>\n</b> <i>content</i>
<li> <b>igot</b> <i>artifact-id</i>
<li> <b>gimme</b> <i>artifact-id</i>
<li> <b>cookie</b> <i>cookie-text</i>
<li> <b>reqconfig</b> <i>parameter-name</i>
<li> <b>config</b> <i>parameter-name size</i> <b>\n</b> <i>content</i>
<li> <b>#</b> <i>arbitrary-text...</i>
<li> <b>error</b> <i>error-message</i>
</ul>
<li>Phantoms are artifacts that a repository knows exist but does not possess.
<li>Clusters are artifacts that contain IDs of other artifacts.
<li>Clusters are created automatically on the server during a pull.
<li>Repositories keep track of all artifacts that are not named in any
cluster and send igot messages for those artifacts.
<li>Repositories keep track of all the phantoms they hold and send
gimme messages for those artifacts.
</ol>
|