hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-933. Warning fix for gpnetbench.
Date Tue, 19 Jul 2016 02:32:16 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master f6223ad74 -> 69f3c9026


HAWQ-933. Warning fix for gpnetbench.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/69f3c902
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/69f3c902
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/69f3c902

Branch: refs/heads/master
Commit: 69f3c9026892bc9c6937ed132fa45716d7912a8f
Parents: f6223ad
Author: xunzhang <xunzhangthu@gmail.com>
Authored: Tue Jul 19 09:49:38 2016 +0800
Committer: xunzhang <xunzhangthu@gmail.com>
Committed: Tue Jul 19 09:49:38 2016 +0800

----------------------------------------------------------------------
 tools/gpnetbench/gpnetbenchClient.c | 36 +++++++++++++++++---------------
 tools/gpnetbench/gpnetbenchServer.c | 10 +++++----
 2 files changed, 25 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/69f3c902/tools/gpnetbench/gpnetbenchClient.c
----------------------------------------------------------------------
diff --git a/tools/gpnetbench/gpnetbenchClient.c b/tools/gpnetbench/gpnetbenchClient.c
index d95f8a9..4669d16 100644
--- a/tools/gpnetbench/gpnetbenchClient.c
+++ b/tools/gpnetbench/gpnetbenchClient.c
@@ -29,25 +29,11 @@
 #include <sys/time.h>
 
 #define INIT_RETRIES 5
+void usage(void);
 void send_buffer(int fd, char* buffer, int bytes);
-void print_headers();
+void print_headers(void);
 double subtractTimeOfDay(struct timeval* begin, struct timeval* end);
 
-void usage()
-{
-	fprintf(stdout, "usage: gpnetbench -p PORT -H HOST [-l SECONDS] [-t EXPERIMENT] [-f UNITS]
[-P HEADERS] [-b KB] [-h]\n");
-	fprintf(stdout, "where\n");
-	fprintf(stdout, "       PORT is the port to connect to for the server\n");
-	fprintf(stdout, "       HOST is the hostname to connect to for the server\n");
-	fprintf(stdout, "       SECONDS is the number of seconds to sample the network, where the
default is 60\n");
-	fprintf(stdout, "       EXPERIMENT is the experiment name to run, where the default is TCP_STREAM\n");
-	fprintf(stdout, "       UNITS is the output units, where the default is M megabytes\n");
-	fprintf(stdout, "       HEADERS is 0 (don't) or 1 (do) display headers in the output\n");
-	fprintf(stdout, "       KB is the size of the send buffer in kilobytes, where the default
is 32\n");
-
-	fprintf(stdout, "       -h shows this help message\n");
-}
-
 int main(int argc, char** argv)
 {
 	int socketFd;
@@ -188,9 +174,24 @@ int main(int argc, char** argv)
 	return 0;
 }
 
+void usage()
+{
+	fprintf(stdout, "usage: gpnetbench -p PORT -H HOST [-l SECONDS] [-t EXPERIMENT] [-f UNITS]
[-P HEADERS] [-b KB] [-h]\n");
+	fprintf(stdout, "where\n");
+	fprintf(stdout, "       PORT is the port to connect to for the server\n");
+	fprintf(stdout, "       HOST is the hostname to connect to for the server\n");
+	fprintf(stdout, "       SECONDS is the number of seconds to sample the network, where the
default is 60\n");
+	fprintf(stdout, "       EXPERIMENT is the experiment name to run, where the default is TCP_STREAM\n");
+	fprintf(stdout, "       UNITS is the output units, where the default is M megabytes\n");
+	fprintf(stdout, "       HEADERS is 0 (don't) or 1 (do) display headers in the output\n");
+	fprintf(stdout, "       KB is the size of the send buffer in kilobytes, where the default
is 32\n");
+
+	fprintf(stdout, "       -h shows this help message\n");
+}
+
 void send_buffer(int fd, char* buffer, int bytes)
 {
-	size_t retval;
+	ssize_t retval;
 
 	while(bytes > 0)
 	{
@@ -235,3 +236,4 @@ void print_headers()
 	printf("               Size     Time     Throughput\n");
 	printf("n/a   n/a      bytes    secs.    MBytes/sec\n");
 }
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/69f3c902/tools/gpnetbench/gpnetbenchServer.c
----------------------------------------------------------------------
diff --git a/tools/gpnetbench/gpnetbenchServer.c b/tools/gpnetbench/gpnetbenchServer.c
index abe1afd..e25c13b 100644
--- a/tools/gpnetbench/gpnetbenchServer.c
+++ b/tools/gpnetbench/gpnetbenchServer.c
@@ -31,10 +31,7 @@ char* receiveBuffer = NULL;
 
 void handleIncomingConnection(int fd);
 
-void usage()
-{
-	fprintf(stdout, "usage: gpnetbenchServer -p PORT [-h]\n");
-}
+void usage(void);
 
 int main(int argc, char** argv)
 {
@@ -149,6 +146,11 @@ int main(int argc, char** argv)
 	return 0;
 }
 
+void usage()
+{
+	fprintf(stdout, "usage: gpnetbenchServer -p PORT [-h]\n");
+}
+
 void handleIncomingConnection(int fd)
 {
 	ssize_t bytes;


Mime
View raw message