2014-01-11 16:08:42 -08:00
|
|
|
// Matt Wells, Jan 2014
|
|
|
|
|
2016-03-08 22:14:30 +01:00
|
|
|
#ifndef GB_REBALANCE_H
|
|
|
|
#define GB_REBALANCE_H
|
2014-01-11 16:08:42 -08:00
|
|
|
|
|
|
|
#include "gb-include.h"
|
|
|
|
#include "types.h"
|
|
|
|
#include "RdbList.h"
|
|
|
|
#include "Msg4.h"
|
|
|
|
#include "Msg5.h"
|
|
|
|
#include "SafeBuf.h"
|
|
|
|
|
|
|
|
class Rebalance {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Rebalance();
|
|
|
|
|
2016-05-22 22:22:56 +02:00
|
|
|
const char *getNeedsRebalance ( ) ;
|
2014-01-11 16:08:42 -08:00
|
|
|
void rebalanceLoop ( ) ;
|
|
|
|
void scanLoop ( ) ;
|
|
|
|
bool scanRdb ( ) ;
|
2014-01-15 16:09:38 -08:00
|
|
|
bool gotList ( ) ;
|
2014-01-11 16:08:42 -08:00
|
|
|
bool saveRebalanceFile ( ) ;
|
|
|
|
|
2014-03-14 23:37:30 -07:00
|
|
|
//bool m_inRebalanceLoop;
|
2014-11-10 14:45:11 -08:00
|
|
|
int32_t m_numForeignRecs;
|
2014-10-30 13:36:39 -06:00
|
|
|
int64_t m_rebalanceCount;
|
|
|
|
int64_t m_scannedCount;
|
2014-01-11 16:08:42 -08:00
|
|
|
|
2014-11-10 14:45:11 -08:00
|
|
|
int32_t m_rdbNum;
|
2014-01-11 16:08:42 -08:00
|
|
|
collnum_t m_collnum;
|
2014-01-15 17:40:17 -08:00
|
|
|
collnum_t m_lastCollnum;
|
|
|
|
class Rdb *m_lastRdb;
|
2014-11-10 14:45:11 -08:00
|
|
|
int32_t m_lastPercent;
|
2014-01-11 16:08:42 -08: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;
|
2014-11-10 14:45:11 -08:00
|
|
|
int32_t m_blocked;
|
2014-01-15 19:08:47 -08:00
|
|
|
bool m_allowSave;
|
2014-01-11 16:08:42 -08:00
|
|
|
|
2014-03-14 19:19:41 -07:00
|
|
|
bool m_registered;
|
2014-01-11 16:08:42 -08:00
|
|
|
RdbList m_list;
|
|
|
|
SafeBuf m_posMetaList;
|
|
|
|
SafeBuf m_negMetaList;
|
|
|
|
Msg4 m_msg4a;
|
|
|
|
Msg4 m_msg4b;
|
|
|
|
Msg5 m_msg5;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Rebalance g_rebalance;
|
|
|
|
|
2016-03-08 22:14:30 +01:00
|
|
|
#endif // GB_REBALANCE_H
|