osaf/services/saf/amf/amfd/include/sg.h | 19 +++++++++++++++++--
osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 27 +--------------------------
osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 27 +--------------------------
osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 27 +--------------------------
osaf/services/saf/amf/amfd/sg_nway_fsm.cc | 24 +-----------------------
osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 27 +--------------------------
6 files changed, 22 insertions(+), 129 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/include/sg.h
b/osaf/services/saf/amf/amfd/include/sg.h
--- a/osaf/services/saf/amf/amfd/include/sg.h
+++ b/osaf/services/saf/amf/amfd/include/sg.h
@@ -215,8 +215,18 @@ public:
*/
virtual void node_fail(AVD_CL_CB *cb, AVD_SU *su) = 0;
- // Handle SG realign
- uint32_t (*realign)(AVD_CL_CB *cb, AVD_SG *sg);
+ /**
+ * Handle SG realign
+ * Assign SIs if needed. If any assigning is gets done it adds
+ * the SUs to the operation list and sets the SG FSM state to SG
realign.
+ * If everything is fine, it calls the routine to bring the preferred
+ * number of SUs to inservice state and change the SG state to stable.
+ *
+ * @param cb
+ * @param sg
+ * @return
+ */
+ virtual uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg) = 0;
// Handle new SI or admin op UNLOCK of SI
uint32_t (*si_func)(AVD_CL_CB *cb, struct avd_si_tag *si);
@@ -263,6 +273,7 @@ class SG_2N : public AVD_SG {
public:
~SG_2N();
void node_fail(AVD_CL_CB*, AVD_SU*);
+ uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg);
};
/**
@@ -272,6 +283,7 @@ class SG_NORED : public AVD_SG {
public:
~SG_NORED();
void node_fail(AVD_CL_CB*, AVD_SU*);
+ uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg);
};
/**
@@ -281,6 +293,7 @@ class SG_NPM : public AVD_SG {
public:
~SG_NPM();
void node_fail(AVD_CL_CB*, AVD_SU*);
+ uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg);
};
/**
@@ -290,6 +303,7 @@ class SG_NACV : public AVD_SG {
public:
~SG_NACV();
void node_fail(AVD_CL_CB*, AVD_SU*);
+ uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg);
};
/**
@@ -299,6 +313,7 @@ class SG_NWAY : public AVD_SG {
public:
~SG_NWAY();
void node_fail(AVD_CL_CB*, AVD_SU*);
+ uint32_t realign(AVD_CL_CB *cb, AVD_SG *sg);
};
diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
@@ -2912,31 +2912,7 @@ done:
return rc;
}
- /*****************************************************************************
- * Function: avd_sg_2n_realign_func
- *
- * Purpose: This function will call the chose assign function to check and
- * assign SIs. If any assigning is being done it adds the SU to the operation
- * list and sets the SG FSM state to SG realign. It resets the
ncsSGAdjustState.
- * If everything is
- * fine, it calls the routine to bring the preffered number of SUs to
- * inservice state and change the SG state to stable. The functionality is
- * described in the SG FSM. The same function is used for both cluster_timer
and
- * and sg_operator events as described in the SG FSM.
- *
- * Input: cb - the AVD control block
- * sg - The pointer to the service group.
- *
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * NOTES: none.
- *
- *
- **************************************************************************/
-
-uint32_t avd_sg_2n_realign_func(AVD_CL_CB *cb, AVD_SG *sg)
-{
+uint32_t SG_2N::realign(AVD_CL_CB *cb, AVD_SG *sg) {
AVD_SU *l_su;
TRACE_ENTER2("'%s'", sg->name.value);
@@ -4155,7 +4131,6 @@ AVD_SU *get_other_su_from_oper_list(AVD_
*/
void avd_sg_2n_init(AVD_SG *sg)
{
- sg->realign = avd_sg_2n_realign_func;
sg->si_func = avd_sg_2n_si_func;
sg->si_admin_down = avd_sg_2n_si_admin_down;
sg->si_swap = avd_sg_2n_siswap_func;
diff --git a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
@@ -894,31 +894,7 @@ uint32_t avd_sg_nored_susi_fail_func(AVD
}
- /*****************************************************************************
- * Function: avd_sg_nored_realign_func
- *
- * Purpose: This function will call the chose assign function to check and
- * assign SIs. If any assigning is being done it adds the SUs to the operation
- * list and sets the SG FSM state to SG realign. It resets the
ncsSGAdjustState.
- * If everything is
- * fine, it calls the routine to bring the preffered number of SUs to
- * inservice state and change the SG state to stable. The functionality is
- * described in the SG FSM. The same function is used for both cluster_timer
and
- * and sg_operator events as described in the SG FSM.
- *
- * Input: cb - the AVD control block
- * sg - The pointer to the service group.
- *
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * NOTES: none.
- *
- *
- **************************************************************************/
-
-uint32_t avd_sg_nored_realign_func(AVD_CL_CB *cb, AVD_SG *sg)
-{
+uint32_t SG_NORED::realign(AVD_CL_CB *cb, AVD_SG *sg) {
TRACE_ENTER2("'%s'", sg->name.value);
/* If the SG FSM state is not stable just return success. */
@@ -1422,7 +1398,6 @@ uint32_t avd_sg_nored_sg_admin_down(AVD_
*/
void avd_sg_nored_init(AVD_SG *sg)
{
- sg->realign = avd_sg_nored_realign_func;
sg->si_func = avd_sg_nored_si_func;
sg->si_admin_down = avd_sg_nored_si_admin_down;
sg->sg_admin_down = avd_sg_nored_sg_admin_down;
diff --git a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
@@ -3225,31 +3225,7 @@ uint32_t avd_sg_npm_susi_fail_func(AVD_C
}
- /*****************************************************************************
- * Function: avd_sg_npm_realign_func
- *
- * Purpose: This function will call the chose assign function to check and
- * assign SIs. If any assigning is being done it adds the SU to the operation
- * list and sets the SG FSM state to SG realign. It resets the
ncsSGAdjustState.
- * If everything is
- * fine, it calls the routine to bring the preffered number of SUs to
- * inservice state and change the SG state to stable. The functionality is
- * described in the SG FSM. The same function is used for both cluster_timer
and
- * and sg_operator events as described in the SG FSM.
- *
- * Input: cb - the AVD control block
- * sg - The pointer to the service group.
- *
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * NOTES: none.
- *
- *
- **************************************************************************/
-
-uint32_t avd_sg_npm_realign_func(AVD_CL_CB *cb, AVD_SG *sg)
-{
+uint32_t SG_NPM::realign(AVD_CL_CB *cb, AVD_SG *sg) {
TRACE_ENTER2("'%s'", sg->name.value);
/* If the SG FSM state is not stable just return success. */
@@ -4602,7 +4578,6 @@ uint32_t avd_sg_npm_sg_admin_down(AVD_CL
*/
void avd_sg_npm_init(AVD_SG *sg)
{
- sg->realign = avd_sg_npm_realign_func;
sg->si_func = avd_sg_npm_si_func;
sg->si_admin_down = avd_sg_npm_si_admin_down;
sg->sg_admin_down = avd_sg_npm_sg_admin_down;
diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
@@ -543,28 +543,7 @@ done:
return rc;
}
- /*****************************************************************************
- * Function: avd_sg_nway_realign_func
- *
- * Purpose: This function will call the chose assign function to check and
- * assign SIs. If any assigning is being done it adds the SU to the operation
- * list and sets the SG FSM state to SG realign. It resets the
ncsSGAdjustState.
- * If everything is
- * fine, it calls the routine to bring the preffered number of SUs to
- * inservice state and change the SG state to stable. The functionality is
- * described in the SG FSM. The same function is used for both cluster_timer
and
- * and sg_operator events as described in the SG FSM.
- *
- * Input: cb - the AVD control block
- * sg - The pointer to the service group.
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * Notes: none.
- *
- **************************************************************************/
-uint32_t avd_sg_nway_realign_func(AVD_CL_CB *cb, AVD_SG *sg)
-{
+uint32_t SG_NWAY::realign(AVD_CL_CB *cb, AVD_SG *sg) {
TRACE_ENTER2("'%s'", sg->name.value);
/* If the SG FSM state is not stable just return success. */
@@ -3667,7 +3646,6 @@ void avd_sg_nway_node_fail_sg_realign(AV
*/
void avd_sg_nway_init(AVD_SG *sg)
{
- sg->realign = avd_sg_nway_realign_func;
sg->si_func = avd_sg_nway_si_func;
sg->si_admin_down = avd_sg_nway_si_admin_down;
sg->sg_admin_down = avd_sg_nway_sg_admin_down;
diff --git a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
@@ -1322,31 +1322,7 @@ uint32_t avd_sg_nacvred_susi_fail_func(A
}
- /*****************************************************************************
- * Function: avd_sg_nacvred_realign_func
- *
- * Purpose: This function will call the chose assign function to check and
- * assign SIs. If any assigning is being done it adds the SUs to the operation
- * list and sets the SG FSM state to SG realign. It resets the
ncsSGAdjustState.
- * If everything is
- * fine, it calls the routine to bring the preffered number of SUs to
- * inservice state and change the SG state to stable. The functionality is
- * described in the SG FSM. The same function is used for both cluster_timer
and
- * and sg_operator events as described in the SG FSM.
- *
- * Input: cb - the AVD control block
- * sg - The pointer to the service group.
- *
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * NOTES: none.
- *
- *
- **************************************************************************/
-
-uint32_t avd_sg_nacvred_realign_func(AVD_CL_CB *cb, AVD_SG *sg)
-{
+uint32_t SG_NACV::realign(AVD_CL_CB *cb, AVD_SG *sg) {
TRACE_ENTER2("'%s'", sg->name.value);
/* If the SG FSM state is not stable just return success. */
@@ -2143,7 +2119,6 @@ done:
*/
void avd_sg_nacv_init(AVD_SG *sg)
{
- sg->realign = avd_sg_nacvred_realign_func;
sg->si_func = avd_sg_nacvred_si_func;
sg->si_admin_down = avd_sg_nacvred_si_admin_down;
sg->sg_admin_down = avd_sg_nacvred_sg_admin_down;
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel