Commit Graph

1340 Commits

Author SHA1 Message Date
David Reiss
b7762a032a THRIFT-922. cpp: Update C++ generator to emit templatized code
When the "templates" option is passed to the C++ generator, it now emits
templatized versions of the client and processor.  Generated types emit
templatized read() and write() functions.

This allows the generated code to invoke the correct non-virtual
TTransport and TProtocol implementations, resulting in faster
serialization and deserialization.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005138 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:10:00 +00:00
David Reiss
8dfc732af6 THRIFT-922. cpp: Fix C++ compilation when using list<bool>
The STL specializes vector<bool> to store the values as individual bits, rather
than bools.  Therefore, when using a Thrift list<bool>, readBool() gets invoked
not with a bool&, but with a std::vector<bool>::reference.

TProtocol does provide a readBool(std::vector<bool>::reference) implementation.
However, almost all TProtocol subclasses defined only readBool(bool&), which
hides the other overloaded versions of readBool().  As a result, the code
worked only when accessing TProtocol objects via a "TProtocol*", and not
directly via the subclass type.  When using C++ templates, protocol objects do
get invoked via pointers to the subclass type, causing compile failures when
std::vector<bool> is used.

This change updates the various TProtocol implementations to also provide
readBool(std::vector<bool>::reference).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005137 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:58 +00:00
David Reiss
e71115be6c THRIFT-922. cpp: Templatize binary and compact protocol
Convert TBinaryProtocol and TCompactProtocol to template classes, taking
the transport class as a template parameter.  This allows them to make
non-virtual calls when using the template, improving serialization
performance.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005136 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:56 +00:00
David Reiss
6806fb836a THRIFT-922. cpp: Convert protocol classes to use non-virtual functions
Updated the thrift protocol classes to use non-virtual calls for most
functions.  The correct implementation is determined at compile time via
templates now.  Only the base TProtocol class falls back to using
virtual function calls.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005135 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:52 +00:00
David Reiss
e879c2f4db THRIFT-922. cpp: Convert transport classes to use non-virtual calls
Update the thrift transport classes to use non-virtual calls for most
functions.  The correct implementation is determined at compile time via
templates now.  Only the base TTransport class falls back to using
virtual function calls.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005134 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:50 +00:00
David Reiss
72fd0b415f THRIFT-922. cpp: Add shortcutted version of readAll() in TBufferBase
Just perform a memcpy() if all of the requested data is available in the
buffer.  This improves performance a little in the common case.  It has
a bigger impact with the upcoming template changes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005133 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:47 +00:00
David Reiss
ea051ca793 THRIFT-922. cpp: When reading strings, borrow first
Attempt to get a pointer to the internal transport buffer before copying
onto the heap.  This improves performance TFramedTransport and
TMemoryBuffer, and with TBufferedTransport if the string fits within the
buffer.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005132 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:46 +00:00
David Reiss
ef7200f6e8 THRIFT-928. cpp: Include request/response size in processor callbacks
Required updating transport interface.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005129 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:42 +00:00
David Reiss
18cd0f0334 THRIFT-928. cpp: Make clients call writeEnd on their transports before flush
Changing the order of these calls makes more sense from the perspective
of logical operations.  It also simplifies the upcoming stats collection
code.  No clients should be affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005128 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:39 +00:00
David Reiss
5ddabb8e3f THRIFT-923. cpp: Implement a fully nonblocking server and client
There are three major parts of this:
1/ New callback-style interfaces for for a few key Thrift components:
   TAsyncProcessor for servers and TAsyncChannel for clients.
2/ Concrete implementations of TAsyncChannel and a server for
   TAsyncProcessor based on evhttp.
3/ Async-style code generation for C++

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005127 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:37 +00:00
David Reiss
d7192063e1 THRIFT-928. cpp: Processor-level event callbacks
- Add a TProcessorEventHandler callback interface.
- Add methods to TProcessor to hold an instance of the interface.
- Add code to the compiler to make the processor call callbacks at key points.
- Add an optional processor event handler to the test server.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005126 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:33 +00:00
David Reiss
8c535ab87c THRIFT-922. cpp: Revert the BufferBase part of r750585
r750585 included two logically distinct changes, one of which was not
referenced in the commit message and was not reviewed by a C++
maintainer.  It was committed more-or-less by accident.  This patch
reverts that part of the change since it conflicts with the template
code in some complicated ways.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005125 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 17:09:31 +00:00
Bryan Duxbury
1df96ce22f THRIFT-945. java: TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.
This patch adds a test for the problem and fixes the issue by setting the current method after a call has been started.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004865 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:28:10 +00:00
Bryan Duxbury
ded25bbe0d THRIFT-941. php: Make PHP C Extension use the defined Protocol writeMessageBegin function
This patch causes the C extension to call into user-land to get the correct writeMessageBegin function.

Patch: Chris Goffinet

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004864 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:23:30 +00:00
Bryan Duxbury
c657447e0e THRIFT-932. hs: Haskell tests need to be run through 'make check' (and probably 'cabal check') too
Tests are now self-contained and correctly exit after running. There's a single run script which has improved error messages and defaults to the thrift binary compiled in the current source directory instead of those in PATH. And as a bonus hooks both cabal check and running the tests to make check. 

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004861 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:12:33 +00:00
Bryan Duxbury
ffca7e1720 THRIFT-944. hs: Support all version-4s of base
Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004859 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:01:43 +00:00
Anthony F. Molinaro
371372e832 THRIFT-933 : looks fine, and cabal check looks good as well
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004716 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 17:08:08 +00:00
Anthony F. Molinaro
687c412c10 THRIFT-943: fix typo
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004709 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 16:47:52 +00:00
David Reiss
3e07a8f233 erlang: Use Automake SUBDIRS instead of a manual forwarding rule
Previously, lib/erl/Makefile.am would forward rules like "all" and
"clean" to the src subdir by manually invoking a submake.  However,
specifying src as a SUBDIR accomplishes this more easily and also
ensures that other rules like "distclean" work.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004510 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 02:38:59 +00:00
David Reiss
653eadab2f THRIFT-841. Exclude generated php and erlang Makefiles from "make dist"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004509 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 02:38:58 +00:00
Roger Meier
8a441a46ad THRIFT-940 use BOOST_LDFLAGS for unit tests, required to build on Mac OS X
Patch: Christian Lavoie


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004431 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 21:13:36 +00:00
Bryan Duxbury
5bb525ccf9 THRIFT-939. java: optional binary fields throw NPE on default byte[] getters
This patch deals with null ByteBuffers correctly.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1003212 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30 19:36:05 +00:00
Bryan Duxbury
e1ae6b45d5 bump versions to 0.6.0
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1002294 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 17:44:45 +00:00
Bryan Duxbury
a18364ac88 THRIFT-900. cpp: Unix domain socket
This patch adds a new Unix Socket transport.

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1002179 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 14:36:07 +00:00
Todd Lipcon
b1a283f11e THRIFT-912. java: Fix some bugs in SASL implementation, update protocol spec slightly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001973 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 00:11:01 +00:00
Todd Lipcon
84a7c2a901 THRIFT-931. java: Add log4j.properties missing from previous commit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001971 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 00:02:53 +00:00
Todd Lipcon
fcaa8f5364 THRIFT-931. java: Use log4j for Java tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001967 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 23:51:22 +00:00
Anthony F. Molinaro
fa6eaca762 THRIFT-919 : updated haskell README
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001830 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 17:33:47 +00:00
David Reiss
abafd79aee THRIFT-335. python: Initial implementation of TCompactProtocol
Seems to work.  No interoperability testing with other languages yet.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001827 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 17:28:15 +00:00
Anthony F. Molinaro
a5df7c7b0e THRIFT-905: hook haskell into autoconf
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001823 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 17:22:17 +00:00
Bryan Duxbury
3a3686fd51 THRIFT-917. java: THsHaServer should not accept an ExecutorService without catching RejectedExecutionException
This patch catches RejectedExecutionException from requestInvoke and closes the client connection when that occurs.

Patch: Ed Ceaser

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001820 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 17:12:36 +00:00
Anthony F. Molinaro
daef1c8ed0 THRIFT-743: seems to compile and doesn't break other tests, so seems fine for now
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001353 13f79535-47bb-0310-9956-ffa450edef68
2010-09-26 04:25:36 +00:00
Anthony F. Molinaro
7466bcd5d7 THRIFT-914 : haskell bindings compile easier
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1000653 13f79535-47bb-0310-9956-ffa450edef68
2010-09-23 22:28:09 +00:00
Bryan Duxbury
75a33e858f THRIFT-906. hs: Improve type mappings
This patch fixes the type mappings to be more sane. It *will* break existing code, but the breakages should be well worth it.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999700 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 00:48:56 +00:00
Bryan Duxbury
6a1fb17a25 THRIFT-909. rb: allow block argument to struct constructor
This patch allows the user to pass a block to generated structs' constructors. The block will receive and instance of the new object.

Patch: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999487 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 16:30:58 +00:00
Bryan Duxbury
1237dcb099 THRIFT-880. javame: JavaME code generator and runtime library
This patch adds a new generator and library that produces code suitable for use in JavaME environments.

Patch: David Engberg

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999022 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:49:09 +00:00
Bryan Duxbury
e59a80fbf9 THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
This patch makes the bindings compile with pedantic warning levels, and individually declares each required language extension.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998955 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 15:21:37 +00:00
Bryan Duxbury
fd32d79afa THRIFT-323. csharp: TJSONProtocol
This patch adds support for the JSON Protocol to the csharp library. 

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998539 13f79535-47bb-0310-9956-ffa450edef68
2010-09-18 20:51:25 +00:00
T Jake Luciani
416eea9802 THRIFT-885: fix string encoding
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998371 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 23:38:25 +00:00
Bryan Duxbury
83c4795870 THRIFT-899. rb: Ruby read timeouts can sometimes be 2x what they should be
This patch makes sure that we don't wait longer than necessary for timeouts.

Patch: Ryan King

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998303 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 20:17:21 +00:00
Bryan Duxbury
d920765c66 THRIFT-882. java: deep copy of binary fields does not copy ByteBuffer characteristics (arrayOffset, position)
This patch ensures that binary fields are copied correctly.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998275 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 19:27:36 +00:00
Bryan Duxbury
a7420b6593 THRIFT-894. java: Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version
This patch causes the underlying ByteBuffer that backs a binary field to be hidden behind a default accessor that provides a byte[] interface. This should allow users who skipped 0.4 to update their generated code without breaking any of their other code. A new accessor has been added that allows a way down to the underlying ByteBuffer for those experts who want to take advantage.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996579 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 15:42:36 +00:00
Bryan Duxbury
a4c6d64e80 java: tiny improvement to async client manager test, for real this time
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996329 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:31:50 +00:00
Bryan Duxbury
a97414674c java: tiny improvement to async client manager test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996328 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:30:06 +00:00
Bryan Duxbury
13ad873d18 THRIFT-896. java: TNonblockingSocket.isOpen() returns true even after close()
This patch makes TNonblockingSocket.isOpen() have more expected behavior.

Patch: Eric Jensen

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995939 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 19:08:00 +00:00
Bryan Duxbury
34628f3e7a THRIFT-250. java: ExecutorService as a constructor parameter for TServer
This patch adds a new constructor that accepts an ExecutorService.

Patch: Ed Ceaser

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995847 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 16:16:01 +00:00
Bryan Duxbury
855294b213 THRIFT-888. java: async client should also have nonblocking connect
This patch adds optional nonblocking connect behavior.

Patch: Eric Jensen

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995262 13f79535-47bb-0310-9956-ffa450edef68
2010-09-08 21:47:45 +00:00
Bryan Duxbury
d483712972 THRIFT-876. java: Add SASL support
This patch adds support for a SASL-secured transport to the Java library. In its current form, it only works for the blocking-IO servers.

Patch: Aaron T Meyers

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@993563 13f79535-47bb-0310-9956-ffa450edef68
2010-09-08 00:06:35 +00:00
Anthony F. Molinaro
ef16420d54 THRIFT-698 - fix .app file, remove unused parts of build system, updated LICENSE to reflect changes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@993207 13f79535-47bb-0310-9956-ffa450edef68
2010-09-07 03:35:30 +00:00
Bryan Duxbury
7a0825c34d THRIFT-856. cpp: Building cpp library fails on OS X with malloc and free not being declared in scope
This patch adds include which seems to fix the problem for some people.

Patch: James Clarke

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992013 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 16:42:18 +00:00