Commit Graph

84 Commits

Author SHA1 Message Date
Mark Slee
b3cb62959e Adding threaded server to Thrift
Summary: Spawns a new thread for each client connection

Reviewed By: marc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664965 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 22:55:00 +00:00
Mark Slee
7a20a14a06 Fix bufferedroutertransport overflow bugs
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664964 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 21:39:50 +00:00
Mark Slee
cb126a0c19 Fix for TBufferedTransport double-buffer-size strings
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664961 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 08:31:29 +00:00
Mark Slee
aaa23ed4ea Move var declarations out of switch blocks in Thrift
Summary: Strict G++ compliance

Reviewed By: fett


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664958 13f79535-47bb-0310-9956-ffa450edef68
2007-01-30 19:52:05 +00:00
Martin Kraemer
50919171b7 Thrift: indentation
Summary:
sigh mixed indentation sytyles.

Reviewed By: Slee

Test Plan: Test by building..

Revert Plan: revertible

Notes:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664952 13f79535-47bb-0310-9956-ffa450edef68
2007-01-26 01:41:03 +00:00
Mark Slee
0788a70568 Separate thrift into libthrift and libthriftnb
Summary: libthriftnb is the one that requires libevent. It was really annoying that you always had to put -levent in your link step to build thrift programs when youa re not using any of the c++ nonblocking stuff. This way, if you're using nonblocking you can do that, but the normal case is easier to link.

Reviewed By: makefile


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664951 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 08:14:50 +00:00
Mark Slee
eb0d024ee1 Full automake/autoconf compliance for thrift
Summary: Including the compiler!!!

Reviewed By: automake


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664949 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 07:58:55 +00:00
Aditya Agarwal
2c9f2fb0bd -- ThriftLogfile is finally done.
Summary:
- Everything seems to be working well..

Reviewed By: tbr - slee

Test Plan: Tested using search


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664947 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 03:27:43 +00:00
Aditya Agarwal
68f08ee5f5 -- Error recovery code for thrift logfile
Summary:
- perform some basic corruption checks:
   1) Event larger than chunk
   2) Event larger than specified max
   3) Event crossing chunk boundary etc.
- If error encountered, then try to perform some recovery

Reviewed By: Slee

Test Plan: Going to test now...need to check in because of compile issues

Notes:
- These checks take care of the case when there is a dirty read from the filesystem (which
  we have encountered with the netapps). The recovery involves trying to perform the read
  again from ths FS and if that fails skipping the chunk altogether.
  Keep in mind that this might only be useful for idempotent systems (e.g. search redolog).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664943 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 23:39:10 +00:00
Mark Slee
c425780847 Thrift socket should not perror in the TRYAGAIN state
Reviewed By: wayne


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664942 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 23:14:30 +00:00
Aditya Agarwal
9abb0d69b7 -- Change concept of protocol and transport factory
Summary:
- Transport factories now wrap around one transport
- Protocol factories now wrap around one transport (as opposed to a pair of input/output
   transports)
- TServer now takes input/output transport and protocol factories

The motivation for this change is that you could concievably want to use a different protocol or
transport for input and output. An example is that incoming data is encoded using binary protocol
but outgoing data is encrypted XML (with encryption being done on the transport level).

This change should be mostly backwards compatible because the TServer classes have constructors
that take a transport factory and use that for both the input and transport factories. The only
change might be for anyone who is using the C++ client code directly i.e. instantiating
TBinaryProtocol() directly because the constructor now only accepts one transport.

Reviewed By: Slee

Test Plan: Everything compiles (for both thrift and search).

Notes:
I am going to make the same changes in all the supported languages after this...


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664940 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 22:53:54 +00:00
Mark Slee
f9373397c3 Nonblockingserver constructor that uses binary protocol factory by default
Reviewed By: tbr-aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664937 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 19:41:57 +00:00
Aditya Agarwal
502ea8a3c8 -- thrift logfile fixes
Summary:
-- numChunks was broken and that was causing a lot of strange downstream behaviour

Reviewed By: tbr slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664936 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 02:24:35 +00:00
Aditya Agarwal
1ea90526b0 -- Nonblocking server changes to allow logging
Summary:
-- the constructor needs to accept a transport factory
-- TConnection close() needs to close factor generated transports

Reviewed By: Mark Slee

Test Plan: Tested with search redologger


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664930 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 02:02:12 +00:00
Aditya Agarwal
794568bafe -- additions to ThriftLogfile
Summary:
-- fixed peek() in TBufferedRouterTransport.cpp
-- Added processChunk() to ThriftLogfile

Reviewed By: Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664924 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 06:20:24 +00:00
Marc Slemko
85ca7a13e8 Added ax_event_base.m4 to find and configure libevent
Modified configure.ac to pull in AX_EVENT_BASE
Modified Makefile.am to take EVENT settings from automake.

Reviewed by dcorson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664919 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 08:32:16 +00:00
Marc Slemko
75c2f702c9 Make boost base default to yes to make sure we don't get through configure without boost
Fixed configure.ac to add a few missing functions and headers

Reviewed by dcorson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664918 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 07:59:38 +00:00
Aditya Agarwal
ebc99e0e16 -- Allow manual setting of host and port in TSocket
Summary:
-- required for TSocketPool equivalent functionality

Reviewed By: slee

Notes:
-- Todo is to replicate TSocketPool.php in C++


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664912 13f79535-47bb-0310-9956-ffa450edef68
2007-01-15 23:14:58 +00:00
robert
79511192f1 fixed a problem with read buffer resizing in TNonblockingServer
reviewed: mcslee
revert: yes
test: send a large message to a nonblocking server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664900 13f79535-47bb-0310-9956-ffa450edef68
2006-12-20 19:25:38 +00:00
robert
3fa9d24bc3 fixed a bug in TFramedTransport where it was checking a size for nonzero after byte swapping it.
reviewed: mcslee
revert: yes
test: run a C++ client and server with framed transport


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664899 13f79535-47bb-0310-9956-ffa450edef68
2006-12-19 22:27:54 +00:00
Mark Slee
2abc9dfd59 message_ in TException can't be const or subclasses break
Reviewed By: yishan


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664898 13f79535-47bb-0310-9956-ffa450edef68
2006-12-16 01:06:49 +00:00
Martin Kraemer
8196a61745 Thrift TException Cleanup
Summary:
Destructors should be virtual or declared protected.

Reviewed By: mcslee

Revert Plan: revertible


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664892 13f79535-47bb-0310-9956-ffa450edef68
2006-12-09 01:57:58 +00:00
Aditya Agarwal
25b293616b -- Rename TBufferedFileWriter.h/cpp to TFileTransport.h/cpp
Summary:
-- Thrift logfile is now officially in action!

Reviewed By: Mark Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664891 13f79535-47bb-0310-9956-ffa450edef68
2006-12-09 00:58:15 +00:00
Aditya Agarwal
0c341a1332 -- Check all system call return values
Summary:
-- Throw TTransportException if a system call fails

Reviewed By: Mark Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664890 13f79535-47bb-0310-9956-ffa450edef68
2006-12-09 00:47:03 +00:00
Aditya Agarwal
e9ef8d7ce9 -- TFileTransport (Thrift Logfile)
Summary:
-- TBufferedFileWriter.h/cpp will be renamed to TFileTransport.h/cpp in the next commit.
-- TFileTransport is essentially reading and writing thrift calls to/from a file instead of a
   socket.
-- The code/design is somewhat similar to pillar_logfile but there are some significant changes.

todo:
-- still need to do error correction/detection

Reviewed By: Mark Slee

Test Plan:
-- Wrote test in thrift/test/cpp/src/main.cpp that appends to a file and replays requests

Notes:
It's finally time to port search over to Thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664889 13f79535-47bb-0310-9956-ffa450edef68
2006-12-08 23:52:57 +00:00
Martin Kraemer
97f9d60be8 Thrift TException does not properly define virtual what() method.
Summary:
Clients would elect to call the base class what() method instead of the derived version.  This results in
less than usable exceptions for debugging.

Reviewed By: Karl * mcslee

Test Plan:
Tested with local application in development.

Revert Plan:
revertible.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664887 13f79535-47bb-0310-9956-ffa450edef68
2006-12-06 19:52:16 +00:00
Mark Slee
3860c9a246 Fix TSimpleServer exception bug
Reviewed By: tbr-martin


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664886 13f79535-47bb-0310-9956-ffa450edef68
2006-12-06 00:13:42 +00:00
Mark Slee
b9ff32ae30 Thrift: C++ peek() method and TException not Exception
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664876 13f79535-47bb-0310-9956-ffa450edef68
2006-11-16 01:00:24 +00:00
Mark Slee
0f70d77333 Mutex was missing from libthrift build
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664858 13f79535-47bb-0310-9956-ffa450edef68
2006-10-28 00:51:14 +00:00
Mark Slee
63608e8017 Include <time.h> not "time.h"
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664855 13f79535-47bb-0310-9956-ffa450edef68
2006-10-26 05:06:26 +00:00
Aditya Agarwal
35ae1c784c -- Change thrift logging macros to have a T_ prefix
Summary:
-- don't want to cause naming conflicts with other packages/dirs

Reviewed By: Mark Slee

Test Plan: Compiled


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664851 13f79535-47bb-0310-9956-ffa450edef68
2006-10-26 03:31:34 +00:00
Mark Slee
4af6ed71e1 Change Thrift c++ to new protocol wrapping transport model
Summary: Also cleaned up excessive .h/.cpp files into Utils files

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664838 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 19:02:49 +00:00
Mark Slee
b3bd81f479 Change Thrift .cc files to be .cpp files
Summary: CPP R00lz, CC Drewlz

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664837 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 01:36:44 +00:00
Mark Slee
83303e1cf7 Allow optional framing of input/output in FramedTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664836 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 01:29:37 +00:00
Mark Slee
92f00fb022 Framing option for non blocking server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664835 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 01:28:17 +00:00
Aditya Agarwal
e528c76490 -- Thrift Log File
Summary:
-- This is the thrifty version of Pillar's batch_writer
-- Cleaned up a lot of the code in batch writer and made it conform to Thrift's strict coding standards
-- Added TBufferedRouterTransport.h/cc to actually route messsages via readEnd() to the file writer. It's
   not quite as easy to route the messages in Thrift as it was in Pillar

Reviewed By: Slee

Test Plan: Tested by making sure that the file was recording data

Notes:
-- The real correctness test will be when I finish writing TLogFileTransport (pillar_logfile.cpp).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664826 13f79535-47bb-0310-9956-ffa450edef68
2006-10-11 02:48:43 +00:00
Aditya Agarwal
be3f8d8c6d -- Adding TLogging.h
Summary:
-- This should have been part of the previous commit

Reviewed By: Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664825 13f79535-47bb-0310-9956-ffa450edef68
2006-10-11 02:43:25 +00:00
Aditya Agarwal
d622e966d2 -- Thrift fixes
Summary:
-- Made read buffering work (the buffer wasn't actually being used)
-- TServer now extends TRunnable (useful for testing)
-- Adding TLogging (the DEBUG and ERROR macros that we all know and love)

Reviewed By: Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664824 13f79535-47bb-0310-9956-ffa450edef68
2006-10-11 02:42:49 +00:00
Mark Slee
2f6404d9ae C++ Thrift coding style changes
Summary: Make underscore for class members consistent


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664818 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 01:37:40 +00:00
Mark Slee
2905078d16 Better socket timeout and options support for Thrift C++
Summary: Also compile without degugging symbols for the linked library

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664810 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 00:12:30 +00:00
Mark Slee
794993d278 Change run() to serve() in all Thrift server interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664799 13f79535-47bb-0310-9956-ffa450edef68
2006-09-20 01:56:10 +00:00
Mark Slee
dc8a2a2fc7 Use GNU Net implementation of htnoll and ntohll
Reviewed By: shire


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664798 13f79535-47bb-0310-9956-ffa450edef68
2006-09-19 22:20:18 +00:00
Mark Slee
9e7734dada Thrift: Rename chunked to framed transports
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664796 13f79535-47bb-0310-9956-ffa450edef68
2006-09-08 03:51:34 +00:00
Mark Slee
d788b2e046 Thrift TTransportFactory model for servers
Summary: Servers need to create bufferedtransports etc. around the transports they get in a user-definable way. So use a factory pattern to allow the user to supply an object to the server that defines this behavior.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664792 13f79535-47bb-0310-9956-ffa450edef68
2006-09-07 01:26:35 +00:00
Mark Slee
c98d050d65 Thrift: Added support for double type across all languages
Summary: Just for completeness cause I'm crazy. Let's never use these!

Notes: Also made thrift grammar support # style comments, so you can do this at the top of your files

#!/usr/local/bin/thrift --cpp

/**
 * This is a thrift def file youc an invoke directly and gen code!
 */

blah


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664789 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 02:42:25 +00:00
Aditya Agarwal
085267d60c -- added stubs for readEnd() and writeEnd()
Summary:
-- these are hook points that thrift_logger/logfile will integrate with..

Reviewed By: McSlee

Test Plan: Generated thrift code

Notes:
-- Thrift logfiles are soon coming to a netapp near you!


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664787 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 22:49:53 +00:00
Mark Slee
f5f2be46a3 Thrift: standardize coding style
Summary: Standardize indentation, spacing, #defines etc.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664784 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 21:05:31 +00:00
Mark Slee
4ecbebc099 Add multiserver generation to C++ Thrift
Summary: Autogen server that can encapsulates multiple server instances

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664782 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 00:14:21 +00:00
Mark Slee
78f58e2559 Thrift generation for Java
Summary: Java works, benchmark roundtrip at around 3ms, so right in between C++ and PHP


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664775 13f79535-47bb-0310-9956-ffa450edef68
2006-09-02 04:17:07 +00:00
Mark Slee
cfc0193d46 Thrift library updates, remove unsigned types
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664772 13f79535-47bb-0310-9956-ffa450edef68
2006-09-01 22:18:16 +00:00