ch.nix.ert.keypartition
Class KeyPartitionManager

java.lang.Object
  extended bych.nix.ert.keypartition.KeyPartitionManager

public class KeyPartitionManager
extends java.lang.Object

TODO Has to check, if this node is responsible for the requested key (by looking at all his key-partitions) and otherwise has to forward the request to the corresponding node

Author:
michi

Field Summary
protected  boolean isJoining
           
 
Method Summary
 void add(KeyPartition keyPartition)
           
 DataItem calculateMigrationData(double remoteLoad, boolean uplinkNode)
          Calculates the KeyRange to migrate
 void delete(DataItem data)
           
 void get(DataItem data)
           
 KeyPartition getFirst()
           
static KeyPartitionManager getInstance()
           
 KeyPartition getLast()
           
 void isFirstNodeOnNetwork()
          This method should be only called for the first node in the whole network.
 void joinOnNetwork()
           
 double nodeLoad()
          gives back the load of this current node: takes into account the amount of items stored in db and later also CPU load, throughput of requests, ...
 void put(DataItem data)
           
 void register(KeyPartition newKeyPartition)
           
 KeyPartition responsible(DataItem dataItem)
           
 KeyPartition responsible(InternalKey internalKey)
           
 KeyPartition substract(KeyPartition keyPartition)
           
 java.lang.String toString()
           
 void unregister(KeyPartition oldKeyPartition)
           
protected  void updatedbSize(int size)
           
protected  void updateStatistic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isJoining

protected boolean isJoining
Method Detail

getInstance

public static KeyPartitionManager getInstance()

register

public void register(KeyPartition newKeyPartition)

unregister

public void unregister(KeyPartition oldKeyPartition)

responsible

public KeyPartition responsible(DataItem dataItem)

responsible

public KeyPartition responsible(InternalKey internalKey)

substract

public KeyPartition substract(KeyPartition keyPartition)
Parameters:
keyPartition -
Returns:
the cutoff part of this KeyPartition, null if nothing could be cut off

add

public void add(KeyPartition keyPartition)

getFirst

public KeyPartition getFirst()

getLast

public KeyPartition getLast()

get

public void get(DataItem data)

put

public void put(DataItem data)

delete

public void delete(DataItem data)

isFirstNodeOnNetwork

public void isFirstNodeOnNetwork()
This method should be only called for the first node in the whole network. All other nodes should use the "join" method to actually join the ert-network


joinOnNetwork

public void joinOnNetwork()

nodeLoad

public double nodeLoad()
gives back the load of this current node: takes into account the amount of items stored in db and later also CPU load, throughput of requests, ...

Returns:
value between 0-1 (0 = idle, 1 = on system limit, >1 = heavily overloaded)

calculateMigrationData

public DataItem calculateMigrationData(double remoteLoad,
                                       boolean uplinkNode)
Calculates the KeyRange to migrate

Parameters:
remoteLoad - the load of the other node, which wants to have some data from this node
uplinkNode - if true, the node who requests the migration is the uplinkNode, if false it is the downlonkNode
Returns:
The DataItem with parameter "migrationCutPointLow" and "migrationCutPointHigh" of the keygroups to migrate

updatedbSize

protected void updatedbSize(int size)

updateStatistic

protected void updateStatistic()

toString

public java.lang.String toString()


Copyright © 2004 Michael Kussmaul - Revision: 183 - Date: 2004-11-16T15:42:13.763853Z