You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -15,11 +15,11 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*********************************************************************
|
||||
* $Id: clientrotator.h 9210 2013-01-21 14:10:42Z rdempsey $
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
/*********************************************************************
|
||||
* $Id: clientrotator.h 9210 2013-01-21 14:10:42Z rdempsey $
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
/** @file */
|
||||
|
||||
@ -43,114 +43,129 @@ namespace execplan
|
||||
class ClientRotator
|
||||
{
|
||||
public:
|
||||
/** @brief ctor
|
||||
*/
|
||||
ClientRotator(uint32_t sid, const std::string& name, bool localQuery=false);
|
||||
/** @brief ctor
|
||||
*/
|
||||
ClientRotator(uint32_t sid, const std::string& name, bool localQuery = false);
|
||||
|
||||
/** @brief dtor
|
||||
*/
|
||||
~ClientRotator()
|
||||
{
|
||||
if (fClient)
|
||||
{
|
||||
fClient->shutdown();
|
||||
delete fClient;
|
||||
}
|
||||
}
|
||||
/** @brief dtor
|
||||
*/
|
||||
~ClientRotator()
|
||||
{
|
||||
if (fClient)
|
||||
{
|
||||
fClient->shutdown();
|
||||
delete fClient;
|
||||
}
|
||||
}
|
||||
|
||||
/** @brief connnect
|
||||
*
|
||||
* Try connecting to client based on session id. If no connection,
|
||||
* try connectList.
|
||||
* @param timeout in seconds.
|
||||
*/
|
||||
void connect(double timeout=50);
|
||||
/** @brief connnect
|
||||
*
|
||||
* Try connecting to client based on session id. If no connection,
|
||||
* try connectList.
|
||||
* @param timeout in seconds.
|
||||
*/
|
||||
void connect(double timeout = 50);
|
||||
|
||||
/** @brief write
|
||||
*
|
||||
* Write msg to fClient. If unsuccessful, get new connection with
|
||||
* connectList and write.
|
||||
*/
|
||||
void write(const messageqcpp::ByteStream& msg);
|
||||
/** @brief write
|
||||
*
|
||||
* Write msg to fClient. If unsuccessful, get new connection with
|
||||
* connectList and write.
|
||||
*/
|
||||
void write(const messageqcpp::ByteStream& msg);
|
||||
|
||||
/** @brief shutdown
|
||||
*/
|
||||
void shutdown()
|
||||
{
|
||||
if (fClient)
|
||||
{
|
||||
fClient->shutdown();
|
||||
delete fClient;
|
||||
fClient = 0;
|
||||
}
|
||||
}
|
||||
/** @brief shutdown
|
||||
*/
|
||||
void shutdown()
|
||||
{
|
||||
if (fClient)
|
||||
{
|
||||
fClient->shutdown();
|
||||
delete fClient;
|
||||
fClient = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/** @brief read
|
||||
*/
|
||||
messageqcpp::ByteStream read();
|
||||
/** @brief read
|
||||
*/
|
||||
messageqcpp::ByteStream read();
|
||||
|
||||
/** @brief getClient
|
||||
*/
|
||||
messageqcpp::MessageQueueClient* getClient() const { return fClient; }
|
||||
/** @brief getClient
|
||||
*/
|
||||
messageqcpp::MessageQueueClient* getClient() const
|
||||
{
|
||||
return fClient;
|
||||
}
|
||||
|
||||
/** @brief getSessionId
|
||||
*/
|
||||
uint32_t getSessionId() const { return fSessionId; }
|
||||
/** @brief getSessionId
|
||||
*/
|
||||
uint32_t getSessionId() const
|
||||
{
|
||||
return fSessionId;
|
||||
}
|
||||
|
||||
/** @brief setSessionId
|
||||
*/
|
||||
void setSessionId(uint32_t sid) { fSessionId = sid; }
|
||||
/** @brief setSessionId
|
||||
*/
|
||||
void setSessionId(uint32_t sid)
|
||||
{
|
||||
fSessionId = sid;
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& output, const ClientRotator& rhs);
|
||||
friend std::ostream& operator<<(std::ostream& output, const ClientRotator& rhs);
|
||||
|
||||
/** @brief reset fClient */
|
||||
void resetClient();
|
||||
/** @brief reset fClient */
|
||||
void resetClient();
|
||||
|
||||
bool localQuery() { return fLocalQuery; }
|
||||
void localQuery(bool localQuery) { fLocalQuery = localQuery; }
|
||||
static std::string getModule();
|
||||
bool localQuery()
|
||||
{
|
||||
return fLocalQuery;
|
||||
}
|
||||
void localQuery(bool localQuery)
|
||||
{
|
||||
fLocalQuery = localQuery;
|
||||
}
|
||||
static std::string getModule();
|
||||
|
||||
private:
|
||||
|
||||
//Not copyable
|
||||
ClientRotator(const ClientRotator& );
|
||||
ClientRotator& operator=(const ClientRotator& );
|
||||
//Not copyable
|
||||
ClientRotator(const ClientRotator& );
|
||||
ClientRotator& operator=(const ClientRotator& );
|
||||
|
||||
/** @brief load Clients
|
||||
*
|
||||
* Put all entries for client name tag from config file into client list
|
||||
*/
|
||||
void loadClients();
|
||||
/** @brief load Clients
|
||||
*
|
||||
* Put all entries for client name tag from config file into client list
|
||||
*/
|
||||
void loadClients();
|
||||
|
||||
/** @brief execute connect
|
||||
*
|
||||
* Make connection and return success.
|
||||
*/
|
||||
bool exeConnect(const std::string& clientName );
|
||||
/** @brief execute connect
|
||||
*
|
||||
* Make connection and return success.
|
||||
*/
|
||||
bool exeConnect(const std::string& clientName );
|
||||
|
||||
/** @brief connnect to list
|
||||
*
|
||||
* Try connecting to next client on list
|
||||
* until timeout lapses. Then throw exception.
|
||||
*/
|
||||
void connectList(double timeout=0.005);
|
||||
/** @brief connnect to list
|
||||
*
|
||||
* Try connecting to next client on list
|
||||
* until timeout lapses. Then throw exception.
|
||||
*/
|
||||
void connectList(double timeout = 0.005);
|
||||
|
||||
/** @brief write to message log
|
||||
*
|
||||
* writes message with file name to debug or
|
||||
* critical log.
|
||||
*/
|
||||
void writeToLog(int line, const std::string& msg, bool critical) const;
|
||||
/** @brief write to message log
|
||||
*
|
||||
* writes message with file name to debug or
|
||||
* critical log.
|
||||
*/
|
||||
void writeToLog(int line, const std::string& msg, bool critical) const;
|
||||
|
||||
const std::string fName;
|
||||
uint32_t fSessionId;
|
||||
messageqcpp::MessageQueueClient* fClient;
|
||||
typedef std::vector<std::string> ClientList;
|
||||
ClientList fClients;
|
||||
config::Config* fCf;
|
||||
int fDebug;
|
||||
boost::mutex fClientLock;
|
||||
bool fLocalQuery;
|
||||
const std::string fName;
|
||||
uint32_t fSessionId;
|
||||
messageqcpp::MessageQueueClient* fClient;
|
||||
typedef std::vector<std::string> ClientList;
|
||||
ClientList fClients;
|
||||
config::Config* fCf;
|
||||
int fDebug;
|
||||
boost::mutex fClientLock;
|
||||
bool fLocalQuery;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user