Skip to content

Commit bb3e1af

Browse files
author
Yingjun Wu
committed
minor tweaks
1 parent 43c2f50 commit bb3e1af

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

rsync.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ rsync -arv src/ yingjunw@cmu:~/peloton-client/src/
22
ssh yingjunw@cmu "rsync -arv ~/peloton-client/src/ dev2.db.pdl.cmu.local:~/peloton-client/src/"
33
rsync -arv include/ yingjunw@cmu:~/peloton-client/include/
44
ssh yingjunw@cmu "rsync -arv ~/peloton-client/include/ dev2.db.pdl.cmu.local:~/peloton-client/include/"
5+
rsync -arv scripts/ yingjunw@cmu:~/peloton-client/scripts/
6+
ssh yingjunw@cmu "rsync -arv ~/peloton-client/scripts/ dev2.db.pdl.cmu.local:~/peloton-client/scripts/"
57
scp Makefile yingjunw@cmu:~/peloton-client/Makefile
6-
ssh yingjunw@cmu "scp ~/peloton-client/Makefile dev2.db.pdl.cmu.local:~/peloton-client/"
8+
ssh yingjunw@cmu "scp ~/peloton-client/Makefile dev2.db.pdl.cmu.local:~/peloton-client/"

scripts/populate.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ if [ "$#" -ne 2 ]; then
44
echo "The table size will be scale_factor * 1000."
55
exit 1;
66
fi
7-
../peloton_client -y populate -i $1$ -k $2$
7+
if [ "$1" -ne 0 ]; then
8+
../peloton_client -y populate -i -k $2$
9+
else
10+
../peloton_client -y populate -k $2$
11+
fi

src/client_program.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void Populate(pqxx::connection &conn, const ClientConfig &config) {
1111

1212
std::cout << ">>>>> Populate table \'employee\'. " << std::endl
1313
<< " -- Build index? : " << config.with_index_ << std::endl
14-
<< " -- Table size : " << table_size << std::endl;
14+
<< " -- Table size : " << table_size << std::endl;
1515

1616
pqxx::work txn(conn);
1717

@@ -60,7 +60,7 @@ void ProcessClient(pqxx::connection &conn, const ClientConfig &config) {
6060
} else {
6161
// select
6262
pqxx::result R = txn.prepared("read")(key).exec();
63-
printf("txn result set size = %lu\n", R.size());
63+
printf("key = %lu, txn result set size = %lu\n", key, R.size());
6464
}
6565
}
6666
} else {
@@ -74,7 +74,7 @@ void ProcessClient(pqxx::connection &conn, const ClientConfig &config) {
7474
} else {
7575
// select
7676
pqxx::result R = txn.exec("SELECT name FROM employee WHERE id=" + std::to_string(key) + ";");
77-
printf("txn result set size = %lu\n", R.size());
77+
printf("key = %lu, txn result set size = %lu\n", key, R.size());
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)