# Module dc_clustering

- Description
- Data Types
- Function Index
- Function Details

Re-register with boot nodes.

Copyright © 2007-2015 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_component`.

Authors: Thorsten Schuett (`schuett@zib.de`), Marie Hoffmann (`hoffmann@zib.de`).

References

- T. Schuett, A. Reinefeld,F. Schintke, M. Hoffmann. Gossip-based Topology Inference for Efficient Overlay Mapping on Data Centers. 9th Int. Conf. on Peer-to-Peer Computing Seattle, Sept. 2009.

## Description

Re-register with boot nodes

## Data Types

### message()

    message() =
        {dc_trigger} |
        {dc_reset_trigger} |
        {start_clustering_shuffle} |
        {reset_clustering} |
        {vivaldi_get_coordinate_response,
         gossip_vivaldi:network_coordinate(),
         gossip_vivaldi:est_error()} |
        {cy_cache, [node:node_type()]} |
        {clustering_shuffle,
         comm:mypid(),
         dc_centroids:centroids(),
         non_neg_integer()} |
        {clustering_shuffle_reply,
         comm:mypid(),
         dc_centroids:centroids(),
         non_neg_integer()} |
        {query_clustering, comm:mypid()} |
        {query_epoch, comm:mypid()} |
        {query_my, atom(), comm:mypid()}

### state_active()

    state_active() =
        #state_active{centroids = dc_centroids:centroids(),
                      local_epoch = non_neg_integer(),
                      radius = undefined | float()}

### state_inactive()

    state_inactive() =
        #state_inactive{queued_messages =
                            undefined | msg_queue:msg_queue(),
                        radius = undefined | float()}

-type(state() :: state_active() | state_inactive()).

## Function Index

activate/0 | Sends an initialization message to the node's dc_clustering process.
check_config/0 | Checks whether config parameters exist and are valid.
deactivate/0 | Deactivates the clustering process.
init/1 | Initialises the module with an empty state.
on_active/2 | Message handler when the module is fully initialized.
on_inactive/2 | Message handler during start up phase (will change to on_active/2 when a 'activate_clustering' message is received).
start_gen_component/5 |
start_link/1 | Starts the dc_clustering process, registers it with the process dictionary and returns its pid for use by a supervisor.

## Function Details

### start_gen_component/5

    start_gen_component(Module :: module(),
                        Handler :: gen_component:handler(),
                        Args :: term(),
                        Options :: [gen_component:option()],
                        Self :: pid()) ->
                           no_return() | ok

### activate/0

    activate() -> ok | ignore

Sends an initialization message to the node's dc_clustering process.

### deactivate/0

    deactivate() -> ok | ignore

Deactivates the clustering process.

### start_link/1

    start_link(DHTNodeGroup :: pid_groups:groupname()) ->
                  {ok, pid()} | ignore

Starts the dc_clustering process, registers it with the process dictionary and returns its pid for use by a supervisor.

### init/1

    init(X1 :: []) -> state_inactive()

Initialises the module with an empty state.

### on_inactive/2

    on_inactive(Msg :: message(), State_inactive :: state_inactive()) ->
                   state_inactive()

Message handler during start up phase (will change to on_active/2 when a 'activate_clustering' message is received).

### on_active/2

    on_active(Message :: message(), State :: state_active()) ->
                 state_active()

Message handler when the module is fully initialized.

### check_config/0

    check_config() -> boolean()

Checks whether config parameters exist and are valid.

Generated by EDoc, Apr 22 2017, 15:58:25.