Article View: news.software.nntp
Article #26540Re: Diablo progress report
From: Jan-Pieter Cornet
Date: Thu, 26 Feb 1998 00:00
Date: Thu, 26 Feb 1998 00:00
85 lines
5300 bytes
5300 bytes
In article <6d2n9d$pqh$1@flea.best.net>, Matt Dillon <dillon@best.net> wrote: > > Actually, I do a really cute programmer's trick... it's modulo N so > you have, say, 1000 fixed slots. If you want to retrieve article N, > you look in slot (N % 1000). The structure in the slot contains the > actual article number so you know if it's actually article N or article > N - 1000. No copying required. Ah, right. Sortof like hashing, but not quite. How do you determine the number 1000? Will that be a system-wide constant? We currently have some groups online with over 10000 articles in them (long expiry on busy groups, it's a local chat group mainly), and there are groups with usually less than 2 articles in them (like alt.lang.intercal)... Then again overhead voor 1000 index entries is only 16K, and for large groups with 10k articles you'd only need 5 searches on average. (10k groups are not too frequent anyway, as a quick scan of our active files shows, we have like half a dozen groups with around 10k articles online). >:In article <6d2ij4$rh2$1@xs1.xs4all.nl>, >:Jan-Pieter Cornet <johnpc@xs4all.nl> wrote: >:>Other than that, the circular buffer idea sounds great. (Writing a binary >:>search for a circular buffer must be fun :) > > Ah, wait... I think there's some confusion here. The *index* file is > the circular buffer.... fixed size 16 byte structures which references > the header information in a separate *data* file. Each group has one > index file and any number of data files. Each data file holds up to > 256 article's worth of headers. Yup, I understood that. 256 articles might be too much for quiet groups, you might want to make that 256 articles or one day's worth. > No binary searches are involved. The reader looks the article number up > in the index file and seeks directly to the correct position in the > appropriate data file. There isn't much waste either, which is nice. Right, I was getting ahead of myself with the binary search. IF you are going to implement newnews and IF you choose the overview database to implement it, you'll need a search to the correct article arrival date for each group, which can be done using a binary search provided the articles are in order of arrival in the buffer. Which they aren't. Well, not entirely. > expiration of data files will be simple: stale data files representing > old articles are simply deleted. The problem is in determining *when* > the overview information is stale. Like I said before: you need some sort of "expire" feed from the spool machine. The spooler should be able to say "I've just expired article ranges 1-5486,5488-5612 from group X (article 5487 had an explicit Expires header, which as of diablo version 1.42 is recognised... blabla etc). This does make it hard to use anything but diablo for the spool software. I'm sure it could be hacked around on other platforms, eg. innd usually uses an expire.rm file to remove articles, which could be exported... (Hm, but a header-only feed is not something to be found either in other software, afaik. Can be done with an external program, of course...) Or... whenever the reader asks an article from the spool, and the spooler says it doesn't have it, issue a GROUP command to the spooler to get the low water mark for that group, and then instantly do expiry. And whenever the reader feels it needs something to do, go issue GROUP commands for groups that you haven't visited for some time. That's NNTP-compatible. It does mean "disappointing" users now and then where XOVER said the article would be there, but in reality it isn't (which could happen anyway, when the article is cancelled or expired between the XOVER and ARTICLE commands, but probably won't happen too often). This will not be ideal for groups with lots of gaps in them, though... Then erase the appropriate entries from the index file, keep a reference count on the number of articles that are still in the index, per datafile, and unlink datafiles when the reference count goes to 0. I'm just thinking out loud here... after a crash and periodically, you might want to check the reference counts, which should be easy since you can keep the reference counts in the index file as well. -- #! ##### Jan-Pieter Cornet ##### <johnpc@xs4all.net> ##### perl ++$_;$!=$_+++$_;($:,$,,$/,$*)=$!=~/.(.)...(.)(.).(.)/;$!=$_+$_; ($@,$\,$~)=$!=~/(.)(.).(.)/; $_="$,$/$:"; $@++; $~="$~$_";($_)= \$$=~/\((.)/;$|=++$_;$_++;$|++;$~="$~ $@$:";`$~$/$\$*$, $|>&$_`
Technical Details
Message-ID:
<6d3q6c$6dm$1@xs1.xs4all.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<6clc7s$b96$1@apollo.backplane.com> <6d1n5m$69o$1@flea.best.net> <6d2ij4$rh2$1@xs1.xs4all.nl> <6d2n9d$pqh$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <6d3q6c$6dm$1@xs1.xs4all.nl> Subject: Re: Diablo progress report Date: Thu, 26 Feb 1998 00:00:00 +0000 From: Jan-Pieter Cornet <johnpc@xs4all.nl> References: <6clc7s$b96$1@apollo.backplane.com> <6d1n5m$69o$1@flea.best.net> <6d2ij4$rh2$1@xs1.xs4all.nl> <6d2n9d$pqh$1@flea.best.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 328827611 X-XS4ALL-Date: Thu, 26 Feb 1998 14:20:14 CET Organization: XS4ALL Internet B.V. Newsgroups: news.software.nntp