Class skydata::internal::agents::SKD¶
ClassList > skydata > internal > agents > SKD
Inherits the following classes: skydata::internal::agents::SKAgent
Public Attributes¶
| Type | Name |
|---|---|
| Set< SKAID > | crashedFamilyMembers = new HashSet<>() |
| Set< SKAID > | deletedFamilyMembers = new HashSet<>() |
| int | lastReplicateIndex = 0 |
Public Attributes inherited from skydata::internal::agents::SKAgent¶
See skydata::internal::agents::SKAgent
| Type | Name |
|---|---|
| Map< String, Object > | args = null |
| Boolean | inDebug = false |
| int | size |
| long | startingDate = 0 |
Public Functions¶
| Type | Name |
|---|---|
| SKD () |
|
| void | addFamily (SKAID aid) |
| void | afterClone () |
| void | afterMove () |
| void | blockReplicate () |
| void | broadcastFamily (SKLMessage message, Boolean sendReliably) |
| void | broadcastFamily (SKLMessage message) |
| boolean | canReplicate () |
| void | clone (AID harbour, String name) |
| Map< SKAID, LocalDateTime > | createLastReceived (Set< SKAID > family) |
| void | doClone (Location loc, String newName) |
| Set< SKAID > | getDeletedFamilyMembers () |
| Set< SKAID > | getFamily () |
| Set< SKAID > | getFamilySameHarbour () |
| int | getFamilySize () |
| String | getFamilyString () |
| void | mergeWithDeletedFamilyMembers (Set< SKAID > agents) |
| void | mergeWithFamily (Set< SKAID > agents) |
| void | removeFromFamily (SKAID aid) |
| void | removeFromFamily (Set< SKAID > aids) |
| SKLMessage | skReceive (MessageTemplate mt) |
| void | suspectMemberFamily (SKAID suspected, LocalDateTime date) |
| void | unblockReplicate () |
| void | unsuspectMemberFamily (SKAID unsuspected) |
| void | updatePositionFamily (SKAID m) |
Public Functions inherited from skydata::internal::agents::SKAgent¶
See skydata::internal::agents::SKAgent
| Type | Name |
|---|---|
| void | addBehaviour (Behaviour wakerBehaviour) |
| final void | addInternalUpdate (String type, SKAgentBehaviour b) |
| void | afterClone () |
| void | afterMove () |
| void | blockMigrate () |
| void | broadcast (BroadcastI broadCaster, SKLMessage message, Set< SKAID > agents) |
| boolean | canMigrate () |
| Set< SKAID > | connectedHarbours () |
| final void | createStorageObject (String property, Serializable value) |
| void | debug (String s) |
| void | delete () |
| void | doClone (Location loc, String newName) |
| void | doMove (Location loc) |
| HashMap< SKAID, HashMap< String, Comparable > > | getHarboursStats () |
| HashMap< String, HashMap< String, SKLMessage > > | getMsgInfoBF () |
| final SKAID | getRealSKAID () |
| HashMap< String, HashMap< String, Long > > | getReceivedMsgs () |
| final SKAID | getSKAID () |
| long | getStartingDate () |
| final Serializable | getStorageObject (String property) |
| final boolean | hasStorageObject (String property) |
| void | migrate (AID harbour) |
| void | migrate (AID harbour, boolean forced) |
| SKAID | myHarbour () |
| void | print (String s) |
| void | setMsgInfoBF (HashMap< String, HashMap< String, SKLMessage > > inf) |
| SKLMessage | skReceive (MessageTemplate mt) |
| void | skSendNormal (SKLMessage msg) |
| void | skSendReliable (SKLMessage msg) |
| void | unblockMigrate () |
Protected Attributes¶
| Type | Name |
|---|---|
| Set< SKAID > | family = new HashSet<>() |
| int | nbBlockingReplicate = 0 |
| HashMap< SKAID, LocalDateTime > | suspectedFamily = new HashMap<>() |
Protected Attributes inherited from skydata::internal::agents::SKAgent¶
See skydata::internal::agents::SKAgent
| Type | Name |
|---|---|
| Set< SKAID > | harbours |
| HashMap< SKAID, HashMap< String, Comparable > > | harboursStats = new HashMap<SKAID, HashMap<String, Comparable>>() |
| Boolean | inMigration |
| Set< SKAID > | membersHarbour = new HashSet<SKAID>() |
| SKAID | myAID |
| int | nbBlockingMigrate = 0 |
Protected Functions¶
| Type | Name |
|---|---|
| String | getNextReplicateIndex () |
| void | reset () |
| void | setup () |
| void | setupFamily () |
Protected Functions inherited from skydata::internal::agents::SKAgent¶
See skydata::internal::agents::SKAgent
| Type | Name |
|---|---|
| void | beforeMove () |
| final void | internalUpdate (String type, Object o) |
| final void | internalUpdate (String type) |
| void | reset () |
| void | run (String action) |
| void | setup () |
| void | setupStats () |
Detailed Description¶
This class represent a SKD.
A SKD is composed by : * A family (groups of replicas) * Data and metadata
A SKD can also decide to replicate itself.
Public Attributes Documentation¶
variable crashedFamilyMembers¶
Set<SKAID> skydata.internal.agents.SKD.crashedFamilyMembers;
List of family members detected as failed
variable deletedFamilyMembers¶
Set<SKAID> skydata.internal.agents.SKD.deletedFamilyMembers;
List of family members which are delete themselves
variable lastReplicateIndex¶
int skydata.internal.agents.SKD.lastReplicateIndex;
The last index of its replicas
Public Functions Documentation¶
function SKD¶
inline skydata::internal::agents::SKD::SKD ()
Construct a new SKD
function addFamily¶
inline void skydata::internal::agents::SKD::addFamily (
SKAID aid
)
Add a SKD to the family
Parameters:
aid: the new family member
function afterClone¶
inline void skydata::internal::agents::SKD::afterClone ()
Function called after a completed replication
Implements skydata::internal::agents::SKAgent::afterClone
function afterMove¶
inline void skydata::internal::agents::SKD::afterMove ()
Function called after a completed migration
Implements skydata::internal::agents::SKAgent::afterMove
function blockReplicate¶
inline void skydata::internal::agents::SKD::blockReplicate ()
Block temporarily the replication of the SKD
function broadcastFamily [1/2]¶
inline void skydata::internal::agents::SKD::broadcastFamily (
SKLMessage message,
Boolean sendReliably
)
Broadcast a message to all family members
Parameters:
message: the message to sendsendReliably: true if the message must be send reliably, else false
function broadcastFamily [2/2]¶
inline void skydata::internal::agents::SKD::broadcastFamily (
SKLMessage message
)
Broadcast reliably a message to all family members
Parameters:
message: the message to send
function canReplicate¶
inline boolean skydata::internal::agents::SKD::canReplicate ()
Check if the SKD can replicate
Returns:
true if the SKD can replicate, else false
function clone¶
inline void skydata::internal::agents::SKD::clone (
AID harbour,
String name
)
Function to call to initiate a replication on a target harbour
Parameters:
harbour: the target harbourname: the name of the replicas
function createLastReceived¶
inline Map< SKAID, LocalDateTime > skydata::internal::agents::SKD::createLastReceived (
Set< SKAID > family
)
Initialize the received heartbeat
Parameters:
family: current family members
Returns:
the list of latest received heartbeat
function doClone¶
inline void skydata::internal::agents::SKD::doClone (
Location loc,
String newName
)
Function called when the replication starts
Implements skydata::internal::agents::SKAgent::doClone
function getDeletedFamilyMembers¶
inline Set< SKAID > skydata::internal::agents::SKD::getDeletedFamilyMembers ()
Get the list of deleted family members
Returns:
the deleted members
function getFamily¶
inline Set< SKAID > skydata::internal::agents::SKD::getFamily ()
Get the list of family members
Returns:
the current members
function getFamilySameHarbour¶
inline Set< SKAID > skydata::internal::agents::SKD::getFamilySameHarbour ()
Get the list of family members on the same Harbour
Returns:
a list of SKD
function getFamilySize¶
inline int skydata::internal::agents::SKD::getFamilySize ()
Get the number of family members
Returns:
the size of the family
function getFamilyString¶
inline String skydata::internal::agents::SKD::getFamilyString ()
Get the string representation of a family
Example : [(LULU@Harbour : http://example.fr:8000), (LULU.1@Harbour : http://example2.fr:8000)]
Returns:
the string representation
function mergeWithDeletedFamilyMembers¶
inline void skydata::internal::agents::SKD::mergeWithDeletedFamilyMembers (
Set< SKAID > agents
)
Merge two sets of agents to store the deleted members
Parameters:
agents: the set to merge
function mergeWithFamily¶
inline void skydata::internal::agents::SKD::mergeWithFamily (
Set< SKAID > agents
)
Merge two sets of agents and update the position if needed
Parameters:
agents: the set to merge
function removeFromFamily [1/2]¶
inline void skydata::internal::agents::SKD::removeFromFamily (
SKAID aid
)
Remove a SKD from the family
Parameters:
aid: the SKD to remove
function removeFromFamily [2/2]¶
inline void skydata::internal::agents::SKD::removeFromFamily (
Set< SKAID > aids
)
Remove a list of SKD from the family
Parameters:
aids: the list to remove
function skReceive¶
inline SKLMessage skydata::internal::agents::SKD::skReceive (
MessageTemplate mt
)
Function to call to receive a message according a template
Parameters:
mt: the template that the message must match
Returns:
a message or null
Implements skydata::internal::agents::SKAgent::skReceive
function suspectMemberFamily¶
inline void skydata::internal::agents::SKD::suspectMemberFamily (
SKAID suspected,
LocalDateTime date
)
Function to call to suspect a family member of failure
Parameters:
suspected: the suspected family memberdate: the date of the suspicion
function unblockReplicate¶
inline void skydata::internal::agents::SKD::unblockReplicate ()
Unblock the replication of the SKD
function unsuspectMemberFamily¶
inline void skydata::internal::agents::SKD::unsuspectMemberFamily (
SKAID unsuspected
)
Function to call to unsuspect a family member of failure
Parameters:
unsuspected: the unsuspected family member
function updatePositionFamily¶
inline void skydata::internal::agents::SKD::updatePositionFamily (
SKAID m
)
Update the position of a family member
Parameters:
m: the family with its new address
Protected Attributes Documentation¶
variable family¶
Set<SKAID> skydata.internal.agents.SKD.family;
List of family members
variable nbBlockingReplicate¶
int skydata.internal.agents.SKD.nbBlockingReplicate;
If this value is greater than 0 then the SKD cannot replicate
variable suspectedFamily¶
HashMap<SKAID, LocalDateTime> skydata.internal.agents.SKD.suspectedFamily;
List of family members suspected as failed
Protected Functions Documentation¶
function getNextReplicateIndex¶
inline String skydata::internal::agents::SKD::getNextReplicateIndex ()
Return the next replication index
function reset¶
inline void skydata::internal::agents::SKD::reset ()
Reset a SKD
Implements skydata::internal::agents::SKAgent::reset
function setup¶
inline void skydata::internal::agents::SKD::setup ()
Initialize a SKD
Implements skydata::internal::agents::SKAgent::setup
function setupFamily¶
inline void skydata::internal::agents::SKD::setupFamily ()
Setup the family member management
The documentation for this class was generated from the following file /home/maxime/Desktop/SkyDSoft/skd/src/main/java/skydata/internal/agents/SKD.java