Commit Graph

5786 Commits

Author SHA1 Message Date
Mark Slee
9e288d4f7a Add some smaller test cases and fix new single protocol/transport C++ test
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664944 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 23:42:12 +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
Mark Slee
c42ecd5cfe No more getInputTransport vs getOutputTransport in protocols
Summary: It is just getTransport ow

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664941 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 22:57:20 +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
bf05a6069e Generate pargs an presult helpers in C++ to be more efficient in thrift
Summary: Copy construction is the pits. Avoid it at all costs.

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664939 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 22:53:07 +00:00
Mark Slee
1921d2046b Fix C++ Thrift test code to work with new gen'd code interface
Reviewed By: tbr-aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664938 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 19:43:06 +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
Mark Slee
8896a54720 No need to generate private __construct() function if the class is already final
Reviewed By: lucas


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664935 13f79535-47bb-0310-9956-ffa450edef68
2007-01-23 23:22:35 +00:00
Mark Slee
f49041c083 Use proper name for catching exceptions
Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664934 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 23:49:00 +00:00
Mark Slee
eb08f9e680 Thrift XSD generator populates PHP globals with type names for typedeffed stuffs
Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664933 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 22:12:10 +00:00
Mark Slee
36bfa2e61f Allow field elements to be optional in thrift with xsd_optional keyword
Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664932 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 20:09:51 +00:00
Mark Slee
b6200d82f6 Add comma-separated list of type "slist" to thrift
Summary: Useful for API arguments

Reviewed By: tbr-dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664931 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 19:14:36 +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
Mark Slee
782abbb756 Add xsd_all keyword to Thrift
Summary: Makes a struct an xsd_all instead of a sequence

Reviewed By: dave


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664929 13f79535-47bb-0310-9956-ffa450edef68
2007-01-19 00:17:02 +00:00
Mark Slee
0e0ff7e003 Thrift now generates XSD files
Summary: Are you fucking kidding me? This shit is robust.

Reviewed By: fetter-tbr-d00d


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664928 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 22:59:59 +00:00
Mark Slee
ace6e6dbc0 Resolve typedefs in php generation
Reviewed By: xsd


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664927 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 20:00:11 +00:00
Mark Slee
06098d7586 Remove py compiler from thrift repo
Summary: This keeps confusing people when they try to do make and make install, we always have it around in the svn repo, so we can take it out of current trunk.

Reviewed By: martin


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664926 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 18:35:26 +00:00
Mark Slee
032606bb72 Fix changing struct name bug on C++ generation
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664925 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 06:54:43 +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
Mark Slee
f3763a1fae Do not generate write code for null fields in Java
Summary: It will make null pointer exceptions!

Reviewed By: martin, alex


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664923 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 02:35:27 +00:00
Mark Slee
7628fd7444 Add mkdir for bin in thrift compiler
Reviewed By: dcorson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664922 13f79535-47bb-0310-9956-ffa450edef68
2007-01-18 01:16:51 +00:00
Mark Slee
12f6631735 Fix bugs with php_namespace keyword in thrift
Reviewed By: aditya

 line, and those below, will be ignored--

M    t_php_generator.cc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664921 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 19:19:21 +00:00
Karl Lehenbauer
893ef724c3 Fix identifier typo in Thrift error message.
Trac Bug: #

Reviewed By:

Test Plan:
The correct error message appears when a PHP Thrift client can't
connect to a server.  Set that up, and try and get the error message:

[Wed Jan 17 10:41:41 2007] [error] TSocketPool: retryInterval (60) has
passed for host dev007:8188

...then you're good.  If you get something about a undefined property,
then this fix didn't work.

Revert Plan: Revertible


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664920 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 18:56:10 +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
Mark Slee
5ec19933cb Resolve complex typedefs in Thrift
Summary: For function returns

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664917 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 23:53:53 +00:00
Mark Slee
a340e0d6fe Thrift should generate C++ enums first before typdefs
Summary: In case you want to typedef an enum

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664916 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 23:00:31 +00:00
Mark Slee
406a40cf16 Prefix generated _args and _result helper classes with service name
Summary: To avoid conflicts when you have two services with the same name inside one .thrift file

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664915 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 22:48:22 +00:00
Marc Slemko
d95abdd918 Added autoconf/automake glue to run lib/py/setup.py as part of make install
Reviewed by mslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664914 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 22:20:19 +00:00
robert
b0fac3ee66 Fixed some warnings, changed TSocketPool to inherit debugHandler from TSocket
reviewed: mcslee
revert: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664913 13f79535-47bb-0310-9956-ffa450edef68
2007-01-15 23:53:25 +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
1c989f2c78 Added open, close, and isOpen to TFramedTransport
reviewed: mcslee
revert: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664911 13f79535-47bb-0310-9956-ffa450edef68
2007-01-15 18:29:51 +00:00
Mark Slee
a45909b619 Thrift C++ code generator returns complex types by reference
Summary: Efficiency, Yo.

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664910 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 21:44:14 +00:00
Mark Slee
529bfeef97 Committing code gen changes for const ref args to functions in Thrift
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664909 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 02:10:16 +00:00
Mark Slee
e888b376ad Add PHP namespacing support to Thrift
Summary: "php_namespace Whoa" at the top of your Thrift file, then all your defined class names start with "Whoa_"

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664908 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 01:06:24 +00:00
Mark Slee
f12865a338 Disallow keywords in Thrift files
Summary: Or else you are bound to get shitty errors in some generated languages.. They're not all covered here, but a lot of them are.

Reviewed By: dougb, bobby


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664907 13f79535-47bb-0310-9956-ffa450edef68
2007-01-12 00:23:26 +00:00
Adam Nichols
2f816f28e6 minor syntax change in thrift php library, reviewed by slee, revertible
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664906 13f79535-47bb-0310-9956-ffa450edef68
2007-01-11 21:25:29 +00:00
Mark Slee
e7714a6c09 Fix call_user_func bug on debugHandler_
Reviewed By: lucas


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664905 13f79535-47bb-0310-9956-ffa450edef68
2007-01-11 01:26:00 +00:00
Mark Slee
a4713ea566 Example syntax for constants in Thrift
Reviewed By: martin


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664904 13f79535-47bb-0310-9956-ffa450edef68
2007-01-05 01:09:04 +00:00
Mark Slee
ad58f952bc Add options to thrift transport classes for custom error handlers
Summary: So we can pass debug_rlog (facebook custom) in as a handler for errors to thrift (generic open source)

Reviewed By: lucas


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664903 13f79535-47bb-0310-9956-ffa450edef68
2007-01-03 19:23:50 +00:00
Mark Slee
a09e34efb0 Fix typo class variable bug in TSocketPool
Reviewed By: corson


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664902 13f79535-47bb-0310-9956-ffa450edef68
2007-01-03 18:45:04 +00:00
putnam
fde62cb223 Fixed typo in Thrift README
Summary:
  locacation? COME ON GUYS.

Review:
  peter

Test plan:
  I read it, then re-read it, then re-re-read it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664901 13f79535-47bb-0310-9956-ffa450edef68
2006-12-22 10:35:12 +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
Mark Slee
706da40237 Fix exceptions throw() and virtual destructor
Reviewed By: yishan


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664897 13f79535-47bb-0310-9956-ffa450edef68
2006-12-16 00:59:29 +00:00
Mark Slee
971fda34b5 All user-defined thrift exceptions inherit from TException
Summary: So you can catch more effectively

Reviewed By: tbr-karl


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664896 13f79535-47bb-0310-9956-ffa450edef68
2006-12-15 19:07:04 +00:00
Mark Slee
0524bcee68 Another AccessNull bug fix in Thrift
Reviewed By: yhishan


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664895 13f79535-47bb-0310-9956-ffa450edef68
2006-12-13 01:54:56 +00:00