Commit Graph

546 Commits

Author SHA1 Message Date
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
David Reiss
c0cce962ac Oops - forgot to add the test/erl/Makefile to git
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666387 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:58:58 +00:00
David Reiss
57b4d9a4ac Test server for erlang
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666385 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:58:39 +00:00
David Reiss
176ed368a3 Avoid a filename collision on case-insensitive filesystems.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666373 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:56:48 +00:00
David Reiss
bcaa2ad0d6 Python forking server should close connection in parent.
When a function called by the forking python thrift server throws an
exception the client will hang.  This happens because the parent of the
forked process does not properly close the socket fd.

Under normal operation the server operation completes and returns a value to
the client.  However, when an exception occurs the 'end' message is never
sent to the client so the client relies on a connection close to abort the
call (this is how the threading server works I believe).

This fails with the forking server because the parent process never closes
the socket fd.  The child has closed the fd at this point, but the
connection will not actually be closed until all open instances of the fd
are closed. Since the client is waiting for a message and the server never
closes it the client is forced to wait until a read timeout occurs many
minutes later.

This diff closes the parent's copy of the socket fd immediately after the
fork occurs.

I modified my load test server to throw an exception.  The client did not hang.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666363 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 22:55:26 +00:00
David Reiss
f9b5b12f4d Tweak Java Makefile.ams to fix "make distclean".
The Java Makefile.ams assume the existence of ANT, but "make distclean"
runs in the Java directories even if ENABLE_JAVA is off.  This change
makes the clean-local target handle the absence of ANT, fixing
"make distclean".


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665683 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 07:17:35 +00:00
David Reiss
28f298dd5d Memory-based transport rewrite.
The old implementations of the memory-based transports (TBufferedTransport,
TFramedTransport, and TMemoryBuffer) shared very little code and all worked
a bit differently.  This change unifies them all as subclasses of a single
base (TBufferBase) which handles the fast-path operations (when requests
can be satisfied by the buffer) with inline methods (that will eventually
be made nonvirtual in the template branch) and calls out to pure-virutal
methods to handle full/empty buffers.  All of the buffer-management is now
done in terms of "base and bound" pointers rather than "pos" integers.

These classes were moved to TBufferTransports.{h,cpp}.  The .h is included
in TTransportUtils for backwards compatibility.

Also added a "TShortReadTransport" to assist testing transports.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665676 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 06:17:36 +00:00
David Reiss
9a4edfa07f Properly handle constants of typedef'ed types.
Also throw an error in the compiler if we cannot generate a constant for a
declared const because of its type.  Added a test of this functionality in
ConstantsDemo.thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665675 13f79535-47bb-0310-9956-ffa450edef68
2008-05-01 05:52:50 +00:00
David Reiss
81c7fc01bf Add a missing include to Benchmark.cpp to make it build on Mac OS.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665667 13f79535-47bb-0310-9956-ffa450edef68
2008-04-28 02:51:44 +00:00
iproctor
8361bf0565 ocaml and haskell thrift clients now calling readMessageEnd
Summary: I neglected to make the call to readMessageEnd if the client read an app exception in the haskell and ocaml code. Fixed now. The test cases for both now also compile with the new ThriftTest.thrift (though haskell's is still not doing anything but echoing  the args)

Reviewed By: dreiss

Test Plan: Ran test code. This bug would actually never show up because there's only tbinaryprotocol implemented for these languages and that does nothing on a readMessageEnd.

Revert: OK

DiffCamp Revision: 11377


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665651 13f79535-47bb-0310-9956-ffa450edef68
2008-04-10 00:31:55 +00:00
David Reiss
1ffb61beaa Fix a bug in TPipedTransport that broke pipelining.
Previously, TPipedTransport wrote it's full buffer to the "pipe" and
fully reset its buffer on a readEnd.  This assumed that the buffer was
fully read at that point.  This is not the case if requests are pipelined.
This change makes it only pipe out the portion that has been read and
copy the unread portion to the beginning of the buffer.

Also add a test that verifies the new functionality.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665646 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:07:26 +00:00
David Reiss
e4db03d110 Add TFDTransport: a dead-simple wrapper around a file-descriptor.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665644 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 05:06:59 +00:00
David Reiss
2a4bfd6d0c Clean up the unit tests.
- Make Python tests cwd-agnostic.
- Use boost::test.
- Add a benchmark.
- Use a library to clean up test/Makefile.am.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665640 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 23:45:00 +00:00
David Reiss
3095aa1843 Add a test client and server for C#.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665633 13f79535-47bb-0310-9956-ffa450edef68
2008-04-02 22:10:17 +00:00
David Reiss
3000b5b1f1 Add an experiment to measure the likeliness that realloc will avoid a copy.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665625 13f79535-47bb-0310-9956-ffa450edef68
2008-03-31 21:38:29 +00:00
David Reiss
07ef3a930a Make the Perl generator use non-hardcoded namespaces.
- Make the Perl generator use program->get_namespace("perl")
  instead of program->get_perl_package()
- Eliminate the explicit "perl_package" in t_program.
- Deprecate the perl_package token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665624 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:39 +00:00
David Reiss
6a4b82c4b7 Make the Ruby generator use non-hardcoded namespaces.
- Make the Ruby generator use program->get_namespace("ruby")
  instead of program->get_ruby_namespace()
- Eliminate the explicit "ruby_namespace" in t_program.
- Deprecate the ruby_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665620 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:42:16 +00:00
David Reiss
320e45ce8b Make the Python generator use non-hardcoded namespaces.
- Make the Python generator use program->get_namespace("py")
  instead of program->get_py_module()
- Eliminate the explicit "py_module" in t_program.
- Deprecate the py_module token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665615 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:54 +00:00
David Reiss
9d65bf061f Make the C# generator use non-hardcoded namespaces.
- Make the C# generator use program->get_namespace("csharp")
  instead of program->get_csharp_namespace()
- Eliminate the explicit "csharp_namespace" in t_program.
- Deprecate the csharp_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665611 13f79535-47bb-0310-9956-ffa450edef68
2008-03-27 21:41:37 +00:00
David Reiss
ea5e75af3b Add Java JSON protocol implementation.
Implement full-featured JSON protocol, low-level base-64 encode/decode
methods, and related tests.

Conflicts (resolved by dreiss):

	test/java/build.xml


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665562 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:12:20 +00:00
David Reiss
4a8f46ca0b Add more complete base64 testing for C++ JSON protocol.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665559 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:12:07 +00:00
David Reiss
14feb4127c Generate quality overrides of hashCode for Thrift structs (in Java).
This feature is turned off by default because it adds a new dependency:
Apache Commons Lang.  This package seems enough like Boost that
I would be open to turning this feature on by default.

Also updated test/java/build.xml to use this new option.
ant test still passes.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665542 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:23 +00:00
David Reiss
3b15ebc251 Add support for .equals() to Java structs.
- Add a new method to t_java_generator that generates a .equals() method.
- Add a correct but useless implementation of hashCode for structs.
  (This is required by conventino when overriding .equals().)
- Add java_package to DebugProtoTest and OptionalRequiredTest.
- Add a new structure to OptionalRequiredTest to assist testing the behavior
  of .equals() with respect to null and unset fields.
- Clean up test/java/build.xml a bit.  (It still has a ways to go.)
- Add EqualityTest.java to test .equals().
- Add IdentityTest.java to test that writing and reading a structure
  preserves equality.

Tested by runnint atn test.
I also looked at the generated code for OptionalRequiredTest.thrift.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665541 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:19 +00:00
David Reiss
4ce2874fd5 Make limited reflection optional (off by default).
Limited reflection is deprecated, and it is slowing down compilation.
This change will disable generation of static reflection by default,
but it adds a command line argument to re-enable it.

Tested by running make check and building the C++ test client and server.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665520 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 07:45:05 +00:00
David Reiss
9db977f5bd Update test/Makefile.am to use the new compiler command-line format.
Tested by running make check.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665519 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 07:45:00 +00:00
David Reiss
771f8c797b Make the Java generator use non-hardcoded namespaces.
- Make the Java generator use program->get_namespace("java")
  instead of program->get_java_namespace()
- Eliminate the explicit "java_namespace" in t_program.
- Deprecate the java_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665514 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:25 +00:00
David Reiss
9a08dc6184 Make the C++ generator use non-hardcoded namespaces.
- Make the C++ generator use program->get_namespace("cpp")
  instead of program->get_cpp_namespace()
- Eliminate the explicit "cpp_namespace" in t_program.
- Deprecate the cpp_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665513 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 01:55:17 +00:00
David Reiss
2ca456a8ae Make "make clean" rules a bit more standard.
Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".

Reviewed By: marc

Test Plan: make clean


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68
2008-02-24 16:42:18 +00:00
David Reiss
ff50f28700 Add automake support for running the Java tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665496 13f79535-47bb-0310-9956-ffa450edef68
2008-02-23 22:07:46 +00:00
David Reiss
4f15f59bca Update TJSONProtocol to TSimpleJSONProtocol
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665495 13f79535-47bb-0310-9956-ffa450edef68
2008-02-23 22:07:43 +00:00
David Reiss
2845b52f47 Enhance C++ test client to make sure that async void is implemented properly
Summary:
Added another i32 test after the async test. If testAsync improperly
sends a response, then the i32 test will fail because the function
name won't match up, since it will be "off by one".

Test plan:
Tested cpp server and it works. Tested alterl server which
doesn't yet implement async void properly and verified failure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665486 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 02:11:52 +00:00
David Reiss
db893b617f Implement testAsync for python tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665485 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 02:11:48 +00:00
David Reiss
2ab6fe88e2 Add testAsync to ThriftTest.thrift which verifies async void works properly.
Summary:
  - testAsync takes a number of seconds to sleep. The test client makes sure
    that the RPC returns in less than 0.2 seconds even though it asks the server
    to sleep for 3 seconds.
  - Implemented this test for C++ and Java.

Test Plan:
  - ran cpp TestServer and TestClient and verified functionality
  - tested cpp and java test server/client against each other - tests passed


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665484 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 02:11:44 +00:00
David Reiss
9590a4c9cc Change test scripts for Java to point to libthrift.jar in source tree.
Summary:
  - They used to point at /usr/local/lib/libthrift.jar even though the build.xml pointed
    at a relative path in the source tree


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665483 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 02:11:39 +00:00
David Reiss
db0ea15310 Thrift: Add a full-featured JSON protocol for C++.
Summary:
This change adds a new and exciting protocol to Thrift.  It uses
RFC-compliant JSON as the wire protocol and is fully human readable.
(once a little whitespace has been inserted.)  Unlike the existing
JSON protocol for Java, which is intended to allow Thrift data to be
transferred to scripting languages, this protocol is lossless and fully
read-write.  It was written by Chad Walters of Powerset and reviewed
by David Reiss.

Tested by running make check.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665482 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 01:49:37 +00:00
David Reiss
9ff3b9d5fc Thrift: Python test improvements.
Summary:
- Add a serialization test for forwards/backwards compatibility.
- Hook the Python tests up to "make check".
- Miscellaneous changes to the Python tests.

Reviewed By: mcslee

Test Plan: Ran the test.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665480 13f79535-47bb-0310-9956-ffa450edef68
2008-02-15 01:10:23 +00:00
Mark Slee
22360b2f30 Use interfaces, not classes for Java gen
Summary: Not AbstractMap or HashSet, etc. use Map, List, Set

Reviewed By: dreiss

Test Plan: Generate Java code and build java tests

Other Notes: Submitted by Seth Falcon


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665470 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 00:18:32 +00:00
David Reiss
0c90f6f8af Thrift: Whitespace cleanup.
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:18:40 +00:00
David Reiss
f7baf549bc Thrift: Revamp TMemoryBuffer constructors.
Summary:
There were some weird cases where the implicit conversion from
const char* to std::string was causing the wrong constructor to be called.
There wasn't really a clean workaround, so we're dropping the string
constructors.

Reviewed By: mcslee

Test Plan:
Ran the test.
Grepped around the /projects tree for uses that had to fixed,
and fixed them.

Revert Plan: ok

Other Notes:
This risk was pointed out by Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665461 13f79535-47bb-0310-9956-ffa450edef68
2008-02-04 21:56:27 +00:00
David Reiss
8180c0c028 Thrift: "make check" support.
Summary:
Add a Makefile.am in the test directory that runs some of the test programs
when "make check" is executed.  Also removed some obsolete comments.

Reviewed By: mcslee

Test Plan:
Ran make check, saw all tests pass.
Ran make install, saw no test programs installed.
Ran ./cleanup.sh, saw a pristine workspace.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665458 13f79535-47bb-0310-9956-ffa450edef68
2008-02-04 21:14:14 +00:00
David Reiss
4637990013 Thrift: Fix a bug in a test program.
Summary:
This didn't get updated when the class was renamed.

Reviewed By: mcslee

Test Plan: Trust Chad Walters.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665456 13f79535-47bb-0310-9956-ffa450edef68
2008-02-04 19:23:57 +00:00
David Reiss
7f42bcf97c Thrift: C# Bindings.
Summary:
C# generator, library, and MS Build task contributed by imeem.

Reviewed By: mcslee

Test Plan:
Built the Thrift compiler and generated some C# code.
I'd love to say I installed Mono or Portable.NET and built the C# code,
but I did not.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665421 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 20:59:12 +00:00
Mark Slee
89f5716421 Ruby default values patch
Summary: Submitted by Dan Sully, reviewed by Kevin Clark

Reviewed By: dreiss

Test Plan: New ruby generated code with default vals, and new test scripts


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 00:53:08 +00:00
David Reiss
832b262aca Thrift: Revamp build to use a single configure.ac.
Summary:
Ben Maurer suggested that it would make sense for Thrift to build as
a single project, with one configure.ac and multiple Makefile.am.
He was also kind enough to do the heavy lifting, and this commit
is the application of his patch (with minor modifications).
The most significant visible change from this diff is that
in order to buidl one of the thrift sub-projects (i.e.: the compiler,
the C++ library, or the Python library) you must run bootstrap.sh
and configure in the Thrift root, then make in the specific project.
Users who want to build and install the Python library but
can't run configure because they don't have Boost can simply
run setup.py directly.

Reviewed By: mcslee

Test Plan: Built Thrift from scratch.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665409 13f79535-47bb-0310-9956-ffa450edef68
2007-12-28 18:25:33 +00:00
David Reiss
c16a8f6e45 Thrift: Python support for Unix-domain sockets, and eager timeout setting.
Reviewed By: mcslee

Test Plan: Ran the test script.

Revert Plan: ok

Other Notes:
Contributed by Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665394 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 23:46:47 +00:00
Mark Slee
3f14d3ebec Merge Ruby framed transport
Summary: Submitted by Jake Luciani

Reviewed By: mcslee

Test Plan: Test code included in this commit


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665385 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:13:11 +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
8067485595 Complete rb test server with testEnum and testTypedef
Reviewed by: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665359 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 05:54:13 +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
Mark Slee
5299a959e0 Python automated test patch
Summary: Submitted by Ben Maurer

Reviewed By: dreiss

Test Plan: Automated python testing for Thrift, lovely.

Revert: OK

DiffCamp Revision: 737


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665293 13f79535-47bb-0310-9956-ffa450edef68
2007-10-05 00:13:24 +00:00
Mark Slee
8266443d92 OO perl accessors for Thrift objects
Summary: Submitted by Jake Luciani

Reviewed By: cpiro

Test Plan: Supplied in test/tutorial code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665276 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 06:49:30 +00:00
David Reiss
faebedd356 Thrift: Re-committing zlib.
Summary:
Same as the last (reverted) zlib patch,
but this time with way more awesome support for building
with no zlib headers installed.

Reviewed By: mcslee

Test Plan:
- Did lots of really pathological stuff in my VMware.
- On devrs004:
  ./bootstrap.sh && ./configure && make && make install DESTDIR=/tmp/tzinst && echo "Yay"

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665269 13f79535-47bb-0310-9956-ffa450edef68
2007-09-17 23:20:38 +00:00
David Reiss
5aea7c8d00 Thrift: Reverting TZlibTransport
Summary:
Stupid Red Hat.
The dev boxes don't have the development packages for zlib.

Blame Rev: 59856

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665263 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 01:54:56 +00:00
David Reiss
b8c6334d99 Thrift: Zlib transport.
Summary:
Add a new transport to the C++ library: TZLibTransport.
This wraps another transport (just like TBufferedTransport),
compresses the data written to it, and uncompresses the data it reads.

Reviewed By: mcslee

Test Plan:
For ax_lib_zlib.m4
 - Ran ./bootstrap.sh.
 - Looked at configure.
 - Ran ./configure.
 - Looked at config.status
 - Ran ./configure --with-zlib=/usr.
 - Looked at config.status
 - Changed configure.ac to AC_LIB_ZLIB(1.2.4)
 - Ran ./configure.
 - Watched it fail.

For TZlibTransport
 - test/ZlibTest.cpp
 - Code coverage (hotness) report sent with review.
 - 100% line coverage for all the good stuff.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665262 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 01:44:47 +00:00
David Reiss
ce161a96cd Thrift: Clean up and test TDenseProtocol
Summary:
- TDenseProtocol now includes a part of the struct fingerprint in
  the serialized message, to protect from unserialzing trash.
- A lot of cleanups and commenting for TDenseProtocol.
- A lot of test cases for same.

Reviewed By: mcslee

Test Plan: test/DenseProtoTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665257 13f79535-47bb-0310-9956-ffa450edef68
2007-09-11 22:09:42 +00:00
David Reiss
e67c0e63b3 Thrift: TDenseProtocol using variable-length integers.
Reviewed By: mcslee

Test Plan:
test/DenseProtoTest.cpp

Still have to test:
- Bounds checking.
- borrow/consume on TBuffered and TFramed.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665252 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 01:34:12 +00:00
David Reiss
2c2e6d27a2 Thrift: Python TBufferedTransport improvements.
Summary:
The Python version of TBufferedTransport now uses input buffering.
It is also compatible with the fasbinary module.

Reviewed By: mcslee

Test Plan:
test/FastbinaryTest.py

dreiss@dreiss-vmware:~/gp/thrift/test/py$ strace -f ./TestClient.py 2>&1 | grep recv | wc -l
99
# Install new version in other terminal
dreiss@dreiss-vmware:~/gp/thrift/test/py$ strace -f ./TestClient.py 2>&1 | grep recv | wc -l
14

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665250 13f79535-47bb-0310-9956-ffa450edef68
2007-09-05 01:14:09 +00:00
David Reiss
4e7530d4e5 Thrift: TDenseProtocol.
Summary:
- Made some stuff in TBinaryProtocol protected instead of private.
- Added a preliminary version of TDenseProtocol.  This is still
  super highly experimental and gross, and I wrote a super scary
  comment to explain that to anyone foolish enough to try to use
  this in its current state.

Reviewed By: mcslee

Test Plan: test/DenseProtoTest.cpp

Revert Plan: ok

Memcache Impact:
Save memory if/when people use it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665247 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 21:49:53 +00:00
David Reiss
d779cbe48c Thrift: Local Reflection for C++.
Summary:
The compiler now takes a "-dense" flag that will cause it to
generate some extra metadata for C++.  This metadata will be used by
TDenseProtocol.  This should be the last compiler change necessary
to enable that feature.

Reviewed By: mcslee

Test Plan: test/DenseLinkingTest.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665240 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 01:42:55 +00:00
David Reiss
c6fc329a40 Thrift: Support for explicit Python module declaration.
Summary:
Previously, Thrift used the name of the .thrift file as the python module name.
This wasn't very flexible.  Now the python module can be explicitly declared.
Also, there was no need for t_py_generator to inherit from t_oop_generator.

Reviewed By: mcslee

Test Plan:
cd test/py/explicit_module
./runtest.sh

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665234 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 00:58:43 +00:00
David Reiss
2375312fa0 Thrift: Limited Reflection for C++.
Summary:
The Thrift compiler now generates static methods for every service to generate
a reflection of the methods provided by the service.  This reflection is fairly
limited, but should be enough for what we want to do with SMC.

Reviewed By: mcslee

Test Plan: test/ReflectionTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665226 13f79535-47bb-0310-9956-ffa450edef68
2007-08-27 19:57:34 +00:00
David Reiss
382fc3043c Thrift: Native-code Binary Protocol encoder.
Summary:
Merging a patch from Ben Maurer.
This adds a python extension (i.e., a C module) that
encodes Python thrift structs into the standard binary protocol
much faster than our generated Python code.

Also added by-value equality comparison to thrift structs
(to help with testing).

Cleaned up some trailing whitespace too.

Reviewed By: mcslee, dreiss

Test Plan:
Recompiled Thrift.
Thrifted a bunch of IDLs and compared the generated Python output.
Looked at the extension module a lot.
test/FastBinaryTest.py

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665224 13f79535-47bb-0310-9956-ffa450edef68
2007-08-25 18:01:30 +00:00
David Reiss
e087a30585 Thrift: Make use of get_true_type.
Summary:
We added a helper function for the generators: get_true_type,
which finds the actual type behind a series of typedefs
(though the compiler only supports one layer of typedefs now).
This change uses it everywhere we used to have that loop.
(It was a lot of places.)

Reviewed By: mcslee

Test Plan: test/ManyTypedefs.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665220 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 21:43:25 +00:00
David Reiss
bc3dddb91c Thrift: Better handling of strerror_r.
Summary:
Someone thought it would be a good idea to have two different signatures
for strerror_r, with subtly different semantics (strlcpy = smart).
We now work properly with either of them.

Also fixed a test to work on 32-bit, you sloppy <expletive>s.

Reviewed By: mcslee

Test Plan:
Rebuild thrift.
Force one of these errors to be thrown.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665215 13f79535-47bb-0310-9956-ffa450edef68
2007-08-22 23:20:24 +00:00
David Reiss
2dc72c3864 Thrift: Move TStringBuffer functionality into TMemoryBuffer.
Summary:
TMemoryBuffer already has the necessary plubming to work with C++ strings.
This revision implements that functionality with a few wrapper methods.
Removed TStringBuffer as it should no longer be required (and it is tricky
to safely inherit from a class that has a non-virtual destructor).
Also refactored the TMemoryBuffer constructors a bit.

Reviewed By: aditya, yunfang

Test Plan:
test/TMemoryBufferTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665213 13f79535-47bb-0310-9956-ffa450edef68
2007-08-21 23:59:34 +00:00
Mark Slee
27ed6ec1f9 Merging Jake Luciani's latest perl code gen fixes
Reviewed By: dreiss

Test Plan: Watch for any weirdness on Thrift code gen, perl specific


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665206 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 01:26:31 +00:00
David Reiss
8320a92d9b Thrift: Merging external patch.
Summary:
Merging a patch from Andy Lutomirsky.
- Allow fields to be marked "required" or "optional" (only affects C++).
- Thrift structs now have operator ==.

Reviewed By: mcslee

Test Plan: test/OptionalRequiredTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665202 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 19:59:26 +00:00
David Reiss
cbd4bacc30 Thrift: docstring revamp step 2.
Summary:
It was a bad idea to let doxygen comments become a part of the parse tree.
We now get them a totally different way.  The lexer stashes the docsting
contents in a global, and the parser actions (not the rules) pull it out.
This should prevent doxygen comments from ever causing parse errors.

Blame Rev: 52678, 52732

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
Thrifted a bunch of files and saw no parse errors (or C++ compile errors).
Thrifted DocTest.thrift with dump_docs on.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665201 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 17:12:33 +00:00
David Reiss
cdffe260f1 Thrift: docstring revamp step 1.
Summary:
Allow constants to be documented.
Now any "Definition" can be documented, so we can move the docstring stuff
up to a a higher node in the parse tree.

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
Checked out DocTest.thrift and a few other thrifts.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665200 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 17:12:31 +00:00
Mark Slee
7dafc94e50 Fix Java test cases
Summary: Use the default TBinaryProtocol constructors for better example.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665197 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 03:40:15 +00:00
iproctor
7897c927b2 Thrift: OCaml and HS servers more general
Summary: The library now provides servers that are general like the other languages.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665195 13f79535-47bb-0310-9956-ffa450edef68
2007-08-08 01:43:39 +00:00
David Reiss
202111d2e9 Thrift: More constant enums.
Summary:
Make enum constants as structure defaults work.
Make enum constants as constant map keys work.
Un-break the generated skeleton servers.

Reviewed By: mcslee

Test Plan:
cd test
../compiler/cpp/thrift -cpp ConstantsDemo.thrift
g++ -I../lib/cpp/src -c gen-cpp/*.cpp
Also compared the generated output to the old generated output.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665193 13f79535-47bb-0310-9956-ffa450edef68
2007-08-06 20:38:18 +00:00
David Reiss
6f226558d6 Thrift: Fixed rookie mistake.
Summary:
This test now works on 32-bit.

Reviewed By: mcslee

Test Plan: Ran the comment at the top of the file.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665192 13f79535-47bb-0310-9956-ffa450edef68
2007-08-06 20:33:00 +00:00
David Reiss
8dae994f8f Thrift: Improved test case.
Summary:
By "improved", I mean that I added a totally awesome self-referential joke
to one of the test cases.  Seriously.  In a few years someone is going to
add UTF-8 support to the Debug Protocol and run this test case on a terminal
with really good fonts and they are going to die laughing.  Seriously, die.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled everything and ran the test.

Revert Plan:
Take a good, long look in the mirror, then svn revert.

Notes:
I am awesome.

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665191 13f79535-47bb-0310-9956-ffa450edef68
2007-08-06 20:32:59 +00:00
David Reiss
c2532a9ac4 Thrift: Allow whole program doctext.
Summary:
Allow docstrings at the top of the program.

Blame Rev: 52687

Reviewed By: mcslee

Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.

Revert Plan: Do 52687 also.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665183 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 23:46:11 +00:00
David Reiss
1ac0580378 Thrift: Change docstring syntax.
Summary:
The old docstring syntax collided with the syntax for list constants.
The new syntax looks a lot like doxygent comments.

Trac Bug: #4664

Blame Rev: 32392

Reviewed By: mcslee

Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665182 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 22:00:27 +00:00
Mark Slee
d0767c5796 Fix Thrift compiler to support reuse of enums and constants in later constants
Summary: So for example, you can make a constant map of enum values to string identifiers.

Reviewed By: dreiss

Test Plan: ConstantsDemo.thrift in the test folder


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665181 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 22:14:41 +00:00
iproctor
ff8eb9288d Thrift: Haskell library and codegen
Summary: It's thrift for haskell. The codegen is complete. The library has binary protocol, io channel transport, and a threaded server.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665174 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 19:06:13 +00:00
David Reiss
00dcccfef2 Thrift: Debug Protocol
Summary:
Added TDebugProtocol, a write-only Thrift protocol for C++
that produces human-readable representations of thrift structs.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled Thrift.
./test/TestDebugProto.* see compile instructions at the top.
Ran that, and it looked good.

Revert Plan:
grep TDebugProtocol <world>
grep ThriftDebugString <world>
Revert or comment out whatever you find so that they still compile.
Then svn revert.

Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665166 13f79535-47bb-0310-9956-ffa450edef68
2007-07-21 01:18:10 +00:00
iproctor
9a41a0c51e Thrift: OCaml library and generator
Summary: Added (minimal) library and code generator for OCaml.
Reviewed by: mcslee
Test plan: Test client and server (included).
Revert plan: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665163 13f79535-47bb-0310-9956-ffa450edef68
2007-07-16 21:59:24 +00:00
Mark Slee
58dfb4fbe8 Lots of Ruby code generation improvements
Summary: Submitted by Kevin Clark, Ruby guru from Powerset

Reviewed By: mcslee

Test Plan: He updated the tests in trunk/test/rb/

Notes: The code is now officially "ruby-ish" and idiomatic


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665151 13f79535-47bb-0310-9956-ffa450edef68
2007-07-06 02:45:25 +00:00
Mark Slee
477a580aa4 Ruby test code fix, and BNF file for protocol
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665148 13f79535-47bb-0310-9956-ffa450edef68
2007-06-30 01:18:12 +00:00
Mark Slee
3e5d2d72b4 Whitespace fixes on test code
Reviewed By: thrift

Test Plan: Whitespace


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665136 13f79535-47bb-0310-9956-ffa450edef68
2007-06-15 01:45:56 +00:00
Mark Slee
e02385b0b4 Add thread pool option to NonblockingServer
Summary: If you want requests processed outside of the I/O thread

Reviewed By: jake luciani, aditya

Test Plan: nb-main.cpp, in the test folder


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665132 13f79535-47bb-0310-9956-ffa450edef68
2007-06-09 01:21:16 +00:00
Marc Slemko
3a3b53bc6e Modified facebook::thrift::concurrency::Monitor.wait:
Throw TimedOutException on wait timeout so caller can distinguish between timeout and event.

Modified facebook::thrift::concurrency::PthreadThread.start:
        Throw SystemrResourceException on any pthread_* function call failure rather than asserting 0.

Added facebook::thrift::concurrency::Thread.id() and  facebook::thrift::concurrency::ThreadFactory.currentThreadId():
        Return thread-id of thread and current thread respectively.  Needed for reentrancy tests in ThreadManager

Added facebook::thrift::concurrency::ThreadManager.pendingTaskCountMaxN
Modified facebook::thrift::concurrency::ThreadManager.add():
        Now support a maximum pending task count and block if the current pending task count is max.
        If timeout is specified for add, TimedOutException is thrown if pending task count doesn't decrease
        in the timeout interval.  If add() is called by a ThreadManager worker thread and the task cannot
        be added, a TooManyPendingTasksException is thrown rather than blocking, since deadlocks can ensue
        if worker threads block waiting for works threads to complete tasks.

Reviewed By: mcslee, aditya

Revert Plan: revertible

Test Plan: concurrency/test/ThreadManagerTests.h
           run concurrency-test thread-manager


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665120 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 23:59:54 +00:00
Mark Slee
f4f18ec514 Need using namespace boost in thrift threads test
Reviewed By: jake luciani


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665119 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 21:22:34 +00:00
Mark Slee
3e3d7ad834 Adding perl testclient code
Summary: Submitted by Jake Luciani

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665115 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:35:58 +00:00
Mark Slee
fa6ac9f2aa Java test client/server fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665104 13f79535-47bb-0310-9956-ffa450edef68
2007-05-04 18:49:56 +00:00
Mark Slee
cbc51600ee Fix messed up noninitialized things
Reviewed By: danli


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665096 13f79535-47bb-0310-9956-ffa450edef68
2007-04-11 08:57:07 +00:00
Mark Slee
0c2dff3f5a Fix broken C++ Thrift test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665057 13f79535-47bb-0310-9956-ffa450edef68
2007-03-09 19:26:57 +00:00
Mark Slee
02d1edc6f0 Some thrift test code improvements
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665050 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 05:17:25 +00:00
Mark Slee
4841b2d51f Threads test makefile cleanup
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665043 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 05:41:04 +00:00
Mark Slee
c416a2730d Threads testing package update
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665042 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 05:40:37 +00:00
Mark Slee
b32f3c6ad7 Threading libraries test for Thrift C++
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665041 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 04:48:48 +00:00
Mark Slee
57cc25e2a3 Some Thrift documentation cleanups
Summary: Getting ready to hand this over to powerset, just want to have the right licenses in place and such first.

Reviewed By: thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665029 13f79535-47bb-0310-9956-ffa450edef68
2007-02-28 21:43:54 +00:00
Mark Slee
e129a2db0c Some thrift test code fixes
Reviewed By: tbr-testaditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665014 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 05:17:48 +00:00
Mark Slee
157d9f794e Ruby test server code
Reviewed By: tbr-doug


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664991 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 06:03:53 +00:00
Mark Slee
79e41b817e Update test code with TPipedTransport
Reviewed By: tbr-aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664989 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 04:07:07 +00:00
ccheever
f53b5cfed2 adding documentation syntax to thrift
see DocTest.thrift for examples.

todo: integrate parsed documentation into code generation

review: marc k, mcslee
test plan: DocTest.thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664970 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 20:33:11 +00:00
Mark Slee
739dbe55ae Bring C++ thrift stress test up to date with new constructs
Reviewed By: marc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664966 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 22:55:30 +00:00
Mark Slee
a7747c2525 Fix HashMap => AbstractMap conversions in Java test thrift code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664955 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 17:35:54 +00:00
Mark Slee
6d7d595858 Ruby support for Thrift
Summary: Just client support so far.

Reviewed By: tbr-doug


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664953 13f79535-47bb-0310-9956-ffa450edef68
2007-01-27 01:44:22 +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
6f5e2cb3ea Fix relative paths in test dirs
Reviewed By: makefile


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664950 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 08:01:28 +00:00
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
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
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
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
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
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
1dd819cd2b Bring Thrift test code up to date
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664852 13f79535-47bb-0310-9956-ffa450edef68
2006-10-26 04:56:18 +00:00
Mark Slee
d7173476bb Stresstest onto new Thrift C++ model
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664841 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 19:52:10 +00:00
Mark Slee
a330265d82 Fix broken thrift test code for new model
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664839 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 19:03:32 +00:00
Mark Slee
9a079272b2 Change thrift stress test to .cpp file extension
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664831 13f79535-47bb-0310-9956-ffa450edef68
2006-10-12 04:05:23 +00:00
Mark Slee
a6b48ea7ce Rename test files to .cpp instead of .cc
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664830 13f79535-47bb-0310-9956-ffa450edef68
2006-10-12 04:04:11 +00:00
Aditya Agarwal
3950f47d6f -- Thrift testing changes
Summary:
-- Modified StressTest.thrift to work (it was out of date..) and added tests for TBufferedFileWriter
-- Modified Makefiles to use the correct lib directory

Reviewed By: Slee

Test Plan: This is the test.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664827 13f79535-47bb-0310-9956-ffa450edef68
2006-10-11 02:50:15 +00:00
Mark Slee
b9acf98b33 Test code updates
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664823 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 01:57:32 +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
4e755cae58 Thrift: Rename run() to serve() in java interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664797 13f79535-47bb-0310-9956-ffa450edef68
2006-09-12 00:46:08 +00:00
Mark Slee
ade2c83d11 Thrift PHP TSocketPool client
Summary: Client that connects to one of an arbitrary pool of servers

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664795 13f79535-47bb-0310-9956-ffa450edef68
2006-09-08 03:41:50 +00:00
Mark Slee
018b6998d6 Thrift: generate Processors not Servers
Summary: Because the gen'd code isn't actually a server

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664794 13f79535-47bb-0310-9956-ffa450edef68
2006-09-07 21:31:12 +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
ffcddd688a Thrift multithreaded Java server
Summary: Ported the Pillar multithreaded Java server to Thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664791 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 20:37:03 +00:00
Aditya Agarwal
450585b74b -- search per-user lib dir first
Summary:
-- this should fix the library mismatch issue..

From the gcc linking guide:

LIBRARY_PATH
           The value of LIBRARY_PATH is a colon-separated list of directories,
           much like PATH.  When configured as a native compiler, GCC tries
           the directories thus specified when searching for special linker
           files, if it can't find them using GCC_EXEC_PREFIX.  Linking using
           GCC also uses these directories when searching for ordinary
           libraries for the -l option (but directories specified with -L come
           first).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664790 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 04:19:47 +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
68db166dd4 -- more thrift Makefile changes
Reviewed By: Slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664788 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 00:18:29 +00:00
Aditya Agarwal
0cc0c0ab6c -- generalize Makefile
Summary:
-- dont use /usr/local as the thrift directory now that multiple ppl are developing on dev007

Reviewed By: McSlee

Test Plan: Tested by making and cleaning


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664786 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 22:38:13 +00:00
Mark Slee
d2655523ab Thrift: Change Java/C++ server generation
Summary: Servers shouldn't implement iface directly, instead should contain an iface object


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664785 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 22:09:57 +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
c9676569ad Thrift Python server code generation
Summary: Yep, it's up and running. We now have full client/server support in all of C++ Java PHP and Python. Well, not quite... there's no PHP server, but honestly who wants one? Actually, if we do want one the framework will support writing is as a PHP file that can be served in apache like a web service (i.e. restserver.php would be thriftserver.php). But now that's rambling and nothing to do with this commit.

Notes: cheever, let's chat about porting your multithreaded Pillar Python server over to Thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664783 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 17:34:52 +00:00
Mark Slee
fc89d39917 Thrift and Python: Made to be together
Summary: Python client code generation for Thrift... HOTNESS!

Notes: Servers and asynchronous clients are coming soon...


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664779 13f79535-47bb-0310-9956-ffa450edef68
2006-09-04 00:04:39 +00:00
Mark Slee
dafa3cf710 Thrift C++ code generation improvements
Summary: Generate classes instead of structs, and put read/write methods inside the class definition. Separate services into uniquely generated files. Separate types header file from types implementation file (read/write methods)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664777 13f79535-47bb-0310-9956-ffa450edef68
2006-09-02 23:56:49 +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
d3d733a061 Thrift test improvements, tests for both inline and normal PHP code gen
Summary: So you can A/B test and see 6ms vs. 4ms response time :)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664773 13f79535-47bb-0310-9956-ffa450edef68
2006-09-01 22:19:06 +00:00
Mark Slee
632f323f6c Move Thrift StressTest code into test top-level folder
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664770 13f79535-47bb-0310-9956-ffa450edef68
2006-08-30 17:23:52 +00:00
Marc Slemko
b09f58838f Uber configure.ac/Makefile.am and configure.ac/Makefile.am for lib/php and compiler
Modified TProtocol.h et al to take collection size as unsigned int.  This removes need to cast STL's default size_t to signed int and is more correct, since collection sizes cannot be < 0 by definition

Moved compiler/Makefile to compiler/cpp.mk so it doesn't get trashed by automake

    


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664766 13f79535-47bb-0310-9956-ffa450edef68
2006-08-23 22:03:34 +00:00
Marc Slemko
71d4e47e81 Cleaned up test code for thrift exception throwing
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664758 13f79535-47bb-0310-9956-ffa450edef68
2006-08-15 22:34:04 +00:00
Marc Slemko
bf4fd19963 Modified C++ code-gen to create default constructors for all non-string primitives so that auto variable instances of structs aren't populated with
garbage.  This matters because, given thrift's loosey-goosey argument and result lists, structs may only be sparsely filled.
    


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664757 13f79535-47bb-0310-9956-ffa450edef68
2006-08-15 21:29:39 +00:00
Marc Slemko
aeb36f840b Added namespace declaration
Added namespace declaration to thrift grammar
    
    Modified C++ code generator to produce equivalent C++ namespace for thrift namespace if specified
    


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664756 13f79535-47bb-0310-9956-ffa450edef68
2006-08-15 00:21:45 +00:00
Marc Slemko
1785985754 Added namespace declaration
Added namespace declaration to thrift grammar
    
    Modified C++ code generator to produce equivalent C++ namespace for thrift namespace if specified
    


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664755 13f79535-47bb-0310-9956-ffa450edef68
2006-08-15 00:21:31 +00:00
Marc Slemko
d8b1051800 You scream, I scream, We all scream for exceptions
Added exception defintions and specifiers to thrift grammar
    
    Modified C++ code generator to to catch and serialize exceptions on the server side and unmarshall and throw them on the client side.
    
Modified grammar to require ","  after each service function declaration to keep it consistent with struct declaration syntax

    This checkin officially breaks the old parser


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664754 13f79535-47bb-0310-9956-ffa450edef68
2006-08-14 23:30:37 +00:00
Marc Slemko
e6889de36f Fixed a few typos - test client and server samples now working with new code generation
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664753 13f79535-47bb-0310-9956-ffa450edef68
2006-08-12 00:32:53 +00:00
Marc Slemko
5b126d6c85 Groundwork for exception support:
Auto generate result structs that combine return type and any thrown exceptions
     Add __isset struct to all user defined and auto defined struct to mark fields that are explicilty read
     Modified client and server generation code to marshal result structs

     Added base facebook::thrift::Exception class 


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664750 13f79535-47bb-0310-9956-ffa450edef68
2006-08-11 23:03:42 +00:00
Marc Slemko
0b4ffa9d4c Added read/write I16, U16 and Bool methods to TProtocol
Modified code generation to define structs and io methods for function argument lists and server process call implementations


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664749 13f79535-47bb-0310-9956-ffa450edef68
2006-08-11 02:49:29 +00:00
Marc Slemko
6be374b55b More boosification of thrift driver, server, transport and protocol code
Modified TestServer to use thread-pool manager 


	


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664738 13f79535-47bb-0310-9956-ffa450edef68
2006-08-04 03:16:25 +00:00
Mark Slee
6e53644ce5 Thrift now works in PHP, hot stuff
Summary: End to end communication working in Thrift with PHP

Problem: It's a bit slower than pillar still. Need to find out why.

Reviewed By: aditya

Test Plan: Unit tests are in the test directory. Get lucas on the PHP case...




git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664720 13f79535-47bb-0310-9956-ffa450edef68
2006-06-30 18:28:50 +00:00
Mark Slee
9577100f3c Thrift test code
Summary: Did I promise you this or what?! Interoperable test servers and clients in both C++ and Java that you can use to check that they all work, all perform well, and that they all actually talk to each other!

Problem: How we gon' test this Thrift bizniss?

Solution: Write some test scenarios in each language.

Reviewed By: aditya

Test Plan: This IS the test plan.

Notes: These tools are actually pretty easy to use, so long as you remember to type 'ant' in the java directory instead of 'make'.





git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664716 13f79535-47bb-0310-9956-ffa450edef68
2006-06-07 06:53:25 +00:00
Mark Slee
e8540637aa Rev 2 of Thrift, the Pillar successor
Summary: End-to-end communications and serialization in C++ is working

Reviewed By: aditya

Test Plan: See the new top-level test/ folder. It vaguely resembles a unit test, though it could be more automated.

Revert Plan: Revertible

Notes: Still a LOT of optimization work to be done on the generated C++ code, which should be using dynamic memory in a number of places. Next major task is writing the PHP/Java/Python generators.




git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664712 13f79535-47bb-0310-9956-ffa450edef68
2006-05-30 09:24:40 +00:00