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