Skip to content

Commit

Permalink
FLUME-669: Changes required for recent Thrift IDL and Makefile update…
Browse files Browse the repository at this point in the history
…d with recent directory structure
  • Loading branch information
Dani Rayan authored and Jonathan Hsieh committed Jun 20, 2011
1 parent 3881b32 commit e547332
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions contrib/flogger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
CC = g++
SRCS = src/cpp/ThriftThinFlumeRPC.cpp
THRIFT_SRCS = gen-cpp/ThriftFlumeEventServer.cpp gen-cpp/flume_constants.cpp gen-cpp/flume_types.cpp src/cpp/ThriftThinFlumeRPC.cpp
FLUME_THRIFT_IDL = ../../flume-core/src/main/thrift/flume.thrift
OBJS = gen-cpp/ThriftFlume.o gen-cpp/ThriftFlumeConstants.o gen-cpp/ThriftFlumeTypes.o

.PHONY: all
Expand All @@ -34,8 +35,8 @@ flogger: ${OBJS}

${OBJS}: ${THRIFT_SRCS}

${THRIFT_SRCS}: ../../src/thrift/flume.thrift
thrift --gen cpp ../../src/thrift/flume.thrift
${THRIFT_SRCS}: ${FLUME_THRIFT_IDL}
thrift --gen cpp ${FLUME_THRIFT_IDL}

.PHONY: clean
clean:
Expand Down
13 changes: 7 additions & 6 deletions contrib/flogger/src/cpp/ThriftThinFlumeRPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace apache::thrift::transport;
/*
* The main function takes -h localhost:port-number and -t tag_key:value as arguments.
* It forms a flume event structure with time-stamp taken from the system clock and hostname.
* It sends the request to the flume node listening on the host-port specified
* It sends the request to the flume node listening on the host-port specified
* Returns 0 on success, returns 1 on failure, error codes not yet defined
*/

Expand All @@ -52,9 +52,9 @@ int main(int argc, char **argv) {
switch(argc)
{
case 3:
if(0 == strcmp(argv[1], HOST_ARG)) {
if(0 == strcmp(argv[1], HOST_ARG)) {
host_port = argv[2];
} else {
} else {
cout << "\tUsage: [-h <hostname>:<port>] is mandatory" << endl;
exit(1);
}
Expand Down Expand Up @@ -125,7 +125,7 @@ int main(int argc, char **argv) {
cerr << "\n\tError: Cannot get hostname" << endl;
exit(1);
}

map <string,string> tag;
if(argc == 5)
{
Expand All @@ -143,14 +143,15 @@ int main(int argc, char **argv) {
*/

ThriftFlumeEvent evt;
evt.priority = INFO;
Priority evt_priority;
evt.priority = evt_priority.INFO;
struct timespec t_nanos;
if(0 == clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t_nanos)) {
evt.nanos = t_nanos.tv_sec * 1000000000LL + t_nanos.tv_nsec;
} else {
cerr << "\n\tCannot read process cputime clock, quitting";
exit(1);
}
}

struct timespec t_stamp;
if(0 == clock_gettime(CLOCK_REALTIME, &t_stamp)) {
Expand Down

0 comments on commit e547332

Please sign in to comment.