net.tomp2p.storage
Interface Digest

All Known Subinterfaces:
Storage
All Known Implementing Classes:
StorageDisk, StorageGeneric, StorageMemory, TrackerStorage

public interface Digest

The storage stores Number480, which is separated in 3 Number160. The first Number160 is the location key, the second is the domain key, and the third is the content key. A digest can be calculated over all content keys for a specific location and domain. The digest can also be calculated over a selected range of content keys for a specific location and domain.

Author:
Thomas Bocek

Method Summary
 DigestInfo digest(Number160 locationKey, Number160 domainKey, Collection<Number160> contentKeys)
          Calculates a digest over a specific location and domain.
 DigestInfo digest(Number160 locationKey, Number160 domainKey, SimpleBloomFilter<Number160> keyBloomFilter, SimpleBloomFilter<Number160> contentBloomFilter)
          Calculates a digest over a specific location and domain.
 

Method Detail

digest

DigestInfo digest(Number160 locationKey,
                  Number160 domainKey,
                  Collection<Number160> contentKeys)
Calculates a digest over a specific location and domain. It will return those content keys that are stored. Those keys that are not stored are ignored

Parameters:
locationKey - The location key
domainKey - The domain key
contentKeys - The content keys to look for. Those keys that are not found are ignored. Can be set to null -> gets the information for all content keys
Returns:
A list of all hashes for the content keys. To return a predictable amount (important for routing), the hashes can be xored.

digest

DigestInfo digest(Number160 locationKey,
                  Number160 domainKey,
                  SimpleBloomFilter<Number160> keyBloomFilter,
                  SimpleBloomFilter<Number160> contentBloomFilter)
Calculates a digest over a specific location and domain. It will return those content keys that match the Bloom filter. Those keys that are not stored are ignored

Parameters:
locationKey - The location key
domainKey - The domain key
keyBloomFilter - The bloomFilter of those key elements we want the digest. Please not that there might be false positive, e.g., a Number160 that is included in the digest but not stored on disk/memory.
contentBloomFilter - The bloomFilter of those data elements we want the digest. Please not that there might be false positive, e.g., a Number160 that is included in the digest but not stored on disk/memory.
Returns:
A list of all hashes for the content keys. To return a predictable amount (important for routing), the hashes can be xored.


Copyright © 2013. All Rights Reserved.