changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > ventivac / man/2/venti

revision 112: 994f59b44578
child 114: 8aa73614be8a
     1.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2+++ b/man/2/venti	Fri Aug 17 21:38:38 2007 +0200
     1.3@@ -0,0 +1,107 @@
     1.4+.TH VENTI 2
     1.5+.SH NAME
     1.6+Venti \- access to Venti content-addressed filestore.
     1.7+.SH SYNOPSIS
     1.9+include "venti.m";
    1.10+venti := load Venti Venti->PATH;
    1.11+Session: import venti;
    1.13+init:			fn();
    1.14+unpackentry:	fn(d: array of byte): ref Entry;
    1.15+unpackroot:	fn(d: array of byte): ref Root;
    1.17+Session: adt {
    1.18+	new:		fn(fd: ref Sys->FD): ref Session;
    1.19+	read:		fn(s: self ref Session, score: Venti->Score, etype: int, maxn: int): array of byte;
    1.20+	write:	fn(s: self ref Session, etype: int, buf: array of byte): (int, Venti->Score);
    1.21+	sync:	fn(s: self ref Session): int;
    1.24+Score: adt {
    1.25+	a: array of byte;
    1.26+	eq:		fn(a: self Score, b: Score): int;
    1.27+	text:		fn(a: self Score): string;
    1.28+	parse:	fn(s: string): (int, Score);
    1.29+	zero:		fn(): Score;
    1.34+.I Venti
    1.35+is a block storage server intended for archival applications.
    1.37+.I Venti
    1.38+module provides low-level access to a Venti server.
    1.39+The module assumes that the physical connection
    1.40+to the server has already been established
    1.41+(for example, by
    1.42+.IR dial (2)).
    1.43+On a Venti server, a block is addressed by the SHA1 hash of
    1.44+the contents of that block, known as a
    1.45+.IR score ,
    1.46+and represented as a
    1.47+.B Score
    1.49+Blocks are additionally tagged with a
    1.50+.IR type ,
    1.51+facilitating recovery in the event of corruption.
    1.53+.B Session
    1.54+represents an session with a Venti server.
    1.56+.IB s .new(\fIfd\fP)
    1.57+.B New
    1.58+performs the initial handshake with the Venti server,
    1.59+returning established
    1.60+.BR Session .
    1.62+.IB s .read(\fIscore\fP,\ \fIetype\fP,\ \fImaxn\fP)
    1.63+.B Read
    1.64+tries to retrieve the block
    1.65+corresponding to
    1.66+.IR score ,
    1.67+and of type
    1.68+.IR etype .
    1.69+The block must be no longer than
    1.70+.I maxn
    1.72+.I Etype
    1.73+is conventionally one of the constants
    1.74+.BR Roottype ,
    1.75+.BR Dirtype ,
    1.76+.BR Datatype
    1.78+.BR Pointertype [0-9],
    1.79+where the different
    1.80+.BR Pointertype s
    1.81+represent different depth levels within a Venti tree.
    1.83+.IB s .write(\fIetype\fP,\ \fIbuf\fP)
    1.84+.B Write
    1.85+writes the data in
    1.86+.I buf
    1.87+to the Venti server.
    1.88+The block will be tagged with type
    1.89+.IR etype .
    1.90+It returns a tuple, say
    1.91+.RI ( ok ,\  score );
    1.92+on error,
    1.93+.I ok
    1.94+is -1, otherwise
    1.95+.I ok
    1.96+is 0 and
    1.97+.I score
    1.98+contains the Venti score for the block that has been written.
   1.100+.IB s .sync()
   1.101+.B Sync
   1.102+tells the Venti server to make sure that all data is committed to
   1.103+active storage.
   1.104+.SH SOURCE
   1.105+.B /appl/lib/venti.b
   1.106+.SH BUGS
   1.107+to do: 
   1.108+Score adt
   1.109+entry packing/unpacking
   1.110+other Vmsgs, Session.rpc()?