Commit Graph

391 Commits

Author SHA1 Message Date
Mark Slee
fe6ed0dff4 Clean up the TSerializer
Summary: Nested Transport subclass wasn't necessary, add comments

Reviewed By: dreiss

Test Plan: Same as before, test/java/TestClient


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665369 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 21:54:38 +00:00
Mark Slee
256bdc4448 IPv6 tweaks for Thrift
Summary: Need to pass hints including AI_ADDRCONFIG to getaddrinfo to make sure no IPv6 addresses come back on non-IPv6 enabled systems

Reviewed By: mcslee

Other Notes: Submitted by Paul Saab


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665368 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:42:19 +00:00
Mark Slee
844ac12489 TJSONProtocol writing support in Java
Summary: TJSONProtocol for Java with write support and a TSerializer utility for easier conversion of Thrift objects into byte[] or strings.

Reviewed By: dreiss

Test Plan: Included a basic piece of this in test/ client for Java.

Revert: OK

DiffCamp Revision: 3890


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665367 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:38:52 +00:00
Mark Slee
53d9c0c20b Merging EOFException changes from Ben Maurer
Summary: Throw a proper EOFError in this case. Long term we want to change this to properly fit into the Thrift TException heirarchy with a good way to handle the original exception as well. For now, Ben is the primary user of this so we'll go ahead with his patch.

Reviewed By: mcslee

Test Plan: Included in test/py/TestEof.py


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665365 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 21:15:40 +00:00
Mark Slee
79b1694043 Refactor TNonblockingServer to use event_base construct
Summary: This allows the event loop to be shared across different components of a program of for a separate thread in a TNonblockingServer to safely use its own libevent code without conflicts.

Reviewed By: mcslee

Test Plan: Updated test/ committed here

Other Notes: submitted by Ben Maurer, patched in by mcslee with slight modifications


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665364 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 19:05:29 +00:00
Mark Slee
bd5882259d Merging in some Smalltalk changes from Patrick Collison
Reviewed By: mcslee

Test Plan: Rebuild Thrift compiler


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665361 13f79535-47bb-0310-9956-ffa450edef68
2007-11-21 08:43:35 +00:00
Mark Slee
efd37f14d2 Add Smalltalk support to Thrift
Summary: Submitted by Patrick Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665358 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 05:13:09 +00:00
Mark Slee
a1d4cab45f Make Java TBinaryProtocol default to strictWrite
Summary: About time we did this. Breaks the test suite's defaults


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665357 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 04:58:16 +00:00
Mark Slee
276eea68b7 Add (int) case to Thrift version comparison
Summary: Deals with 32 bit machines doing a weird sign-bit thing here.

Reviewed By: dreiss

Test Plan: For 32 bit AmieStreet partners


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665356 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 02:06:47 +00:00
Mark Slee
8440605c27 Cocoa Thrift binding patches from Andrew McGeachie
Summary: Latest updates to the Cocoa bindings


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665354 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 01:39:25 +00:00
Mark Slee
fb4b514028 IPv6 support for the TNonBlockingServer
Summary: Need to use IPv6 compliant constructs here. Submitted by Paul Saab.

Reviewed By: dreiss

Test Plan: Rebuild Thrift TNonblockingServer with this patch and verify behaves just the same


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665353 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 01:27:08 +00:00
hzhao
b6014f494f added trunk
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665352 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:54:30 +00:00
hzhao
7fcc9e87ba tagging thrift-protocol-1.0.0
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665351 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:48:56 +00:00
Christopher Piro
de11d85211 [thrift] gut Erlang exception handling
Summary: * move type field to tException from subclasses
          * add backtrace to tException
          * add oop:is_a
          * on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
          * all throws/exits to tException:throw which does the wrapping described above

Reviewed By: eletuchy

Test Plan: been using this code on my live server ^_^

Revert: OK


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 02:10:20 +00:00
Mark Slee
09f69e0524 Add __autoload() support to Thrift-generated PHP code
Summary: Include thrift/autoload.php and use -phpa flag to generated code that works with autoload. Good for services with lots of methods that are typically not all invoked.

Reviewed By: dreiss

Test Plan: Falcon, baby, falcon.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665349 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:32:36 +00:00
Mark Slee
f5a6b0c109 Fix PHP TBufferedTransport readAll() to work with TSocket timeouts
Reviewed By: lucas

Test Plan: Invoke Buffered Transport wrapped around socket


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665348 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:27:17 +00:00
dweatherford
611434992a [thrift] Fix extension deserialization call with no classname
Summary: The extension expects a classname as a string and does not allow null;
  use the empty string instead of null in the absence of a classname to pass.

Reviewed By: mcslee
Test Plan: php -l
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665347 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 03:29:47 +00:00
Christopher Piro
10522a7f2b [thrift] fix-ups to Erlang thrift_logger
Summary:
 * no ?INFO for every oop:call ... way too expensive
 * unfactor symbol/1 ... it was that way for a reason apparently
 * upped crash report depth to 3

Reviewed By: eletuchy

Test Plan: /much/ less CPU eaten by logging

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665343 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:31 +00:00
Christopher Piro
c2e37c7a61 [thrift] change up Erlang crash reports, cleanups in t{,Binary}Protocol
Summary: crash reports aren't too important so don't be so verbose -- all the pertinent info shows up elsewhere anyway.  refactor while we're at it.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665342 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:30 +00:00
Christopher Piro
53b6ef670c [thrift] whole ball of whitespace normalizations in Erlang
Summary: ill-formatted comments, trailing whitespace, and (gasp) tabs: all pwned.  better now than later.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665339 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:28 +00:00
Christopher Piro
a1650fe55c [thrift] make open and close `effectful' in Erlang client
Summary: make uniform across all tTransports.  god i want `effectful' to go away dead.  soon.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665338 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:27 +00:00
Christopher Piro
3121c8271f [thrift] Erlang client receive socket options
Summary: we want {active, false}, etc. for client sockets.  make it so.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665337 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:26 +00:00
Christopher Piro
0d5cd8a6b9 [thrift] Erlang makefile includes to terse messages
Summary: filter out compiler path and flags and cruft

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665336 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:59 +00:00
Christopher Piro
6c74062262 [thrift] convert oop.erl errors and infos to macros
Summary: old-style error messages get switched over

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665335 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:58 +00:00
David Reiss
465ccc0924 Thrift: Fix new-style generated PHP code.
Summary:
Fix reading of lists/sets of lists/sets/maps.

Reviewed By: mcslee

Test Plan: Tested in trunk.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665333 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 21:41:29 +00:00
Mark Slee
0cdc6c8cd9 Merging PHP transport changes from www trunk to thrift trunk
Summary: Some empty() fixes, plus a few other socket helpers

Reviewed By: lucas

Test Plan: Use the transports to make IPC calls!


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665331 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 10:19:08 +00:00
Mark Slee
2b786221ed Fixing typo in Thrift trunk
Summary: xter => xfer

Reviewed By: sgrimm


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665329 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 05:35:34 +00:00
Mark Slee
5b743079da Thrift PHP generation Redux
Summary: Chopping the amount of code generated by Thrift for PHP services by two orders of magnitude (approx 25% of the previous size). This is done via putting more logic in a dynamic base class and taking it out of the generated code. Hopefully this wins back the CPU cycles paid just to load code from APC at the cost of a marginal increase in dynamic execution runtime.

Reviewed By: sgrimm, dreiss

Test Plan: Ran all the tests in trunk/test/php, also tested the API generate code and Falcon, etc. in my sandbox


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665328 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 04:00:29 +00:00
David Reiss
c0c88ee805 Thrift: Perl HttpClient and fixes.
Summary:
Also updated the CONTRIBUTORS file.  Sorry, Boz.

Reviewed By: mcslee

Revert Plan: ok

Other Notes:
Submitted by Igor Afanasyev.
Reviewed by Jake Luciani.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665327 13f79535-47bb-0310-9956-ffa450edef68
2007-11-08 01:05:46 +00:00
Mark Slee
6eb5892662 Deal with UnsupportedEncodingException in TBinaryProtocol
Summary: In case you are running on a horrendous JVM that doesn't have UTF-8 support

Reviewed By: dreiss

Test Plan: Compile.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665326 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 00:48:47 +00:00
Aditya Agarwal
3788038a35 -- ensure that flush is called in close() of any wrapper transport
Summary:
- unflushed data should be flushed when transport is closed
- this diff calls flush for TBufferedTransport and TFramedTransport

Reviewed By: dreiss


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665323 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 06:33:06 +00:00
Mark Slee
0502e61fb9 Add programatic shutdown option to Java Thrift servers
Summary: Same paradigm as in C++ model. Allow ServerTransport to be interrupted to block an accept loop and cleanly stop serving client requests.

Reviewed By: dreiss

Test Plan: Invoke shutdown() method on a TServer


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665322 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 05:30:32 +00:00
Mark Slee
52182d674e Make Java TbinaryProtocol enfore UTF-8
Summary: Java Strings have to have an encoding, they can't just be binary. The constructor and getBytes() method enforce this, so we are standardizing on UTF-8 to avoid string-mangling.

Reviewed By: dreiss

Test Plan: Code all works the exact same in the normal case, and doesn't mangle characters beyond ASCII or ISO-LATIN-1


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665321 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 04:48:43 +00:00
lklots
ffc21fb792 [TMemoryBuffer: an in-memory buffer acting like a transport]
Summary: This is the php equivalent of the cpp TMemoryBuffer.
         It is simply a transport that stores read and fetches write
         requests to and from a string.

Trac Bug: #

Blame Rev:

Reviewed By: dreiss

Test Plan: Tested using thrift de/serialization. Wrote thrift objeccts
           to the buffer and then read them later to resconstruct them.
           Tested exceptional cases.

Revert Plan: ok

Database Impact: none

Memcache Impact: none

Other Notes:

EImportant:

- begin *PUBLIC* platform impact section -
Bugzilla: #
- end platform impact -


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665320 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 23:01:27 +00:00
hzhao
b000f7433d [thrift_protocol] need negative testing for default inclusion
Reviewed By: dweatherford
Test Plan: dev026 build


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665319 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 03:18:28 +00:00
dweatherford
f36e484cfb [thrift] return empty string instead of NULL
Summary: Turns out they're different, oops
Reviewed By: marcel
Test Plan: recompile, reinstall, synapse:tablet.get() on a nonexistent cell (which returns an empty string)
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665318 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 02:22:25 +00:00
boz
8ebe4a1757 THRIFT: update the thrift extension
Summary: more ZTS stuff

Reviewed By: hzhao

Test Plan: the same tests still pass


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665316 13f79535-47bb-0310-9956-ffa450edef68
2007-11-01 07:37:45 +00:00
dweatherford
80940b70e8 [thrift] Merge protocol/transport changes from tfb/www
Summary: Supporting the thrift_protocol extension.
  Relevant changesets are r66531, r66700, r66708
Reviewed By: mcslee
Test Plan: same code already runs in tfb trunk, php -l
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665315 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 23:30:56 +00:00
dweatherford
51c0393620 [thrift] PHP thrift_protocol extension
Summary: Implement a deserializer for thrift integral types and containers
  in C++ for extra performance. To be combined with compiler support to
  generate code that uses the extension + TBinaryProtocolAccelerated to
  enable it.

Reviewed By: mcslee
Test Plan: runs fine in my sandbox...
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665312 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 04:22:12 +00:00
dweatherford
65b7075b5a [thrift] Output dir selection + updated TSCons
Summary: Allows setting the output directory via the new '-o dir' cmdline option.

  TSCons is updated to use this to put the output in the right place no matter
  the cwd, so doing dependent builds from different directories won't break.

Reviewed By: martin
Test Plan: mkdir /tmp/honk; thrift -cpp -java -javabean -php -phpi -py -rb -xsd -perl -erl -ocaml -hs -cocoa -o /tmp/honk Tablet.thrift
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665311 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 02:18:14 +00:00
Mark Slee
3e098b1757 Fix handling of ruby write parameters due to nil vs false
Summary: Need to check for != nil, not just boolean expression

Reviewed By: mcslee

Test Plan: Send a boolean "false" value

Other Notes: Patch submitted by Patrick Collison


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665310 13f79535-47bb-0310-9956-ffa450edef68
2007-10-30 16:55:47 +00:00
David Reiss
5e60901123 Thrift: Reorganize Cocoa library.
Summary:
External patch from Andrew McGeachie.
Just shuffle the Cocoa library files around.

Reviewed By: mcslee

Test Plan: In Andrew we trust.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665309 13f79535-47bb-0310-9956-ffa450edef68
2007-10-24 03:35:36 +00:00
Christopher Piro
6c46f1a8c9 [thrift] gut Erlang Thrift configuration; start using get_env
Summary: I patterned some config stuff after iserve, but Erlang's built-in stuff is better

Reviewed By: gopher

Test Plan: works with recent ch server

Revert Plan: ok

Other Notes: default config given in thrift.app


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665307 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 09:47:15 +00:00
Christopher Piro
3b63fe4d3c [thrift] clean up error logging in Erlang
Summary: pushed all formatting out of thrift_error_logger.erl, reenable crash logs, standardize

Reviewed By: eletuchy

Test Plan: works with latest ch server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665305 13f79535-47bb-0310-9956-ffa450edef68
2007-10-19 21:34:31 +00:00
dweatherford
14b0ed6fad [thrift] TSocket host and port getters
Summary: "Porting" this feature from PHP; I find it useful in the Synapse client.
Reviewed By: mcslee
Test Plan: It compiles, ship it!
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665304 13f79535-47bb-0310-9956-ffa450edef68
2007-10-19 01:03:32 +00:00
David Reiss
2b9ddab14c Thrift: Kill a warning.
Summary:
These should always have been const.

Reviewed By: mcslee

Test Plan:
Re-ran the dense protocol test.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665303 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 03:39:55 +00:00
Christopher Piro
524c3ecef7 [thrift] make thrift_logger.erl more robust against badmatch
Summary: more robust logic theres

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: the precommit hooks should forbid out-of-towners from being cited as reviewers


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665301 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 05:15:33 +00:00
Christopher Piro
b6dcd2b595 [thrift] retool oop.erl, fix tBufferedTransportFactory.erl
Summary: oop.erl used to assume that an undef or function_clause meant a method wasn't defined, but sometimes a method does exist and an undef happens while it's executing.

Case in point, getTransport in tBufferedTransportFactory totally didn't work and instead of exiting, oop.erl fell back silently to tTransportFactory, so everywhere I thought I was talking to tBufferedTransport, I was talking directly to the tSocket.  borkborkbork.

Blame: all me baby

Reviewed By: eletuchy

Test Plan: channel server works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665299 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 01:11:46 +00:00
dweatherford
d1372829e6 [thrift] TSocketPool::addServer, c++ version
Summary: Same thing as the previous PHP change. Also includes a new constructor for easy building of a TSocketPool with a single host (for later filling in via addServer) without extra std::vector boxing/unboxing.

Reviewed By: mcslee

Test Plan: Synapse c++ client at r62896 uses this.

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 909


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665297 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 22:57:23 +00:00
Mark Slee
34b2926d5c Java Thrift objects implement common base interface
Reviewed By: dreiss

Test Plan: Generate java code and run against new library.

Revert: OK

DiffCamp Revision: 900


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665296 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 20:55:10 +00:00