Commit Graph

1282 Commits

Author SHA1 Message Date
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
aabfa63c47 (THRIFT-40) Remove stray \n's from the generated version.h
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672945 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 22:27:29 +00:00
David Reiss
4d8edc5269 (THRIFT-40) Fix compilation and version string on OS X.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672943 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 21:55:52 +00:00
David Reiss
52cb7a7413 (THRIFT-45) TNonblockingServer (C++): only do one write in responses.
Instead of doing one 4-byte write for the frame length before the write
of the actual message, prepend the frame length to the message buffer
so we can send them both at once.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672937 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 21:40:35 +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
dd08f6d5a5 (THRIFT-40) Add -version switch to the compiler to show the Thrift version
The version is determined by configure.ac. After this version is shown the
revision. For subversion, it is simply the current revision as given by
`svnversion`. For git, the latest svn revision that HEAD includes is shown,
followed by the offset of HEAD from that commit, followed by a truncated sha1
for HEAD. If the offset is 0, the offset and sha1 are omitted.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672900 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:24:24 +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
David Reiss
fc0646481f (THRIFT-12) Make the Java library use java.util.logging instead of stdout.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672868 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 19:13:23 +00:00
Kevin Clark
28744ab833 rb: Ensure the specs that expect deprecation warnings actually get them [THRIFT-56]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:45:29 +00:00
Kevin Clark
f2e4d107af rb: The deprecation stuff should skip thrift library code when showing caller [THRIFT-56]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671984 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:45:19 +00:00
Kevin Clark
5da153b36a rb: Add some additional error handling to Thrift::Socket [THRIFT-53]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:35:15 +00:00
Kevin Clark
3387115fa3 rb: Add stubs for rake install/package when Echoe not present [THRIFT-52]
Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671971 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:14:25 +00:00
Kevin Clark
091fa95233 rb: BufferedTransport should flush on close [THRIFT-49]
This also adds code and spec so nothing will be written to the transport
if there's nothing in the write buffer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671967 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 18:10:56 +00:00
Kevin Clark
2bd3a30b91 rb: Use File.dirname(__FILE__) in generated requires [THRIFT-57]
This means you no longer have to put the gen-rb folder in $:

Author: Kevin Ballard <kevin@rapleaf.com>


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-26 17:49:49 +00:00
Kevin Clark
1e0744d7a2 rb: Make TServer.py Python 2.4 compatible [THRIFT-44]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671337 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 20:46:32 +00:00
Kevin Clark
1ce8b3d7d5 rb: When passing unknown keys to Thrift::Struct.new, report those keys in the exception [THRIFT-51]
Author: kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670989 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:32:03 +00:00
Kevin Clark
eaf8d034e7 rb: Delete setup.rb [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:10 +00:00
Kevin Clark
1b8fec10db rb: rewrite the README [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670984 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:08 +00:00
Kevin Clark
c5336ff691 rb: Change the license from Thrift Software License to Apache Software License [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670983 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:06 +00:00
Kevin Clark
3a9ffbda08 rb: Use Echoe to manage the gem [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670982 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:06:00 +00:00
Kevin Clark
c06b015e22 rb: Reorganize the Rakefile a bit [THRIFT-38]
From kevin@rapleaf.com

Also add a guard to ensure `rake test` is only run if we're in a full thrift checkout


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670981 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:57 +00:00
Kevin Clark
cd72befc86 rb: Use defined? JRUBY_VERSION to detect JRuby [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670980 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:55 +00:00
Kevin Clark
3836f9ba35 rb: require 'thrift' first in generated service definitions [THRIFT-38]
From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 01:05:51 +00:00
Kevin Clark
a058d02eda rb: Bugfix for deprecation code [kevin@rapleaf.com][THRIFT-50]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670976 13f79535-47bb-0310-9956-ffa450edef68
2008-06-24 00:33:00 +00:00
Doug Cutting
be1dd3a0e1 THRIFT-43. Ignore build-generated files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670083 13f79535-47bb-0310-9956-ffa450edef68
2008-06-20 22:21:19 +00:00
Kevin Clark
f731b49b69 rb: Switch NonblockingServer spec from Queue to sleep
Using sleep instead of Queue#pop means the thread is killable under JRuby


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669043 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:25 +00:00
Kevin Clark
f8ecb02ef4 rb: NonblockingServer: Use a select() loop in the acceptor thread
Using a select() loop with a timeout allows the acceptor thread to be shut down
cleanly under JRuby.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669042 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:22 +00:00
Kevin Clark
77b39b3fd8 rb: Set default host for benchmark to 127.0.0.1
MRI resolves localhost to ::1 (on OS X) whereas JRuby resolves it to 127.0.0.1. This means using
MRI for server and JRuby for client doesn't work.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669041 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:16 +00:00
Kevin Clark
f0940220c8 rb: Fix the timeout used for joining threads when calling shutdown(timeout) on NonblockingServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669040 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:13 +00:00
Kevin Clark
d8d0d60309 rb: Add hooks for THRIFT_HOST and THRIFT_PORT in the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669039 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:10 +00:00
Kevin Clark
4b429ad86e rb: Add control for the number of client processes in the benchmark
You control this with THRIFT_NUM_PROCESSES, the default is 40


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669038 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:06 +00:00
Kevin Clark
e4b780de36 rb: Add debug logger message for processing frames
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669037 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:02 +00:00
Kevin Clark
980e445347 rb: Make a few of the NonblockingServer specs pass under jruby
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669036 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:59 +00:00
Kevin Clark
8c3e0932f2 rb: Fix up the deprecation spec for JRuby
JRuby has different behavior regarding #method_added and #included, so the deprecation spec has to handle this


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669035 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:54 +00:00
Kevin Clark
830f46a382 rb: Fix the binaryprotocol spec to run under jruby
Stop testing for RangeErrors with bignums in i64, that was just an artifact of the MRI interpreter that has different behavior under jruby.
JRuby uses a different Float::MIN/MAX so stop hard-coding the binary representation


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669034 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:51 +00:00
Kevin Clark
fdc9c976f9 rb: Increase the benchmark startup time and add more hooks
You can now control the number of clients per proc and calls per client with THRIFT_NUM_CALLS and THRIFT_NUM_CLIENTS.
You can also instruct the clients to log exceptions with THRIFT_LOG_EXCEPTIONS=yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669033 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:46 +00:00
Kevin Clark
e4644f11fa rb: Drop the benchmark worker spawn delay to 0.01
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669032 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:41 +00:00
Kevin Clark
d271979bf2 rb: Catch TransportException errors during the benchmark and report them
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669031 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:37 +00:00
Kevin Clark
1e8f5208e6 rb: flush STDOUT after starting the benchmark server to properly kickstart the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669030 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:33 +00:00
Kevin Clark
1a95a1d5ad rb: Give the benchmark server more time to start up
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669029 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:28 +00:00
Kevin Clark
b679131a16 rb: Turn off debug logging in benchmark/thin_server.rb
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669028 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:23 +00:00
Kevin Clark
66038a0afc rb: Fix some incorrect reporting by the benchmark.
Also make it use -J-server when jruby is the server interpreter


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669027 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:18 +00:00
Kevin Clark
75532eee4c rb: Enhance the output of the benchmark
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669026 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:14 +00:00
Kevin Clark
d3cee029c9 rb: split up benchmark into separate server/client files and distinct interpreters
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669025 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:09 +00:00
Kevin Clark
fb5c0eb2b3 rb: Switch from read_nonblock to readpartial to make jruby happy
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669024 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:04 +00:00
Kevin Clark
1aca9c4097 rb: Add spec to ensure UNIXServerSocket deletes the socket when closing
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669023 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:57 +00:00
Kevin Clark
bfb198dae6 rb: Enable logging debug info in benchmark/thin_server.rb
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669022 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:52 +00:00
Kevin Clark
2ddd9d7e2c rb: Tweak the benchmark to allow running the server in a separate process
Add a thin server library that can be run by hand


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669021 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:47 +00:00
Kevin Clark
e1d35fa555 rb: Wrap a semaphore around @serverTransport.close in NonblockingServer.shutdown
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669020 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:41 +00:00