- 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
- 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
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
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
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
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
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
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
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
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
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
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
- 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
- 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
- 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
- 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
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
- 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
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
- 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
- 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
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
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
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
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