2014-01-12 04:08:42 +04:00
|
|
|
// Matt Wells, Jan 2014
|
|
|
|
|
|
|
|
#ifndef REBALANCE_H
|
|
|
|
#define REBALANCE_H
|
|
|
|
|
|
|
|
#include "gb-include.h"
|
|
|
|
#include "types.h"
|
|
|
|
#include "RdbList.h"
|
|
|
|
#include "Msg4.h"
|
|
|
|
#include "Msg5.h"
|
|
|
|
#include "SafeBuf.h"
|
|
|
|
|
|
|
|
class Rebalance {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Rebalance();
|
|
|
|
|
|
|
|
char *getNeedsRebalance ( ) ;
|
|
|
|
void rebalanceLoop ( ) ;
|
|
|
|
void scanLoop ( ) ;
|
|
|
|
bool scanRdb ( ) ;
|
2014-01-16 04:09:38 +04:00
|
|
|
bool gotList ( ) ;
|
2014-01-12 04:08:42 +04:00
|
|
|
bool saveRebalanceFile ( ) ;
|
|
|
|
|
2014-03-15 10:37:30 +04:00
|
|
|
//bool m_inRebalanceLoop;
|
2014-01-12 04:08:42 +04:00
|
|
|
long m_numForeignRecs;
|
2014-01-16 05:40:17 +04:00
|
|
|
long long m_rebalanceCount;
|
2014-01-17 05:04:08 +04:00
|
|
|
long long m_scannedCount;
|
2014-01-12 04:08:42 +04:00
|
|
|
|
|
|
|
long m_rdbNum;
|
|
|
|
collnum_t m_collnum;
|
2014-01-16 05:40:17 +04:00
|
|
|
collnum_t m_lastCollnum;
|
|
|
|
class Rdb *m_lastRdb;
|
2014-01-16 07:08:47 +04:00
|
|
|
long m_lastPercent;
|
2014-01-12 04:08:42 +04:00
|
|
|
char m_nextKey[MAX_KEY_BYTES];
|
|
|
|
char m_endKey[MAX_KEY_BYTES];
|
|
|
|
bool m_needsRebalanceValid;
|
|
|
|
char m_needsRebalance;
|
|
|
|
bool m_warnedUser;
|
|
|
|
bool m_userApproved;
|
|
|
|
bool m_isScanning;
|
|
|
|
long m_blocked;
|
2014-01-16 07:08:47 +04:00
|
|
|
bool m_allowSave;
|
2014-01-12 04:08:42 +04:00
|
|
|
|
2014-03-15 06:19:41 +04:00
|
|
|
bool m_registered;
|
2014-01-12 04:08:42 +04:00
|
|
|
RdbList m_list;
|
|
|
|
SafeBuf m_posMetaList;
|
|
|
|
SafeBuf m_negMetaList;
|
|
|
|
Msg4 m_msg4a;
|
|
|
|
Msg4 m_msg4b;
|
|
|
|
Msg5 m_msg5;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Rebalance g_rebalance;
|
|
|
|
|
|
|
|
#endif
|