netcom.mds
Class AbstractShareTask

java.lang.Object
  extended bynetcom.mds.AbstractShareTask
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AddShareTask, RemoveShareTask

public abstract class AbstractShareTask
extends java.lang.Object
implements java.lang.Runnable

Title: Abstract Share Task

Description: This represents an abstract Task which modifies shares. It holds common variables and crucial common-variables.

Copyright: Copyright (c) 2002

Company: NETCOM

See Also:
AddShareTask, RemoveShareTask

Field Summary
protected  LDAPCommunicator ldap_comm
          reference to an ldap communicator object to use for communications with other nodes (BloomUpdates)
protected  PSData psdata
          the correct PSData to be adding this share to
protected static int shares_mod_count
          count for how many times a share has been modified, might be used later to improve the bloom filter algorithm to more exact...
 
Constructor Summary
AbstractShareTask(PSData psdata, LDAPCommunicator ldap_comm)
          Constructor for AbstractShareTask, only takes an LDAPCommunicator reference
 
Method Summary
protected  BloomUpdate rebuildBloom(java.util.Map all_psdatas)
          Time-intensive method to rebuild a BloomFilter from scratch with all PSDatas on the MDS node.
abstract  void run()
          This override run() in Runnable and requires implementing subclasses to define a run/execution method
protected  void sendCompleteUpdate()
          Method to send a BloomUpdate which represents a complete BloomFilter to all nodes This complete bloom filter is sent after N many updates to compensate for the error of normal BloomUpdates
protected  void sendUpdateToAll(BloomUpdate update)
          Method to send a BloomUpdate to all other MDS Nodes by contacting LDAP for a listing
protected  BloomUpdate updateBloom(AbstractShare new_share)
          Method to update the local BloomFilter with the new added share.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shares_mod_count

protected static int shares_mod_count
count for how many times a share has been modified, might be used later to improve the bloom filter algorithm to more exact... ie after X many share_mod_counts then a full bloomupdate will be sent to re-sync everything


ldap_comm

protected final LDAPCommunicator ldap_comm
reference to an ldap communicator object to use for communications with other nodes (BloomUpdates)


psdata

protected final PSData psdata
the correct PSData to be adding this share to

Constructor Detail

AbstractShareTask

public AbstractShareTask(PSData psdata,
                         LDAPCommunicator ldap_comm)
Constructor for AbstractShareTask, only takes an LDAPCommunicator reference

Parameters:
psdata - the correct psdata which will have its shares modified
ldap_comm - a reference to an LDAP communicator used for sending BloomUpdates
Method Detail

run

public abstract void run()
This override run() in Runnable and requires implementing subclasses to define a run/execution method

Specified by:
run in interface java.lang.Runnable

rebuildBloom

protected BloomUpdate rebuildBloom(java.util.Map all_psdatas)
Time-intensive method to rebuild a BloomFilter from scratch with all PSDatas on the MDS node. This is necessary because *theoretically* Bloom Filters cannot handle removes (entries share data-points)

Parameters:
all_psdatas - the Map of all psdatas

updateBloom

protected BloomUpdate updateBloom(AbstractShare new_share)
Method to update the local BloomFilter with the new added share. Destructively modifies the static Bloomfilter and return the BloomUpdate signifying the change

Parameters:
new_share - the abstract share which is to be added to this bloomfilter

sendUpdateToAll

protected void sendUpdateToAll(BloomUpdate update)
Method to send a BloomUpdate to all other MDS Nodes by contacting LDAP for a listing

Parameters:
update - the BloomUpdate object which is to be sent to all

sendCompleteUpdate

protected void sendCompleteUpdate()
Method to send a BloomUpdate which represents a complete BloomFilter to all nodes This complete bloom filter is sent after N many updates to compensate for the error of normal BloomUpdates