Loading...
Searching...
No Matches
DataDistributionManager.h
Go to the documentation of this file.
1/*
2* Copyright 2023 MASES s.r.l.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*
16* Refer to LICENSE for more information.
17*/
18
19#if !defined(DATADISTRIBUTIONMANAGER_H__INCLUDED_)
20#define DATADISTRIBUTIONMANAGER_H__INCLUDED_
21
22#if _MSC_VER > 1000
23#pragma once
24#endif // _MSC_VER > 1000
25
40#include <string>
41#include <map>
45
58typedef const char *(FUNCALL *dataDistributionConfigurationCb)(const void *opaque, const char *channelName, const char *key, const char *value);
73typedef void(FUNCALL *dataDistributionLoggingCb)(const void *opaque, const DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr);
85typedef void(FUNCALL *dataDistributionCompletelyDisconnectedCb)(const void *opaque, const char *channelName, const char *reason);
86
99
100/* Forward declarations */
104
110class DDM_EXPORT ITimeMeasureWrapper
111{
112public:
119 virtual void ResetTime() = 0;
127 virtual int64_t ElapsedMilliseconds() = 0;
135 virtual int64_t ElapsedMicroseconds() = 0;
143 virtual int64_t ElapsedNanoseconds() = 0;
152 virtual void AddNanoseconds(unsigned int time) = 0;
153};
154
160class DDM_EXPORT TimeMeasureWrapper
161{
162public:
169};
170
176class DDM_EXPORT IDataDistributionLog
177{
178public:
188 virtual void Log(const DDM_LOG_LEVEL level, const char *sourceName, const char *function, const char *format, ...) = 0;
199 virtual void Log(const DDM_LOG_LEVEL level, const char *sourceName, const char *function, const char *format, va_list args) = 0;
200};
201
212{
213public:
222 virtual const char *OnConfiguration(const char *channelName, const char *key, const char *value) = 0;
235 virtual void OnLogging(DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr) = 0;
244 virtual void OnCompletelyDisconnected(const char *channelName, const char *reason) = 0;
245};
246
267
273typedef struct DDM_EXPORT UnderlyingEventData
274{
275 const char *ChannelName;
277 int64_t Offset;
278 int64_t Timestamp;
279 const char *Key;
280 size_t KeyLen;
281 const void *Buffer;
285 const char *SubSystemReason;
296 UnderlyingEventData(const char *channelName)
297 {
298 ChannelName = channelName;
299 Condition = DDM_NO_ERROR_CONDITION;
300 IsDataAvailable = FALSE;
301 Offset = -1;
302 Timestamp = -1;
303 Key = NULL;
304 KeyLen = 0;
305 Buffer = NULL;
306 BufferLength = 0;
307 NativeCode = 0;
308 SubSystemReason = NULL;
309 }
325 UnderlyingEventData(const char *channelName, const char *key, size_t keyLen, const void *buffer, size_t bufferLength, int64_t timestamp = -1, int64_t offset = -1) : UnderlyingEventData(channelName)
326 {
327 Offset = offset;
328 Timestamp = timestamp;
329 Key = key;
330 KeyLen = keyLen;
331 Buffer = buffer;
332 BufferLength = bufferLength;
333 IsDataAvailable = TRUE;
334 }
348 UnderlyingEventData(const char *channelName, OPERATION_RESULT condition, int nativeCode, const char *subSystemReason) : UnderlyingEventData(channelName)
349 {
350 Condition = condition;
351 NativeCode = nativeCode;
352 SubSystemReason = subSystemReason;
353 }
355
367typedef void(FUNCALL *dataDistributionUnderlyingEvent)(const void *opaque, const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent);
368
377{
378public:
386 virtual const char* GetChannelName() = 0;
395};
396
405{
406public:
416 virtual void OnUnderlyingEvent(const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent) = 0;
417};
418
425{
426public:
436};
437
450typedef void(FUNCALL *dataDistributionOnClusterStateChange)(void *opaque, DDM_CLUSTEREVENT change, int64_t serverid);
463typedef void(FUNCALL *dataDistributionOnStateChange)(void *opaque, DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState);
476typedef void(FUNCALL *dataDistributionOnStateReady)(void *opaque, void *pState, int64_t len);
489typedef void(FUNCALL *dataDistributionOnRequestedState)(void *opaque, void **pState, size_t *len);
502typedef void(FUNCALL *dataDistributionOnMultiplePrimary)(void *opaque, int64_t myId, int64_t otherId);
514typedef void(FUNCALL *dataDistributionFirstStateChange)(void *opaque, DDM_INSTANCE_STATE newState);
527typedef void(FUNCALL *dataDistributionChangingState)(void *opaque, DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState);
539typedef void(FUNCALL *dataDistributionChangedState)(void *opaque, DDM_INSTANCE_STATE actualState);
540
550{
551public:
561 virtual void OnClusterStateChange(DDM_CLUSTEREVENT change, int64_t serverid) = 0;
571 virtual void OnStateChange(DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState) = 0;
581 virtual void OnStateReady(void *pState, int64_t len) = 0;
591 virtual void OnRequestedState(void **pState, size_t *len) = 0;
601 virtual void OnMultiplePrimary(int64_t myId, int64_t otherId) = 0;
610 virtual void FirstStateChange(DDM_INSTANCE_STATE newState) = 0;
620 virtual void ChangingState(DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState) = 0;
629 virtual void ChangedState(DDM_INSTANCE_STATE actualState) = 0;
630};
664{
665public:
677 virtual CHANNEL_HANDLE CreateChannel(const char *channelName, IDataDistributionChannelCallback *dataCb, DDM_CHANNEL_DIRECTION direction = DDM_CHANNEL_DIRECTION::ALL, const char *arrayParams[] = NULL, int len = 0) = 0;
686 virtual OPERATION_RESULT StartChannel(CHANNEL_HANDLE_PARAMETER, unsigned long timeout) = 0;
695 virtual OPERATION_RESULT StopChannel(CHANNEL_HANDLE_PARAMETER, unsigned long timeout) = 0;
704 virtual void SetParameter(CHANNEL_HANDLE_PARAMETER, const char *paramName, const char *paramValue) = 0;
713 virtual void SetParameter(CHANNEL_HANDLE_PARAMETER, DDM_GENERAL_PARAMETER paramId, const char *paramValue) = 0;
722 virtual const char *GetParameter(CHANNEL_HANDLE_PARAMETER, const char *paramName) = 0;
740 virtual OPERATION_RESULT Lock(CHANNEL_HANDLE_PARAMETER, unsigned long timeout) = 0;
759 virtual OPERATION_RESULT SeekChannel(CHANNEL_HANDLE_PARAMETER, int64_t position, DDM_SEEKCONTEXT context = DDM_SEEKCONTEXT::OFFSET, DDM_SEEKKIND kind = DDM_SEEKKIND::ABSOLUTE) = 0;
781 virtual OPERATION_RESULT WriteOnChannel(CHANNEL_HANDLE_PARAMETER, const char *key, size_t keyLen, void *buffer, size_t bufferLen, const BOOL waitAll = FALSE, const int64_t timestamp = DDM_NO_TIMESTAMP) = 0;
792 virtual OPERATION_RESULT ReadFromChannel(CHANNEL_HANDLE_PARAMETER, int64_t offset, size_t *bufferLen, void **buffer) = 0;
802};
809{
810public:
816 virtual int GetServerLostTimeout() = 0;
822 virtual size_t GetMaxMessageSize() = 0;
830 virtual OPERATION_RESULT Start(unsigned long timeout) = 0;
838 virtual OPERATION_RESULT Stop(unsigned long timeout) = 0;
839};
846{
847public:
858 virtual OPERATION_RESULT Initialize(IDataDistributionCallback *cb, const char *conf_file, const char *hostAddress = NULL, const char *channelTrailer = NULL) = 0;
870 virtual OPERATION_RESULT Initialize(IDataDistributionCallback *cb, const char *arrayParams[], int len, const char *hostAddress = NULL, const char *channelTrailer = NULL) = 0;
877};
882typedef std::map<int64_t, ClusterHealthElement *> ClusterHealth;
887typedef std::map<int64_t, ClusterHealthElement *>::const_iterator ClusterHealthIterator;
888
895{
896public:
908 virtual OPERATION_RESULT Initialize(IDataDistributionSubsystem *transportManager, IDataDistributionMastershipCallback *cbs, const char *hostAddress = NULL, const char *arrayParams[] = NULL, int len = 0) = 0;
916 virtual void SetParameter(const char *paramName, const char *paramValue) = 0;
924 virtual const char *GetParameter(const char *paramName) = 0;
932 virtual OPERATION_RESULT Start(unsigned long timeout) = 0;
940 virtual OPERATION_RESULT Stop(unsigned long timeout) = 0;
946 virtual BOOL GetIamNextPrimary() = 0;
952 virtual BOOL RequestIAmNextPrimary() = 0;
961 virtual int64_t *GetClusterIndexes(size_t *length) = 0;
969 virtual DDM_INSTANCE_STATE GetStateOf(int64_t serverId) = 0;
987 virtual void ChangeMyState(DDM_INSTANCE_STATE state) = 0;
994 virtual void ChangeState(int64_t instanceId, DDM_INSTANCE_STATE state) = 0;
1000 virtual int64_t GetLocalServerId() = 0;
1006 virtual int64_t GetPrimaryServerId() = 0;
1012 virtual int64_t GetMessageDelay() = 0;
1018 virtual int64_t GetUpTime() = 0;
1019};
1020
1026class DDM_EXPORT IDataDistribution
1027{
1028public:
1039 virtual OPERATION_RESULT Initialize(IDataDistributionCallback *iddcb, const char *conf_file = NULL, const char *hostAddress = NULL, const char *channelTrailer = NULL) = 0;
1051 virtual OPERATION_RESULT Initialize(IDataDistributionCallback *iddcb, const char *arrayParams[], int len, const char *hostAddress = NULL, const char *channelTrailer = NULL) = 0;
1062 virtual OPERATION_RESULT RequestMastershipManager(IDataDistributionMastershipCallback *cbs, const char *szMyAddress = NULL, const char *arrayParams[] = NULL, int len = 0) = 0;
1070 virtual BOOL Start(unsigned long timeout) = 0;
1078 virtual BOOL Stop(unsigned long timeout) = 0;
1096 virtual std::string GetProtocol() = 0;
1102 virtual std::string GetProtocolLib() = 0;
1108 virtual std::string GetMastershipLib() = 0;
1109};
1110
1116class DDM_EXPORT DataDistribution : public IDataDistribution
1117{
1118public:
1125};
1126
1127#endif // !defined(DATADISTRIBUTIONMANAGER_H__INCLUDED_)
DDM_CHANNEL_DIRECTION
DDM_CHANNEL_DIRECTION type.
Definition DataDistributionManagerEnums.h:70
DDM_GENERAL_PARAMETER
DDM_GENERAL_PARAMETER type.
Definition DataDistributionManagerEnums.h:50
DDM_SEEKKIND
DDM_SEEKKIND type.
Definition DataDistributionManagerEnums.h:163
DDM_LOG_LEVEL
DDM_LOG_LEVEL type.
Definition DataDistributionManagerEnums.h:87
DDM_INSTANCE_STATE
DDM_INSTANCE_STATE type.
Definition DataDistributionManagerEnums.h:112
DDM_CLUSTEREVENT
DDM_CLUSTEREVENT type.
Definition DataDistributionManagerEnums.h:133
DDM_SEEKCONTEXT
DDM_SEEKCONTEXT type.
Definition DataDistributionManagerEnums.h:149
DataDistributionManager library.
#define DDM_NO_TIMESTAMP
Definition to avoid timestamp on write.
Definition DataDistributionManagerTypes.h:76
long OPERATION_RESULT
OPERATION_RESULT type.
Definition DataDistributionManagerTypes.h:102
void * GENERIC_HANDLE
Generic handle definition, used for thread, lock, mutex.
Definition DataDistributionManagerTypes.h:94
#define CHANNEL_HANDLE_PARAMETER
Channel handle parameter definition.
Definition DataDistributionManagerTypes.h:89
#define CHANNEL_HANDLE
Channel handle definition.
Definition DataDistributionManagerTypes.h:84
#define DDM_NO_ERROR_CONDITION
Definition DataDistributionManagerTypes.h:112
const char *(FUNCALL * dataDistributionConfigurationCb)(const void *opaque, const char *channelName, const char *key, const char *value)
C-style callback invoked for each key-value in the configuration.
Definition DataDistributionManager.h:58
void(FUNCALL * dataDistributionOnClusterStateChange)(void *opaque, DDM_CLUSTEREVENT change, int64_t serverid)
C-style callback invoked to report cluster state change.
Definition DataDistributionManager.h:450
struct DDM_EXPORT UnderlyingEventData * pUnderlyingEventData
void(FUNCALL * dataDistributionCompletelyDisconnectedCb)(const void *opaque, const char *channelName, const char *reason)
C-style callback invoked on a complete disconnection .
Definition DataDistributionManager.h:85
struct DDM_EXPORT UnderlyingEventData UnderlyingEventData
Class to reports information from transport subsystem.
void(FUNCALL * dataDistributionOnRequestedState)(void *opaque, void **pState, size_t *len)
C-style callback invoked when a state transfer is requested.
Definition DataDistributionManager.h:489
void(FUNCALL * dataDistributionOnMultiplePrimary)(void *opaque, int64_t myId, int64_t otherId)
C-style callback invoked when multiple primary server are detected.
Definition DataDistributionManager.h:502
std::map< int64_t, ClusterHealthElement * > ClusterHealth
Association map between server id and ClusterHealthElement.
Definition DataDistributionManager.h:882
void(FUNCALL * dataDistributionFirstStateChange)(void *opaque, DDM_INSTANCE_STATE newState)
C-style callback invoked to report a first state change.
Definition DataDistributionManager.h:514
void(FUNCALL * dataDistributionOnStateChange)(void *opaque, DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState)
C-style callback invoked to report a state change.
Definition DataDistributionManager.h:463
std::map< int64_t, ClusterHealthElement * >::const_iterator ClusterHealthIterator
Iterator of ClusterHealth.
Definition DataDistributionManager.h:887
void(FUNCALL * dataDistributionChangingState)(void *opaque, DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState)
C-style callback invoked to report a starting instance state change.
Definition DataDistributionManager.h:527
void(FUNCALL * dataDistributionLoggingCb)(const void *opaque, const DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr)
C-style callback invoked when a log is emitted from subsystem.
Definition DataDistributionManager.h:73
void(FUNCALL * dataDistributionChangedState)(void *opaque, DDM_INSTANCE_STATE actualState)
C-style callback invoked to report a finished instance state change.
Definition DataDistributionManager.h:539
void(FUNCALL * dataDistributionOnStateReady)(void *opaque, void *pState, int64_t len)
C-style callback invoked when a state transfer is completed.
Definition DataDistributionManager.h:476
void(FUNCALL * dataDistributionUnderlyingEvent)(const void *opaque, const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent)
C-style callback invoked to report UnderlyingEventData.
Definition DataDistributionManager.h:367
Class to convert C style callback into C++ callback.
Definition DataDistributionManager.h:253
static IDataDistributionCallback * create(void *opaque, dataDistributionConfigurationCb confCb, dataDistributionLoggingCb logCb, dataDistributionCompletelyDisconnectedCb cbCb)
Creates a new IDataDistributionCallback instance.
Class to convert C style dataDistributionUnderlyingEvent callback into IDataDistributionChannelCallba...
Definition DataDistributionManager.h:425
static IDataDistributionChannelCallback * create(void *opaque, dataDistributionUnderlyingEvent uEventCb)
Creates a new IDataDistributionChannelCallback instance.
Class to convert C style callbacks into IDataDistributionMastershipCallback C++ callback.
Definition DataDistributionManager.h:637
static IDataDistributionMastershipCallback * create(void *opaque, dataDistributionOnClusterStateChange c1, dataDistributionOnStateChange c2, dataDistributionOnStateReady c3, dataDistributionOnRequestedState c4, dataDistributionOnMultiplePrimary c5, dataDistributionFirstStateChange c6, dataDistributionChangingState c7, dataDistributionChangedState c8)
Creates a new IDataDistributionMastershipCallback instance.
Main entry point to activate an instance of IDataDistribution.
Definition DataDistributionManager.h:1117
static IDataDistribution * create()
Creates a new IDataDistribution instance.
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:212
virtual void OnLogging(DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr)=0
Callback invoked when a log is emitted from subsystem.
virtual const char * OnConfiguration(const char *channelName, const char *key, const char *value)=0
Invoked during configuration validation.
virtual void OnCompletelyDisconnected(const char *channelName, const char *reason)=0
Callback invoked on a complete disconnection.
Base interface to be implemented from channel manager.
Definition DataDistributionManager.h:664
virtual OPERATION_RESULT Lock(CHANNEL_HANDLE_PARAMETER, unsigned long timeout)=0
Locks the channel.
virtual const char * GetParameter(CHANNEL_HANDLE_PARAMETER, const char *paramName)=0
Reads a parameter at run-time.
virtual OPERATION_RESULT DeleteChannel(CHANNEL_HANDLE_PARAMETER)=0
Deletes the channel.
virtual OPERATION_RESULT StopChannel(CHANNEL_HANDLE_PARAMETER, unsigned long timeout)=0
Stops the channel.
virtual OPERATION_RESULT SeekChannel(CHANNEL_HANDLE_PARAMETER, int64_t position, DDM_SEEKCONTEXT context=DDM_SEEKCONTEXT::OFFSET, DDM_SEEKKIND kind=DDM_SEEKKIND::ABSOLUTE)=0
Seeks the channel.
virtual OPERATION_RESULT WriteOnChannel(CHANNEL_HANDLE_PARAMETER, const char *key, size_t keyLen, void *buffer, size_t bufferLen, const BOOL waitAll=FALSE, const int64_t timestamp=DDM_NO_TIMESTAMP)=0
Writes data on the channel.
virtual OPERATION_RESULT ReadFromChannel(CHANNEL_HANDLE_PARAMETER, int64_t offset, size_t *bufferLen, void **buffer)=0
Reads data from the channel.
virtual OPERATION_RESULT ChangeChannelDirection(CHANNEL_HANDLE_PARAMETER, DDM_CHANNEL_DIRECTION direction)=0
Change the DDM_CHANNEL_DIRECTION of the channel.
virtual CHANNEL_HANDLE CreateChannel(const char *channelName, IDataDistributionChannelCallback *dataCb, DDM_CHANNEL_DIRECTION direction=DDM_CHANNEL_DIRECTION::ALL, const char *arrayParams[]=NULL, int len=0)=0
Creates a new channel.
virtual const char * GetParameter(CHANNEL_HANDLE_PARAMETER, DDM_GENERAL_PARAMETER paramId)=0
Reads a parameter at run-time.
virtual OPERATION_RESULT StartChannel(CHANNEL_HANDLE_PARAMETER, unsigned long timeout)=0
Starts the channel.
virtual void SetParameter(CHANNEL_HANDLE_PARAMETER, DDM_GENERAL_PARAMETER paramId, const char *paramValue)=0
Sets a parameter at run-time.
virtual void SetParameter(CHANNEL_HANDLE_PARAMETER, const char *paramName, const char *paramValue)=0
Sets a parameter at run-time.
virtual OPERATION_RESULT Unlock(CHANNEL_HANDLE_PARAMETER)=0
Unlock the channel.
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:405
virtual void OnUnderlyingEvent(const CHANNEL_HANDLE_PARAMETER, const UnderlyingEventData *uEvent)=0
Callback invoked to report UnderlyingEventData.
The basic interface for all channel.
Definition DataDistributionManager.h:377
virtual const char * GetChannelName()=0
Returns the channel name.
virtual GENERIC_HANDLE GetOpaqueHandle()=0
Returns an opaque version of the channel handle.
Interface to reports logging.
Definition DataDistributionManager.h:177
virtual void Log(const DDM_LOG_LEVEL level, const char *sourceName, const char *function, const char *format, va_list args)=0
Reports log information.
virtual void Log(const DDM_LOG_LEVEL level, const char *sourceName, const char *function, const char *format,...)=0
Reports log information.
The C++ callback interface to be externally implemented.
Definition DataDistributionManager.h:550
virtual void OnStateChange(DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState)=0
Callback invoked to report a state change.
virtual void OnClusterStateChange(DDM_CLUSTEREVENT change, int64_t serverid)=0
Callback invoked to report cluster state change.
virtual void ChangedState(DDM_INSTANCE_STATE actualState)=0
Callback invoked to report a finished instance state change.
virtual void OnStateReady(void *pState, int64_t len)=0
Callback invoked when a state transfer is completed.
virtual void FirstStateChange(DDM_INSTANCE_STATE newState)=0
Callback invoked to report a first state change.
virtual void OnMultiplePrimary(int64_t myId, int64_t otherId)=0
Callback invoked when multiple primary server are detected.
virtual void ChangingState(DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState)=0
Callback invoked to report a starting instance state change.
virtual void OnRequestedState(void **pState, size_t *len)=0
Callback invoked when a state transfer is requested.
Interface to be implemented from mastership subsystem.
Definition DataDistributionManager.h:895
virtual int64_t * GetClusterIndexes(size_t *length)=0
Returns an array of all known indexes of the servers within the cluster.
virtual int64_t GetMessageDelay()=0
Returns the message delay within the cluster.
virtual BOOL RequestIAmNextPrimary()=0
Request to be the next primary server.
virtual ClusterHealth GetClusterHealth()=0
Returns the health of the cluster.
virtual void ChangeMyState(DDM_INSTANCE_STATE state)=0
Change DDM_INSTANCE_STATE of this instance.
virtual OPERATION_RESULT Start(unsigned long timeout)=0
Start the mastership subsystem.
virtual int64_t GetPrimaryServerId()=0
Returns the server id of the primary instance.
virtual int64_t GetLocalServerId()=0
Returns the server id of the local instance.
virtual void ChangeState(int64_t instanceId, DDM_INSTANCE_STATE state)=0
Change DDM_INSTANCE_STATE of instanceId.
virtual OPERATION_RESULT Stop(unsigned long timeout)=0
Stop the mastership subsystem.
virtual BOOL GetIamNextPrimary()=0
Verify if this server will be elected as next primary.
virtual DDM_INSTANCE_STATE GetStateOf(int64_t serverId)=0
Returns the DDM_INSTANCE_STATE of a specific server.
virtual int64_t GetUpTime()=0
Returns the current uptime.
virtual OPERATION_RESULT Initialize(IDataDistributionSubsystem *transportManager, IDataDistributionMastershipCallback *cbs, const char *hostAddress=NULL, const char *arrayParams[]=NULL, int len=0)=0
Initialize the subsystem.
virtual void SetParameter(const char *paramName, const char *paramValue)=0
Sets a parameter at run-time.
virtual const char * GetParameter(const char *paramName)=0
Reads a parameter at run-time.
virtual DDM_INSTANCE_STATE GetMyState()=0
Returns DDM_INSTANCE_STATE of this instance.
Interface to be implemented from subsystem.
Definition DataDistributionManager.h:846
virtual OPERATION_RESULT Initialize(IDataDistributionCallback *cb, const char *arrayParams[], int len, const char *hostAddress=NULL, const char *channelTrailer=NULL)=0
Initialize the subsystem.
virtual IDataDistributionCallback * GetCallbacks()=0
Returns IDataDistributionCallback passed during IDataDistributionSubsystem::Initialize.
virtual OPERATION_RESULT Initialize(IDataDistributionCallback *cb, const char *conf_file, const char *hostAddress=NULL, const char *channelTrailer=NULL)=0
Initialize the subsystem.
Interface to be implemented from transport subsystem.
Definition DataDistributionManager.h:809
virtual int GetServerLostTimeout()=0
Returns the server lost timeout.
virtual OPERATION_RESULT Start(unsigned long timeout)=0
Start the transport subsystem.
virtual OPERATION_RESULT Stop(unsigned long timeout)=0
Start the transport subsystem.
virtual size_t GetMaxMessageSize()=0
Returns the max message size managed from the subsystem.
Interface to be implemented from common manager.
Definition DataDistributionManager.h:1027
virtual std::string GetProtocol()=0
Returns the protocol in use from IDataDistribution instance.
virtual std::string GetProtocolLib()=0
Returns the protocol library in use from IDataDistribution instance.
virtual OPERATION_RESULT Initialize(IDataDistributionCallback *iddcb, const char *conf_file=NULL, const char *hostAddress=NULL, const char *channelTrailer=NULL)=0
Initialize IDataDistribution instance.
virtual BOOL Start(unsigned long timeout)=0
Start the common manager.
virtual BOOL Stop(unsigned long timeout)=0
Stop the common manager.
virtual std::string GetMastershipLib()=0
Returns the mastership library in use from IDataDistribution instance.
virtual OPERATION_RESULT Initialize(IDataDistributionCallback *iddcb, const char *arrayParams[], int len, const char *hostAddress=NULL, const char *channelTrailer=NULL)=0
Initialize IDataDistribution instance.
virtual IDataDistributionMastershipCommon * GetMastershipManager()=0
Returns the allocated mastership subsystem.
virtual OPERATION_RESULT RequestMastershipManager(IDataDistributionMastershipCallback *cbs, const char *szMyAddress=NULL, const char *arrayParams[]=NULL, int len=0)=0
Allocate and initialize the mastership manager.
virtual IDataDistributionSubsystem * GetSubsystemManager()=0
Returns the allocated communication subsystem.
Interface to manage time information.
Definition DataDistributionManager.h:111
virtual int64_t ElapsedMilliseconds()=0
Reports the elapsed time in milliseconds.
virtual int64_t ElapsedMicroseconds()=0
Reports the elapsed time in microseconds.
virtual int64_t ElapsedNanoseconds()=0
Reports the elapsed time in nanoseconds.
virtual void ResetTime()=0
Reset the timer.
virtual void AddNanoseconds(unsigned int time)=0
Adds nanoseconds time to actual value.
Class to allocate an ITimeMeasureWrapper.
Definition DataDistributionManager.h:161
static ITimeMeasureWrapper * create()
Creates a new ITimeMeasureWrapper instance.
Contains information needed from the cluster management.
Definition DataDistributionManager.h:93
DDM_INSTANCE_STATE Status
Definition DataDistributionManager.h:95
int64_t ServerId
Definition DataDistributionManager.h:94
int64_t Uptime
Definition DataDistributionManager.h:96
int64_t LastContactTime
Definition DataDistributionManager.h:97
Class to reports information from transport subsystem.
Definition DataDistributionManager.h:274
const char * ChannelName
Definition DataDistributionManager.h:275
const char * Key
Definition DataDistributionManager.h:279
UnderlyingEventData(const char *channelName, const char *key, size_t keyLen, const void *buffer, size_t bufferLength, int64_t timestamp=-1, int64_t offset=-1)
Initialize a new UnderlyingEventData to reports data.
Definition DataDistributionManager.h:325
int64_t Offset
Definition DataDistributionManager.h:277
const char * SubSystemReason
Definition DataDistributionManager.h:285
int NativeCode
Definition DataDistributionManager.h:284
int64_t Timestamp
Definition DataDistributionManager.h:278
UnderlyingEventData(const char *channelName)
Initialize a new UnderlyingEventData.
Definition DataDistributionManager.h:296
const void * Buffer
Definition DataDistributionManager.h:281
OPERATION_RESULT Condition
Definition DataDistributionManager.h:283
UnderlyingEventData(const char *channelName, OPERATION_RESULT condition, int nativeCode, const char *subSystemReason)
Initialize a new UnderlyingEventData to reports errors or conditions.
Definition DataDistributionManager.h:348
size_t KeyLen
Definition DataDistributionManager.h:280
BOOL IsDataAvailable
Definition DataDistributionManager.h:276
size_t BufferLength
Definition DataDistributionManager.h:282