org.egothor.util.hash
Class Table

java.lang.Object
  extended by org.egothor.util.hash.Table
All Implemented Interfaces:
URIRepositoryAppender

public final class Table
extends java.lang.Object
implements URIRepositoryAppender

Author:
galambos

Constructor Summary
Table(int bucket_size, java.lang.String digestAlgorithm, java.lang.String filename, int nodes_cache, int uris_cache, int buckets_size)
           
 
Method Summary
 long append(java.net.URI uri)
          Returns the new identifier related to the URI, -id iff the URI already exists under the id in the base.
 long buckets()
           
 float bucketsCacheEff()
           
 float cacheEff()
           
 void close()
           
 int dataSize()
          Length of a hash value.
 long nodes()
           
 float nodesCacheEff()
           
 long size()
          Returns number of URIs in the base, or -1 iff the value is unknown.
 boolean wasNew()
          Returns true if and only if the last successful push(byte[]) inserted a new item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(int bucket_size,
             java.lang.String digestAlgorithm,
             java.lang.String filename,
             int nodes_cache,
             int uris_cache,
             int buckets_size)
      throws java.io.IOException,
             java.security.NoSuchAlgorithmException
Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
Method Detail

size

public long size()
Description copied from interface: URIRepositoryAppender
Returns number of URIs in the base, or -1 iff the value is unknown.

Specified by:
size in interface URIRepositoryAppender

buckets

public long buckets()

nodes

public long nodes()

nodesCacheEff

public float nodesCacheEff()

bucketsCacheEff

public float bucketsCacheEff()

cacheEff

public float cacheEff()

wasNew

public boolean wasNew()
Returns true if and only if the last successful push(byte[]) inserted a new item.


dataSize

public int dataSize()
Length of a hash value.

Returns:
digester.getDigestLength

close

public void close()
Specified by:
close in interface URIRepositoryAppender

append

public long append(java.net.URI uri)
Description copied from interface: URIRepositoryAppender
Returns the new identifier related to the URI, -id iff the URI already exists under the id in the base.

Specified by:
append in interface URIRepositoryAppender