InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Topology.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Mark Travis <mtravis15432+src@gmail.com>
3  * All rights reserved. No warranty, explicit or implicit, provided.
4  *
5  * This file is part of InfiniSQL(tm).
6 
7  * InfiniSQL is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 3
9  * as published by the Free Software Foundation.
10  *
11  * InfiniSQL is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with InfiniSQL. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
30 #include "Topology.h"
31 #line 22 "Topology.cc"
32 
33 Topology::Topology() : nodeid(0), numreplicas(1), activereplica(-1),
34  numtransactionagents(0), numengines(0), numobgateways(0),
35  numpartitions(0), userSchemaMgrNode(0),
36  userSchemaMgrMbox(0), deadlockMgrNode(0), deadlockMgrMbox(0)
37 {
38 }
39 
40 Topology::Topology(const Topology &orig) : nodeid (), numreplicas (),
41  activereplica (),
42  numtransactionagents (),
43  numengines (),
44  numobgateways (),
45  numpartitions (),
46  userSchemaMgrNode (),
47  userSchemaMgrMbox (),
48  deadlockMgrNode (),
49  deadlockMgrMbox ()
50 {
51 }
52 
54 {
55 }
56 
58  class Mbox *mbox, int epollfd,
59  const string &argstring,
60  int64_t actorid,
61  const vector<string> &nodes,
62  const vector<string> &services)
63 {
64  partitionAddress *addr = new partitionAddress();
65  if (addr==NULL)
66  {
67  fprintf(logfile, "%s %i can't create addr\n", __FILE__, __LINE__);
68  exit(1);
69  }
70  partitionAddress &addrRef = *addr;
71  addrRef.type = type;
72  addrRef.mbox = mbox;
73  addrRef.address.nodeid = nodeid;
74  addrRef.address.actorid = actorid;
75  addrRef.epollfd = epollfd;
76  addrRef.nodes = nodes;
77  addrRef.services = services;
78  addrRef.argstring = argstring;
79 
80  return addr;
81 }