Commit Graph

199 Commits

Author SHA1 Message Date
David Reiss
6319133cac THRIFT-25. csharp: Various compiler and library improvements
Compiler:
- Thrift structures are serializable.
- The member fields of thrift structures are now private and only accessible
  through Properties, which keep the appropriate __isset up to date.

Library
- Addition of TBufferedTransport, which can be used to wrap other Transports.
- Addition of TThreadedServer, which manually manages threads instead of
  relying on .NET ThreadPool.
- Servers use a log delegate that defaults to System.Console but allows
  servers to use log4net without introducing the dependency.

ThriftTest Visual Studio Project
- Test client and server that use ThriftTest.thrift. The project references
  thrift.exe and Thrift.dll from the subversion tree and automatically builds
  generated code. This makes it very easy to test changes in both the compiler
  and library.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732079 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:22 +00:00
David Reiss
25be92bf0d THRIFT-222. java: Better exposure if __isset in beans style
- Generate an isSet method for each field to test its set-ness.
- Generate a generic isSet method that checks by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731722 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:58 +00:00
David Reiss
5455f00348 THRIFT-138. java: Fix copy constructor for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731719 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:48 +00:00
T Jake Luciani
41687fc6cf THRIFT-193: Patch for proper namespace support in perl compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728863 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:45:43 +00:00
David Reiss
a8efac862a THRIFT-225. java/cpp: Handle non-i32 integer constants properly
Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:28:13 +00:00
David Reiss
a230999667 THRIFT-121. Support arbitrary type annotations
Adds syntax for attaching arbitrary key/value pairs to types.
These annotations can be accessed by individual generators to alter
the code they produce.

This version supports annotations on container types and structures.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@724954 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 01:52:48 +00:00
David Reiss
0c87ad41ee THRIFT-217. Use "--gen py" instead of "-py" in build scripts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722333 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:11:13 +00:00
David Reiss
603d50437c THRIFT-138. java: Create deep-copy constructors for Thrift structs
- Create a copy constructor for every Thrift struct.  The constructor
  performs a deep copy on the argument, resulting in no shared state.
- Make thrift structions implement Cloneable and implement .clone()
  using the copy constructor.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:06:31 +00:00
David Reiss
04c315946c THRIFT-81. java: TNonblockingServer: Support a limit on read buffer size
This change makes it possible to set a maximum amount of memory that
TNonblockingServer will use for all read buffers (combined).
If it is exceeded, no new data will be read from clients until
memory is freed.  The current implementation does a busy wait in
the main thread when this happens.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719741 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 23:07:05 +00:00
David Reiss
30a9360e3f THRIFT-172. java: Improve toString output for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719720 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:31:36 +00:00
David Reiss
c26da0a391 THRIFT-202: java: Fix "make check"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719407 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 22:22:23 +00:00
David Reiss
74421273ad THRIFT-67. python: Add TNonblockingServer
This TNonblockingServer is very similar to the C++ implementation.
It assumes the framed transport, but it uses select instead of libevent.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712306 13f79535-47bb-0310-9956-ffa450edef68
2008-11-07 23:09:31 +00:00
David Reiss
1cc0c5e6d6 THRIFT-109. python: Use self.assert* instead of assert in tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705734 13f79535-47bb-0310-9956-ffa450edef68
2008-10-17 19:30:35 +00:00
David Reiss
8d07e1d152 s/ENABLE_RUBY/WITH_RUBY/ for consistency.
This didn't happen in r666490 because the Ruby stuff was developed
in a separate branch.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675857 13f79535-47bb-0310-9956-ffa450edef68
2008-07-11 08:04:12 +00:00
Kevin Clark
4bd8916b12 Merge branch 'fastbinary'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 00:47:49 +00:00
David Reiss
af78778acd (THRIFT-54) Remove "frameResponses" from TNonblockingServer
TNonblockingServer and TFramedTransport used to have the option to only
frame messages on one side of the communication.  This capability was
removed from TFramedTransport because it was poorly implemented and not
useful.  This change removes it from TNonblockingServer as well, and
removes references to it in some of the C++ test code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673791 13f79535-47bb-0310-9956-ffa450edef68
2008-07-03 20:29:34 +00:00
David Reiss
03b574fead (THRIFT-5) A TNonblockingServers (single-threaded and thread-pool) for Java
This patch adds two Thrift servers for Java that both use non-blocking I/O
to avoid locking up worker threads for idle connections.  The two classes are
- TNonblockingServer, which supports single-threaded serving
- THsHaServer, which performs I/O in one thread and method invocations in
  a configurable thread pool.
To support these servers, TNonblockingServerSocket and TNonblockingSocket
have been added.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673550 13f79535-47bb-0310-9956-ffa450edef68
2008-07-02 23:55:04 +00:00
David Reiss
f14541626d Partial handlling of 64-bit integer constants.
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.

I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work.  However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:45:47 +00:00
David Reiss
6b082755f0 (THRIFT-61) Fix "make check" for the C++ library by not doing empty flushes.
I changed the behavior of TFramedTransport when flush is called without
writing any data to the transport.  This broke the unit test, which was
relying on a weird corner of TFramedTransport's behavior in order to do
some stricter checking.  I altered the unit test to never flush without
writing and added a new test to verfy the "empty flush" behavior.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672881 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 19:48:04 +00:00
Kevin Clark
45671689ea Fix odd bug in integration tests where it passed the wrong args to an Exception struct initializer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668987 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:17 +00:00
Kevin Clark
41c0a0266b Improve compatibility with the old Hash-style set.
Fix the integration test for the Set change


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668960 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:28 +00:00
Kevin Clark
d639ac13b5 Fix the last of the deprecated names in tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668938 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:18 +00:00
Kevin Clark
9d33041a1b Fix name usage in tests. Remove test for TTransport as it really wasn't testing anything useful.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668937 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:03 +00:00
Kevin Clark
dd8ef9ef53 Remove test_remappings because it isn't comprehensive and it's triggering undesired warnings. This should be re-created as a spec.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668936 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:03:48 +00:00
Kevin Clark
adfdf39dd3 Clean up the last few deprecation warnings in the tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668922 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:59:56 +00:00
Kevin Clark
f85e793494 Fix up thrift/thrift to only require the the files that define the classes it used to hold. This fixes the existing tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668912 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:56:48 +00:00
Kevin Clark
2960044415 rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:13 +00:00
Kevin Clark
c669efa48b rb: Add deprecate! method Rename TTransport#readAll/isOpen, and deprecate
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668899 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:26 +00:00
Kevin Clark
a7e7c04e9d rb: Switch to dyn generator syntax for testing namespaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668898 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:05 +00:00
Kevin Clark
d5c98eedc8 Exercise namespacing in Ruby tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668897 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:51:45 +00:00
Kevin Clark
720b5732cc Swap out 'tests' target for 'check' in Ruby Makefile
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668896 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:51:25 +00:00
Kevin Clark
a37d90e6cb Add tests for Ruby TTransport. Only require .rb files in ruby tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668892 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:50:00 +00:00
Kevin Clark
28580f4544 Reorganize tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668890 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:49:17 +00:00
Kevin Clark
18cb21a125 Tweak Ruby Makefile to use --gen syntax
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668889 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:48:56 +00:00
David Reiss
82c1bab8f3 Rename AM_CONDITIONALs from ENABLE_* to WITH_*.
This is to match the configure command-line options that define them.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666490 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:53 +00:00
David Reiss
c6c6498b02 Allow out-of-source builds.
- Clean up lib/cpp/Makefile.am to use AM_CXXFLAGS etc instead of
  target-specific so we can take advantage of default flags.
- Use top_builddir in a few places instead of top_srcdir.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666489 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:45 +00:00
David Reiss
1a14091adc Allow Thrift to be built without the Python library.
- Modify configure.ac to check for Python conditionally, like we do for
  Java, Mono, and Erlang.
- Modify Makefile.am to add "py" to SUBDIRS only if Python was detected.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666488 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:37 +00:00
David Reiss
cc0c9e98b5 Clean up some bad/missed merges from the alterl merge.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666486 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:29 +00:00
David Reiss
cb13729795 [erl] Finish fixing test_server to work with binary strings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666485 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:15 +00:00
David Reiss
a59191b5ef [erl] fix test_server to expect binary type for strings rather than lists
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666484 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:09 +00:00
David Reiss
9f2a5d7799 Rename "alterl" to "erl".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:45 +00:00
David Reiss
844540669e Add thrift_base64_transport which writes base64 encoded data
Summary:
  This is to make it easy to run Hadoop mapreduces using Hadoop Streaming on thrift-serialized structs
  without implementing any special file splitter or anything

Test plan: test_disklog:t_base64()


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666466 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:12:31 +00:00
David Reiss
65cf720b19 Add thrift_client:send_call which sends a function call but doesn't read a response.
Summary:
  This is for logging applications with thrift_disk_log_transport, so the function calls
  logged don't necessarily have to be async void

Test plan:
  Added to test_disklog.erl


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666465 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:12:20 +00:00
David Reiss
6d477592fa Add thrift_disk_log_transport which writes to the disk_log module
Summary:
  See test/erl/src/test_disklog.erl for example usage

Test plan: test_disklog:t(), then hexdump -C /tmp/test_log.1


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666464 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:12:09 +00:00
David Reiss
55ff70f8d6 Implement TApplicationException handling in alt_erl client
Summary:
  Throws a 'TApplicationException' record

Test plan:
  Changed cpp TestServer so that if testException is called with "ApplicationException" as an argument, it throws a TException which is serialized back as an EXCEPTION type message


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666421 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:58:25 +00:00
David Reiss
8cf694d62d Change alterl thrift_server to use non-blocking TCP calls and properly set the processor as the controlling process for the client sockets.
Summary:
  - Removes the non-OTP "acceptor" process
  - The processor becomes the socket's controlling process instead of the transport, which is kind of messy, but it means we don't have to make a process for the socket_transport.
  - See http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles for non-blocking server info

Test plan:
  - Ran ThriftTest and StressTest


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666417 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:57:54 +00:00
David Reiss
cdf8d1994a Implement async_void in alterl bindings
Summary:
  - reply_type for async void functions is now async_void instead of
    the empty struct definition
  - async void functions should return "ok". otherwise the processor
    will crash and the connection will be killed. Is this behaviour
    expected?

Test Plan: tested using testAsync() in ThriftTest. Didn't used to work
           but works now


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666415 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:57:35 +00:00
David Reiss
abded23ed4 Implement testAsync for python tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666412 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:57:01 +00:00
David Reiss
c85a695588 Add mkdir ${TARGET_DIR} to erl test Makefile since the empty ebin/ dir doesn't stay in git
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666411 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 00:56:55 +00:00
David Reiss
60b50cf385 Add stress test implementation for new Erlang
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666389 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:59:10 +00:00