Skip to content

Commit e2c5212

Browse files
committed
for data ingestion
0 parents  commit e2c5212

File tree

653 files changed

+136321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

653 files changed

+136321
-0
lines changed

.gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
!thirdparty/
2+
.idea
3+
.vscode/*
4+
*.Po
5+
*.a
6+
*.dat*
7+
*.doxyfile
8+
*.o
9+
*sql.output
10+
.cproject
11+
.gitignore.swp
12+
.git.bak
13+
.history
14+
.project
15+
.settings
16+
/test
17+
Build
18+
CLAIMS.config
19+
CLAIMS.creator*
20+
CLAIMS.files
21+
CLAIMS.includes
22+
Config.cpp
23+
Debug.h
24+
Default
25+
Makefile
26+
Makefile.in
27+
aclocal.m4
28+
ar-lib
29+
autom4te.cache/
30+
bin/
31+
build
32+
claims.log
33+
claims_log/
34+
ginkgo_log/
35+
ginkgo
36+
claimsserver
37+
client
38+
compile
39+
conf
40+
conf/config
41+
config.guess
42+
config.h
43+
config.h.in
44+
config.h.in*
45+
config.h.in~
46+
config.log
47+
config.status
48+
config.sub
49+
configure
50+
depcomp
51+
doc
52+
include/
53+
install-sh
54+
install/
55+
libtool
56+
log
57+
ltmain.sh
58+
missing
59+
sbin/.claimssserver.pid
60+
sbin/2-claims-conf/claims_log/
61+
sbin/2-claims-conf/config-*
62+
sbin/2-claims-conf/test_for_DI_GetTuple
63+
sbin/2-claims-conf/
64+
sbin/claims-test/claims_log/
65+
sbin/claims-test/test_for_DI_GetTuple
66+
sbin/claims-test/testresult/
67+
sbin/claims-test/testresult/*.result
68+
sbin/claims_log/
69+
sbin/logs/
70+
stamp-h1
71+
test_for_DI_GetTuple
72+
thirdparty/
73+
缺省值

BuildStep.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
setup steps:
2+
3+
1. ./build.sh init
4+
2. mkdir build
5+
3. cd build
6+
4. ../configure --prefix=/your/install/path
7+
5. make -j8
8+
6. make install
9+
10+
cleanup steps:
11+
12+
1 make distclean
13+
2 ./build.sh clean
14+
15+
Claims info:

CMakeLists.txt

+2,483
Large diffs are not rendered by default.

Client.cpp

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
/*
2+
* Client.cpp
3+
*
4+
* Created on: Sep 25, 2014
5+
* Author: wangli
6+
*/
7+
#include <stdlib.h>
8+
#include <unistd.h>
9+
#include <stdio.h>
10+
#include <fstream>
11+
#include <string>
12+
#include "./startup.h"
13+
#include "Client/ClientResponse.h"
14+
#include "Client/Client.h"
15+
#define GLOG_NO_ABBREVIATED_SEVERITIES
16+
#include "common/log/logging.h"
17+
#include "common/Block/ResultSet.h"
18+
#include "utility/command_line.h"
19+
#include "utility/rdtsc.h"
20+
21+
void readStrigFromTerminal(string& input) {
22+
while (true) {
23+
std::cin.clear();
24+
std::cin.sync();
25+
std::string str;
26+
if (getline(std::cin, str)) {
27+
bool finish = false;
28+
for (unsigned i = 0; i < str.length(); i++) {
29+
if (str[i] == ';') {
30+
input += str.substr(0, i + 1);
31+
finish = true;
32+
break;
33+
}
34+
}
35+
if (finish) break;
36+
input += str + " ";
37+
}
38+
}
39+
}
40+
41+
void submit_command(Client& client, std::string& command) {
42+
ResultSet rs;
43+
std::string message;
44+
switch (client.submit(command, message, rs)) {
45+
case Client::result:
46+
rs.print();
47+
// if(i!=0)
48+
// total_time+=rs.query_time_;
49+
break;
50+
case Client::message:
51+
printf("%s", message.c_str());
52+
break;
53+
case Client::error:
54+
printf(
55+
"\e[0;31m"
56+
"%s\033[0m\n",
57+
message.c_str());
58+
break;
59+
default:
60+
assert(false);
61+
break;
62+
}
63+
}
64+
65+
void submit_command_repeated(Client& client, std::string& command,
66+
int repeated) {
67+
double total_time = 0;
68+
for (int i = 0; i < repeated; i++) {
69+
ResultSet rs;
70+
std::string message;
71+
switch (client.submit(command, message, rs)) {
72+
case Client::result:
73+
if (i != 0) total_time += rs.query_time_;
74+
break;
75+
case Client::message:
76+
printf("%s", message.c_str());
77+
break;
78+
case Client::error:
79+
printf(
80+
"\e[0;31m"
81+
"%s\033[0m\n",
82+
message.c_str());
83+
break;
84+
default:
85+
assert(false);
86+
break;
87+
}
88+
}
89+
}
90+
void PrintUsage() {
91+
cout << "Welcome to use Ginkgo. " << endl;
92+
cout << "Type: " << endl;
93+
cout << "\t help; for usage of Ginkgo." << endl;
94+
cout << "\t copyright; for distribution terms." << endl;
95+
cout << "\t exit; or shutdown; for exiting Ginkgo." << endl;
96+
}
97+
98+
void PrintCopyright() {
99+
cout << "Copyright [2012-2015] DaSE@ECNU " << endl
100+
<< " Licensed to the Apache Software Foundation (ASF) under one or more"
101+
<< " contributor license agreements. See the NOTICE file distributed "
102+
"with"
103+
<< " this work for additional information regarding copyright ownership."
104+
<< " The ASF licenses this file to You under the Apache License, "
105+
"Version 2.0"
106+
<< " (the \" License\"); you may not use this file except in compliance "
107+
"with"
108+
<< " the License. You may obtain a copy of the License at" << endl
109+
<< " http://www.apache.org/licenses/LICENSE-2.0" << endl
110+
<< " Unless required by applicable law or agreed to in writing, software"
111+
<< " distributed under the License is distributed on an \" AS IS \" "
112+
"BASIS,"
113+
<< " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or "
114+
"implied."
115+
<< " See the License for the specific language governing permissions and"
116+
<< " limitations under the License." << endl;
117+
}
118+
int main(int argc, char** argv) {
119+
/* Client */
120+
121+
if (argc != 3) {
122+
printf(
123+
"argc=%d, Illegal input. \nPlease use client master_ip "
124+
"client_listener_port.\n",
125+
argc);
126+
printf(
127+
"HINT: the master ip and the client_listener_port can be found in the "
128+
"configure file.\n");
129+
return 0;
130+
}
131+
132+
ginkgo::common::Logging claims_logging(argv[0]);
133+
print_welcome();
134+
PrintUsage();
135+
136+
Client client;
137+
client.connection(argv[1], atoi(argv[2]));
138+
std::cout << std::endl;
139+
init_command_line();
140+
141+
while (1) {
142+
std::string command, message;
143+
144+
get_one_command(command);
145+
146+
command = trimSpecialCharactor(command);
147+
148+
if (command == "exit;" || command == "shutdown;") {
149+
break;
150+
} else if (command.empty()) {
151+
continue;
152+
} else if (command == "help;") {
153+
PrintUsage();
154+
continue;
155+
} else if (command == "copyright;") {
156+
PrintCopyright();
157+
continue;
158+
}
159+
160+
submit_command(client, command);
161+
162+
/*
163+
* the following command execute the query for a given time and p
164+
* rint the averaged query response time.*/
165+
// submit_command_repeated(client,command,50);
166+
}
167+
client.shutdown();
168+
}

0 commit comments

Comments
 (0)