Skip to main content

Action

Actions for the C++ Replication API

Abstract

An action can be pushed from the central point of control (<FC_PROD_REPLICATIOM_MGR>) to any node in the Site and executed by that node.

The FairCom replication environment is a distributed system with centralized control. An action can be pushed from the central point of control (<FC_PROD_REPLICATIOM_MGR>) to any node in the Site and executed by that node.

Action table types

Table 1. Non-FairCom actions

Symbolic

Code

Description

FCREPL_ADD

0

File add

FCREPL_DELETE

1

File remove

FCREPL_CHANGE

2

File change

FCREPL_REPL_HEARTBEAT_TARGET

3

Replication Agent heartbeat target



Table 2. FairCom actions

Symbolic

Code

Description

FCREPL_CTREE_START

100

FairCom replication start

FCREPL_CTREE_STOP

101

FairCom replication stop

FCREPL_CTREE_DUMPFILES

102

FairCom dynamic dump files

FCREPL_CTREE_CANCEL

103

Cancel replication plan deployment

FCREPL_CTREE_START_MONITOR

104

Start replication monitoring

FCREPL_CTREE_STOP_MONITOR

105

Stop replication monitoring

FCREPL_CTREE_START_EXCEPLOG

106

Start replication exception log

FCREPL_CTREE_STOP_EXCEPLOG

107

Stop replication exception log

FCREPL_CTREE_START_FUNCTIME

108

Start replication function timing collection

FCREPL_CTREE_STOP_FUNCTIME

109

Stop replication function timing collection

FCREPL_CTREE_RESET_FUNCTIME

110

Reset replication function timing collection

FCREPL_CTREE_GET_FUNCTIME

111

Get replication function times

FCREPL_CTREE_PAUSE

112

Pause replication

FCREPL_CTREE_RESUME

113

Resume replication

FCREPL_CTREE_RESYNC

114

Resync files

FCREPL_CTREE_HEARTBEAT

115

Replication agent heartbeat



Table 3. FileSystem Sync actions

Symbolic

Code

Description

FCREPL_FS_ADD

200

Filesystem add

FCREPL_FS_DELETE

201

Filesystem remove

FCREPL_FS_CHANGE

202

Filesystem change



Table 4. FileSystem actions

Symbolic

Code

Description

FCREPL_FS_SCAN

300

Filesystem scan

FCREPL_FS_LOAD

301

Temporary filesystem load

FCREPL_FS_CHECK_DBENGINE

302

Check DBEngine changes

FCREPL_FS_SCAN_FOLDER

303

Filesystem scan folder

FCREPL_FS_SCAN_REPLAGENT

304

Scan for the Replication Agent

FCREPL_FS_IMPORT_REPLAGENT

305

Import the Replication Agent



Table 5. Basic replication actions

Symbolic

Code

Description

FCREPL_REPL_DEPLOY

400

Deploy replication plan

FCREPL_REPL_START

401

Start replication plan

FCREPL_REPL_STOP

402

Stop replication plan

FCREPL_REPL_REG

403

Register consumer for replication plan

FCREPL_REPL_REG_SOURCE

404

Register consumer in source OS for non-ctree replication

FCREPL_REPL_UNREG

405

Unregister consumer for replication plan

FCREPL_REPL_HEARTBEAT

406

Replication agent heartbeat basic

FCREPL_REPL_START_MONITOR

407

Start replication monitoring

FCREPL_REPL_STOP_MONITOR

408

Stop replication monitoring

FCREPL_REPL_START_EXCEPLOG

409

Start replication exception log

FCREPL_REPL_STOP_EXCEPLOG

410

Stop replication exception log

FCREPL_REPL_START_FUNCTIME

411

Start replication function timing collection

FCREPL_REPL_STOP_FUNCTIME

412

Stop replication function timing collection

FCREPL_REPL_RESET_FUNCTIME

413

Reset replication function timing collection

FCREPL_REPL_GET_FUNCTIME

414

Get replication function times

FCREPL_REPL_PAUSE

415

Pause replication

FCREPL_REPL_RESUME

416

Resume replication

FCREPL_REPL_SETTRACE

417

Set trace

FCREPL_UNKNOWN

500

Unknown action



Table 6. Entity type table

Type

Code

FCREPL_NONE

-1

FCREPL_SITE

0

FCREPL_HARDWARE

1

FCREPL_OPSYSTEM

2

FCREPL_VOLUME

3

FCREPL_FILE

4

FCREPL_DBENGINE_ENT

5

FCREPL_SUBSCRIPTION_ENT

6

FCREPL_REPLPLAN_ENT

7



Table 7. Consumer table

Symbolic

Code

Description

FCREPL_DEFAULT

-2

Default consumer

FCREPL_UNDEF

-1

Undefined consumer

FCREPL_FILESYSTEM

0

General Filesystem action consumer

FCREPL_FILESYSTEM_SYNC

1

Filesystem sync action consumer

FCREPL_REPL

2

General replication plan consumer

FCREPL_REPL_CTREE

3

FairCom replication action consumer



Class

FCREPLAction

The Replication Manager has a distributed management based on action objects pushed, consumed, and checked to/from a central queue (ACTION table in the Replication Manager).

Note

Do not manually create or change any of these objects because they are managed internally. You can look at the values of these objects but do not change them.

Getters

Table 8. Getters

Action type

FCREPLActionType GetActionType();

Entity type related to the action: DBEngine, ReplPlan, and so forth

FCREPLEntityType GetEntityType();

Consumer type to process this action

FCREPLConsumerType GetConsumerType();



Inherited getters

Table 9. Inherited getters

Action identification

int GetActionID();

Parent action identification - action process which generated the current one

Note

This is used for providing an action hierarchy.

int GetParentActionID();

Owner action identification - an action that groups a list of sub-actions.

Note

The progress of the owner action depends on the whole group's progress.

int GetOwnerActionID();

List of action parameters

pFCParamHash GetParams();

Action description

const char *GetDescription();

Action type

RCESActionType GetAction();

Entity type

RCESEntityType GetEntity();

Entity identification related to the action (DBEngine ID, ReplPlan ID, and so forth)

int GetEntityPK();

Action type string

const char *GetActionStr();

Time to wait before action can start being processed

int GetWaitSecs();

File volume ID

int GetFileVolumeID();

File path

const char *GetFilePath();

File name

const char *GetFileName();

Current action progress

int GetProgress();

JSON action information

pRCESJson GetJson();

Action error code

int GetErrorCode();

Action error message

int GetErrorCode();

Agent identification that is processing or processed the action

Note

This is linked to FCREPLAgent class.

int GetAgentID();

replication plan identification when the action is specific for a replication plan.

Note

This is linked to FCREPLReplPlan class.

int GetReplPlanID();

Consumer type

RCESConsumerType GetConsumer();

Action content length

int GetContentLen();

Action content

void *GetContent();

The factor of the action progress to impact the owner action — for example, this action can represent 20% of the owner action progress

double GetFactor();



Inherited setters

Table 10. Inherited setters

Action ID

SetActionID(int actionID);

Time processed

SetTimeProcessed(RCESDateTime timeProcessed);

Error code

SetErrorCode(int errorCode);

Error message

SetErrorMessage(const char *errorMessage);

Action type

SetActionTime(RCESDateTime actionTime);

Progress

SetProgress(int progress);

Entity type

SetEntityType(RCESEntityType entityType);

Entity PK

SetEntityPK(int entityPK);

Owner action ID

SetOwnerActionID(int ownerActionID);

Agent ID

SetAgentID(int agentID);

Content string

SetContent(void *content, int contentLen);

Factor

SetFactor(double factor);

Action type

SetAction(RCESActionType actionType);



The current status will show a given action identification.

Prototype

FCREPL_API int fcReplCheckAction(pFCREPLConn replConn, int actionID, bool checkGroup, ppFCREPLAction action);

Parameters

Table 11. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

actionID [IN]

Action identification

checkGroup [IN]

Flag indicating if the child actions should also be checked

action [OUT]

Action entity object with the status updated



Returns

Error code

Cancel a given action execution.

Prototype

FCREPL_API int fcReplCancelAction(pFCREPLConn replConn, int actionID, bool checkGroup);

Parameters

Table 12. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

actionID [IN]

Action identification

checkGroup [IN]

Flag indicating if the child actions should also be cancelled



Returns

Error code

Archive the Action events that happened before a given number of days.

Prototype

FCREPL_API int fcArchiveAction(pFCREPLConn replConn, int daysToArchive);

Parameters

Table 13. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

daysToArchive [IN]

Number of days to keep active



Returns

Error code