:) Thanks for the code review!

On Sunday 13 April 2008 14:15, j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2008-04-13 13:15:36 +0000 (Sun, 13 Apr 2008)
> New Revision: 19260
> 
> Modified:
>    trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
> Log:
> javadoc: document the voodoo magic in BDBFS.reconstruct()
> 
> 
> Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
> ===================================================================
> --- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java       
> 2008-04-13 
12:15:01 UTC (rev 19259)
> +++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java       
> 2008-04-13 
13:15:36 UTC (rev 19260)
> @@ -888,6 +888,44 @@
>               }
>       }
>  
> +     /**
> +      * Reconstruct the database using flat file stores and other dark magic.
> +      * 
> +      * <strong>You are not expected to understand this.</strong>
> +      * 
> +      * <dl>
> +      * <dt>header + data</dt>
> +      * <dd>read from storeRAF, always available.</dd>
> +      * 
> +      * <dt>fullKey</dt>
> +      * <dd>read from keyRAF, maybe null.</dd>
> +      * 
> +      * <dt>routingkey </dt>
> +      * <dd>
> +      * <ol>
> +      * <li><code>callback.routingKeyFromFullKey(); </code></li>
> +      * <li>if <code>null</code> or <code>KeyVerifyException</code>,<code> 
callback.construct().getRoutingKey()</code>,
> +      * may throw <code>KeyVerifyException</code></li>
> +      * <ol>
> +      * <code>fullKey</code> (and hence
> +      * <code>callback.routingKeyFromFullKey(); </code>) may be phantom, 
> hence
> +      * we must verify
> +      * <code> callback.construct().getRoutingKey()  == routingkey </code> on
> +      * <code>fetch()</code> </dd>
> +      * </dl>
> +      * 
> +      * On <code>OperationStatus.KEYEXIST</code> or bad
> +      * <code> callback.construct</code>:
> +      * <ol>
> +      * <li>insert a database entry with random key, (minimum lru - 1); </li>
> +      * <li>if <code>op != OperationStatus.SUCCESS</code>,
> +      * <code>addFreeBlock()</code>.</li>
> +      * </ol>
> +      * 
> +      * 
> +      * @throws DatabaseException
> +      * @throws IOException
> +      */
>       private void reconstruct() throws DatabaseException, IOException {
>               if(keysDB.count() != 0)
>                       throw new IllegalStateException("Store must be empty 
> before 
reconstruction!");
> 
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080414/f2cb079e/attachment.pgp>

Reply via email to