47 int main(
int argc,
char **argv)
56 while ((c = getopt(argc, argv,
"l:m:n:hv")) != -1)
66 logfilename.assign(optarg, strlen(optarg));
74 printf(
"-m <management ip:port> -n <nodeid> -l <log path/file> -v\n");
79 printf(
"%s\n", version);
87 if (!logfilename.size())
89 logfilename.assign(
"/tmp/infinisqld.log");
92 logfile = fopen(logfilename.c_str(),
"a");
96 printf(
"%s %i cannot open logfile %s errno %i\n", __FILE__, __LINE__,
97 logfilename.c_str(), errno);
103 pthread_mutexattr_t attr;
104 attr.__align = PTHREAD_MUTEX_ADAPTIVE_NP;
107 pthread_t topologyMgrThread;
109 arg->
type = ACTOR_TOPOLOGYMGR;
117 int rv=pthread_create(&topologyMgrThread, NULL,
topologyMgr, arg);
120 printf(
"%s %i pthread_create rv %i\n", __FILE__, __LINE__, rv);
135 msgpack::unpacked msg;
136 msgpack::unpack(&msg, payload, length);
137 msgpack::object obj = msg.get();
138 obj.convert(resultvector);
141 void debug(
char *description,
int line,
char *file)
143 fprintf(
logfile,
"DEBUG %i %s %s\n", line, file, description);
238 int16_t numpartitions)
274 fieldVal.
str.length(), 0) % numpartitions;
279 fieldVal.
str.length(), 0) % numpartitions;
283 printf(
"%s %i anomaly fieldtype %i\n", __FILE__, __LINE__, type);
293 while ((pos = likeStr.find(
'_', 0)) != string::npos)
298 while ((pos = likeStr.find(
'%', 0)) != string::npos)
301 likeStr.insert(pos, 1,
'.');
360 if (val1.
str.compare(val2.
str)==0)
368 if (val1.
str.compare(val2.
str)==0)
376 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, type);
384 size_t last=input.find_last_not_of(
' ');
386 if (last != string::npos)
401 switch (stagedRow.
cmd)
419 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, stagedRow.
cmd);
426 struct sched_param params;
427 params.sched_priority=
RTPRIO;
428 int rv=pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶ms);
431 fprintf(
logfile,
"%s %i some problem setting priority %i for tid %li error %i\n", __FILE__, __LINE__,
RTPRIO, pthread_self(), rv);