common/thrift.git
17 years agoInfrastructure for loading code generators a bit more dynamically.
David Reiss [Wed, 27 Feb 2008 01:54:51 +0000 (01:54 +0000)] 
Infrastructure for loading code generators a bit more dynamically.

Add a generic and easy-to-use mechanism for Thrift code generators to
register themselves centrally.  The central registry is used to
obtain documentation for the options accepted by individual generators
and get instances of individual generators.  It also does a little bit of
option parsing that will be useful for all generators.

Obviously, this change cannot be tested on its own.  I can only say
that Thrift still builds and runs correctly.  Subsequent changes
will apply this infrastructure to specific code generators.
Steve Grimm has assured me that this is standard Git practice.

In fact, I ran this test after converting the C++ and Java generators:

dreiss@dreiss-vmware:dynamic_generators:thrift/test$ mkdir old new
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ cd old
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ ../../compiler/cpp/thrift -cpp -dense -java -javabean ../DebugProtoTest.thrift
[WARNING::1] -cpp is deprecated.  Use --gen cpp
[WARNING::1] -java is deprecated.  Use --gen java
[WARNING::1] -javabean is deprecated.  Use --gen java:beans
dreiss@dreiss-vmware:dynamic_generators:thrift/test/old$ cd ../new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ ../../compiler/cpp/thrift --gen cpp:dense --gen java --gen java:beans ../DebugProtoTest.thrift
dreiss@dreiss-vmware:dynamic_generators:thrift/test/new$ cd ..
dreiss@dreiss-vmware:dynamic_generators:thrift/test$ diff -ur old/ new/
dreiss@dreiss-vmware:dynamic_generators:thrift/test$

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665507 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake warnings from the Thrift compiler a little clearer.
David Reiss [Wed, 27 Feb 2008 01:54:47 +0000 (01:54 +0000)] 
Make warnings from the Thrift compiler a little clearer.

Reviewed by: mcslee

Warning and error messages from the Thrift compiler include
the file currently being parsed and the line number.
This change sets those to dummy values for stages that
have nothing to do with parsing.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665506 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] don't do a reverse DNS lookup for every erlang thrift request
eletuchy [Tue, 26 Feb 2008 12:11:29 +0000 (12:11 +0000)] 
[thrift] don't do a reverse DNS lookup for every erlang thrift request

Reviewed By: cpiro

Test Plan: ran a server ... verified its debug messages no longer included
     hostnames

Notes: methinks this binding is not long for this world

Revert Plan: sure ... if you don't like your dns server

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665505 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] better error handling and timeouts in tSocket code
eletuchy [Tue, 26 Feb 2008 11:44:00 +0000 (11:44 +0000)] 
[thrift] better error handling and timeouts in tSocket code

Summary: default socket send timeout to 5seconds, not infinity.
         close the socket in case of an error.

Reviewed By: cpiro

Test Plan: ran a client for slow services
     and sanity checked other client code to make sure

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665504 13f79535-47bb-0310-9956-ffa450edef68

17 years agoTighten integration with Ruby exceptions by tying in Exception#message
David Reiss [Tue, 26 Feb 2008 06:40:25 +0000 (06:40 +0000)] 
Tighten integration with Ruby exceptions by tying in Exception#message

For Thrift exceptions that contain only a single string field, integrate
these even more tightly with Ruby exceptions by aliasing Ruby's
Exception#message field with the Thrift field.

Ruby exception objects created by Thrift will now display properly in
Ruby backtraces, etc. without any special handling by client code.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665503 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMove Ruby fielded object creation from generated constructor to ThriftStruct
David Reiss [Tue, 26 Feb 2008 06:40:22 +0000 (06:40 +0000)] 
Move Ruby fielded object creation from generated constructor to ThriftStruct

Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as

  o = ThriftObject.new :field1 => value1, :field2 => value2, ...

are supported as before, and the string form,

  o = ThriftObject.new "field1" => value1, "field2" => value2, ...

disabled by the previous patch now also works.

Placing this code in the module is also just a cleaner solution.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRuby exception constructor bugfix
David Reiss [Tue, 26 Feb 2008 06:40:16 +0000 (06:40 +0000)] 
Ruby exception constructor bugfix

The Ruby exception constructor is modified to accept 0 arguments, which is
how Thrift library code creates exception objects. Without this fix, Thrift
Ruby clients that receive exception objects crash.

The call to super (resolving to ThriftStruct#initialize) is retained, but
is called with the default value (an empty hash) instead of passing the
message along.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665501 13f79535-47bb-0310-9956-ffa450edef68

17 years agoadd increase_max_fds to the new TServer.cpp
veeve [Tue, 26 Feb 2008 05:12:08 +0000 (05:12 +0000)] 
add increase_max_fds to the new TServer.cpp

Summary: - added TServer.cpp
         - increase_max_fds() defaults to 2^24.

Reviewed By: dreiss

Test Plan: - Linked this code into chatloggerd and verified the return value.

Revert: OK

TracCamp Project: Chirp

DiffCamp Revision: 8275

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665500 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUse "all-local" instead of all in Makefile.am.
David Reiss [Sun, 24 Feb 2008 17:45:03 +0000 (17:45 +0000)] 
Use "all-local" instead of all in Makefile.am.

Summary:
Redefining an Automake rule totally blows away anything Automake puts in place.
By using all-local instead of all, we can just add to the generated rule.

Reviewed By: marc

Test Plan: make

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665499 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake "make clean" rules a bit more standard.
David Reiss [Sun, 24 Feb 2008 16:42:18 +0000 (16:42 +0000)] 
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

17 years agoMake "make check" work properly for Python and Java.
David Reiss [Sun, 24 Feb 2008 02:03:17 +0000 (02:03 +0000)] 
Make "make check" work properly for Python and Java.

Summary:
The Python and Java versions of "make check" only work if "make all" has
been run.  Our automake-fu isn't strong enough to make proper dependencies,
so this hack suggested by Nitay will force the libraries to be built
before make check is run.

Test Plan: make check

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665497 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd automake support for running the Java tests.
David Reiss [Sat, 23 Feb 2008 22:07:46 +0000 (22:07 +0000)] 
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

17 years agoUpdate TJSONProtocol to TSimpleJSONProtocol
David Reiss [Sat, 23 Feb 2008 22:07:43 +0000 (22:07 +0000)] 
Update TJSONProtocol to TSimpleJSONProtocol

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665495 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd automake support for building the Java library.
David Reiss [Sat, 23 Feb 2008 22:07:39 +0000 (22:07 +0000)] 
Add automake support for building the Java library.

If java, javac, and ant are all available, the Java library will be built as part of the standard make target.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665494 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Clean up cleanup.sh and bootstrap.sh
David Reiss [Sat, 23 Feb 2008 21:56:16 +0000 (21:56 +0000)] 
Thrift: Clean up cleanup.sh and bootstrap.sh

Reviewed By: marc

Test Plan:
dreiss@dreiss-vmware:cleanup:thrift/if$ ../cleanup.sh
dreiss@dreiss-vmware:cleanup:thrift/if$ git clean -nxd
dreiss@dreiss-vmware:cleanup:thrift/if$

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665493 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRename TJSONProtocol.java -> TSimpleJSONProtocol.java
David Reiss [Thu, 21 Feb 2008 22:49:58 +0000 (22:49 +0000)] 
Rename TJSONProtocol.java -> TSimpleJSONProtocol.java

Summary:
Chad Walters is developing a full-featured JSON-based protocol for Java,
so we're renaming the existing protocol to something more descriptive.
I also edited the file to rename the class and add to the header comment.
I have no idea if Subversion does explicit rename tracking, or if
git svn is smart enough to mark renames as such, but I would predict
"yes" to both.  Let's find out.

Reviewed By: mcslee, jssarma

Test Plan: Ran "ant" in lib/java

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665492 13f79535-47bb-0310-9956-ffa450edef68

17 years agoTJSONProtocol no longer uses borrow, and miscellaneous fixes.
David Reiss [Thu, 21 Feb 2008 22:37:45 +0000 (22:37 +0000)] 
TJSONProtocol no longer uses borrow, and miscellaneous fixes.

Summary:
Added a LookaheadReader to the TJSONProtocol so it doesn't have to
rely on the transport to borrow.
Also added a check to a corner case and fixed up some comments and whitespace.

Reviewed By: mcslee

Test Plan: make check

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665491 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] Erlang thrift_sup will exit if it can't bind to the given address
Christopher Piro [Wed, 20 Feb 2008 08:19:38 +0000 (08:19 +0000)] 
[thrift] Erlang thrift_sup will exit if it can't bind to the given address

Summary: before it would complain and not exit.  that's not right.

Reviewed By: eletuchy

Test Plan: DEATH ENSUES

Revert Plan: sounds reasonable

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665490 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo in the C# generator.
David Reiss [Wed, 20 Feb 2008 05:30:55 +0000 (05:30 +0000)] 
Fix a typo in the C# generator.

Actually, it is not a typo.  The original authors didn't convert one call
to get_java_package to get_csharp_namespace.

Tested by building Thrift.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665489 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix a typo
David Reiss [Wed, 20 Feb 2008 02:28:05 +0000 (02:28 +0000)] 
Fix a typo

Reviewed By: mcslee

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665488 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add "#include <cstdlib>" in a few places and s/malloc/std::malloc/
David Reiss [Tue, 19 Feb 2008 22:47:29 +0000 (22:47 +0000)] 
Thrift: Add "#include <cstdlib>" in a few places and s/malloc/std::malloc/

Summary:
There were a few places where we were calling malloc/reallaoc/free without
including cstdlib (or stdlib.h).  This is broken, but it worked because
other headers that we were including included stdlib.h.  However, on a
platform where this wasn't true, it broke the Thrift build.  This change
adds the proper includes.  It also changes malloc to std::malloc (same
with realloc and free) in a few places, because that is the correct way
of doing it when you include cstdlib.

Reviewed By: mcslee

Test Plan: Compiled Thrift.

Revert Plan: ok

Other Notes:
This bug was noticed by a Thrudb user, and the patch was sent in by
Ross McFarland.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665487 13f79535-47bb-0310-9956-ffa450edef68

17 years agoEnhance C++ test client to make sure that async void is implemented properly
David Reiss [Mon, 18 Feb 2008 02:11:52 +0000 (02:11 +0000)] 
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

17 years agoImplement testAsync for python tests
David Reiss [Mon, 18 Feb 2008 02:11:48 +0000 (02:11 +0000)] 
Implement testAsync for python tests

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665485 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd testAsync to ThriftTest.thrift which verifies async void works properly.
David Reiss [Mon, 18 Feb 2008 02:11:44 +0000 (02:11 +0000)] 
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

17 years agoChange test scripts for Java to point to libthrift.jar in source tree.
David Reiss [Mon, 18 Feb 2008 02:11:39 +0000 (02:11 +0000)] 
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

17 years agoThrift: Add a full-featured JSON protocol for C++.
David Reiss [Mon, 18 Feb 2008 01:49:37 +0000 (01:49 +0000)] 
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

17 years agoThrift: Distinguish between string and binary types in C++ and Java.
David Reiss [Fri, 15 Feb 2008 01:38:18 +0000 (01:38 +0000)] 
Thrift: Distinguish between string and binary types in C++ and Java.

Summary:
The upcoming TJSONProtocol handles string and binary types quite differently.
This change makes that distinction in all parts of the C++ binding.

Java already distinguished between string and binary, but this change
also updates the Java skip method to skip over strings as binary
so we don't get encoding errors when skipping binary data.

Reviewed By: mcslee

Test Plan: make check

Revert Plan: ok

Other Notes:
I just pulled this out of Chad Walters' JSON patch.
The only other change was adding readBinary (or was it writeBinary)
to TDenseProtocol.  Maybe inheriting from TBinaryProtocol wasn't a good idea.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665481 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Python test improvements.
David Reiss [Fri, 15 Feb 2008 01:10:23 +0000 (01:10 +0000)] 
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

17 years agoThrift: Fix a bug in the skip function in Python's fastbinary.c
David Reiss [Thu, 14 Feb 2008 20:20:08 +0000 (20:20 +0000)] 
Thrift: Fix a bug in the skip function in Python's fastbinary.c

Reviewed By: mcslee

Other Notes:
Submitted by Ben Maurer (the original author).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665479 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] making generated php struct readers more compact
eletuchy [Wed, 13 Feb 2008 22:44:24 +0000 (22:44 +0000)] 
[thrift] making generated php struct readers more compact

Summary: introducing a $bin_accel variable in struct reader scope that
         can be reference by the deserializers of each field

Reviewed By: dreiss, mcslee

Test Plan: regenerated a thrift service, compared before and after calls

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665478 13f79535-47bb-0310-9956-ffa450edef68

17 years ago [thrift] grrrr ... TPhpStream can read the string '0'
eletuchy [Wed, 13 Feb 2008 22:41:03 +0000 (22:41 +0000)] 
[thrift] grrrr ... TPhpStream can read the string '0'

    Summary: php sucks

    Reviewed By: mcslee

    Test Plan: thrift call with string '0' has same behavior as string '1'

    Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665477 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix Java generator for javabean target to construct maps and lists properly
Mark Slee [Wed, 13 Feb 2008 22:03:15 +0000 (22:03 +0000)] 
Fix Java generator for javabean target to construct maps and lists properly

Summary: From Johann Oskarsson

Reviewed By: dreiss

Test Plan: Generate javabean code

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665476 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[erl-thrift] tiny change to exception message for tSocket:connect
eletuchy [Wed, 13 Feb 2008 00:48:15 +0000 (00:48 +0000)] 
[erl-thrift] tiny change to exception message for tSocket:connect

Summary: calls integer_to_list on the port

Reviewed By: dreiss

Test Plan: connected a client to non-running server. oh noes, exception.

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665475 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add some macros to configure.ac.
David Reiss [Mon, 11 Feb 2008 23:24:47 +0000 (23:24 +0000)] 
Thrift: Add some macros to configure.ac.

Summary:
./bootstrap.sh has been throwing warnings because we haven't kept
configure.ac up to date.  This fixes that.

Reviewed By: mcslee

Test Plan: ./boostrap.sh

Revert Plan: ok

Other Notes:
Contributed by Dan Sully.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665474 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift haskell getTransport working
iproctor [Mon, 11 Feb 2008 22:59:01 +0000 (22:59 +0000)] 
Thrift haskell getTransport working

Summary: getTransport is now a method of Protocol. To flush the transport one does tflush (getTransport p) instead of pflush p. This is more like how it is done with other languages.

Reviewed By: dcorson

Test Plan: Ran thrifttest for haskell.

Revert: OK

DiffCamp Revision: 7515

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665473 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug with local reflection and namespaces.
David Reiss [Sat, 9 Feb 2008 02:51:43 +0000 (02:51 +0000)] 
Thrift: Fix a bug with local reflection and namespaces.

Summary:
References to "local reflections" in other thrift files were not given
namespace prefixes, give undefined symbol errors.  This change
distinguishes between relfection names being generated for declarations
(not namespaced) and those that could be external references (namespaced).

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

==> test1.thrift <==
cpp_namespace ns
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
enum dummy_enum_workaround { I_AM_A_WORKAROUND }
struct baz {
  1: test1.foo qux
}

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665472 13f79535-47bb-0310-9956-ffa450edef68

17 years agoGetters for input/output protocol in client lib
Mark Slee [Sat, 9 Feb 2008 00:26:29 +0000 (00:26 +0000)] 
Getters for input/output protocol in client lib

Summary: Why not, nice to have. From Ted Dziuba.

Reviewed By: dreiss

Test Plan: Build Java compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665471 13f79535-47bb-0310-9956-ffa450edef68

17 years agoUse interfaces, not classes for Java gen
Mark Slee [Sat, 9 Feb 2008 00:18:32 +0000 (00:18 +0000)] 
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

17 years agoPatch from Ross McFarland to compile with strict warnings
Mark Slee [Sat, 9 Feb 2008 00:02:26 +0000 (00:02 +0000)] 
Patch from Ross McFarland to compile with strict warnings

Summary: Use comment trick in params that are unused to prevent warnings

Reviewed By: dreiss

Test Plan: Generate C++ code and compile -W -Wall

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665469 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug in local reflection generation.
David Reiss [Fri, 8 Feb 2008 21:58:06 +0000 (21:58 +0000)] 
Thrift: Fix a bug in local reflection generation.

Summary:
The problem was that in generate_local_reflection, we refused to
generate reflections for types defined in another program, including enums.
But in local_reflection_name, we treated enums like base types,
assuming that their reflections were always defined in this program.
One solution would be to treat enums like base types everywhere, and always
generate their reflections in the program where they were being used.
But this change takes the opposite approach.  We now always
generate fingerprints for enums in the program in which they are defined,
even if they are not used there.

Reviewed By: mcslee

Test Plan:
Got the following files to build and link correctly with -dense.

dreiss@dreiss-vmware:reflection:thrift/test$ tail test[12].thrift
==> test1.thrift <==
enum foo { bar }

==> test2.thrift <==
include "test1.thrift"
struct baz {
  1: test1.foo qux
}

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665468 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Whitespace cleanup.
David Reiss [Wed, 6 Feb 2008 22:18:40 +0000 (22:18 +0000)] 
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

17 years agoThrift: Update some makefiles to make "make dist" work.
David Reiss [Wed, 6 Feb 2008 22:10:26 +0000 (22:10 +0000)] 
Thrift: Update some makefiles to make "make dist" work.

Reviewed By: mcslee

Test Plan: Ran "make dist" and did a diff.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665466 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Add a Makefile to build the C# library with Mono.
David Reiss [Wed, 6 Feb 2008 22:10:12 +0000 (22:10 +0000)] 
Thrift: Add a Makefile to build the C# library with Mono.

Reviewed By: mcslee

Test Plan: Installed Mono and built it.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665465 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Miscellaneous optimizations for C#.
David Reiss [Wed, 6 Feb 2008 22:09:58 +0000 (22:09 +0000)] 
Thrift: Miscellaneous optimizations for C#.

Reviewed By: mcslee

Test Plan: Built it after a future revision.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665464 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: String/Binary distinction for C#.
David Reiss [Wed, 6 Feb 2008 22:09:44 +0000 (22:09 +0000)] 
Thrift: String/Binary distinction for C#.

Reviewed By: mcslee

Test Plan: Built it after a future revision.

Revert Plan: ok

Other Notes:
Submitted by Ben Maurer.
Actually reviewed by Todd Berman.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665463 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift/Ruby: Bug fix.
David Reiss [Wed, 6 Feb 2008 18:22:39 +0000 (18:22 +0000)] 
Thrift/Ruby: Bug fix.

Summary:
Some member variables were actually being treated as local variables.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Actually reviewed by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665462 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Revamp TMemoryBuffer constructors.
David Reiss [Mon, 4 Feb 2008 21:56:27 +0000 (21:56 +0000)] 
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

17 years agoMake inner Isset classes implement serializable
Mark Slee [Mon, 4 Feb 2008 21:34:22 +0000 (21:34 +0000)] 
Make inner Isset classes implement serializable

Summary: Since the outer class is serializable, you'll want it on the inner member too. Though in general you shouldn't be using Java to serialize Thrift objects, as that misses the point and tosses version compatibility out the window.

Reviewed By: dreiss

Test Plan: Generate Java code

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665460 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Update CONTRIBUTORS.
David Reiss [Mon, 4 Feb 2008 21:28:20 +0000 (21:28 +0000)] 
Thrift: Update CONTRIBUTORS.

Summary:
Forgot to mention in my last commit that the bulk of the change was
submitted by Nitay.  Updating the CONTRIBUTORS file while I'm at it.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665459 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: "make check" support.
David Reiss [Mon, 4 Feb 2008 21:14:14 +0000 (21:14 +0000)] 
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

17 years agoThrift: Forgot to dereference a pointer.
David Reiss [Mon, 4 Feb 2008 19:24:00 +0000 (19:24 +0000)] 
Thrift: Forgot to dereference a pointer.

Summary:
This didn't get updated when the interface changed,
and the cast silenced the warning message.  Stupid C.

Reviewed By: mcslee

Test Plan: Trust Chad Walters.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665457 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix a bug in a test program.
David Reiss [Mon, 4 Feb 2008 19:23:57 +0000 (19:23 +0000)] 
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

17 years agoThrift: Make borrow (almost) always succeed for TBufferedTransport.
David Reiss [Sat, 2 Feb 2008 00:54:55 +0000 (00:54 +0000)] 
Thrift: Make borrow (almost) always succeed for TBufferedTransport.

Chad Walters is writing a JSON protocol for Thrift, but he wants
borrow to always succeed.  That would be a pain to implement,
but here is a first step: borrow will almost always work with
TBufferedTransport.

Reviewed by: mcslee

Test Plan: Ran the DenseProtocol test and Zlib test, but more needs to be done.

Other Notes:
Also reviewed by Chad Walters, and maybe Ben Maurer.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665455 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Update the interface for TTransport's "borrow" method.
David Reiss [Sat, 2 Feb 2008 00:54:48 +0000 (00:54 +0000)] 
Thrift: Update the interface for TTransport's "borrow" method.

Summary:
I don't know what I was thinking when I first wrote this.
It makes sense that the transport might not want to allocate its own memory,
so the protocol is expected to provide a buffer for the data.
However, if the transport already has the data buffered,
there is no need to memcpy it; it can just return a pointer into its buffer.
The new interface still requires the protocol to provide a buffer,
but allows the transport to return a pointer to an interal buffer.
In addition, I made len a pass-by-pointer parameter so that
the transport can return more than the requested data if it has it
available in its buffers.

Reviewed By: mcslee

Test Plan: Ran the DenseProtocol test and the Zlib test.

Revert Plan: ok

Other Notes:
Also got this reviewed by Chad Walters from Powerset.
Ben Maurer suggested making len a reference parameter.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665454 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] Fix generated T_LIST push_back() for cpptype override
dweatherford [Fri, 1 Feb 2008 20:42:56 +0000 (20:42 +0000)] 
[thrift] Fix generated T_LIST push_back() for cpptype override

Summary: Thrift compiler emitting code missing a closing paren:
  "this->extras.push_back(_elem18;"
Reviewed by: eletuchy
Test plan: rebuild some feed code that uses cpptype overrides
Revert: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665453 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix to the throws clause validation
Mark Slee [Fri, 1 Feb 2008 01:36:26 +0000 (01:36 +0000)] 
Fix to the throws clause validation

Summary: Types from external files are not resolved until the program parse pass, not the include one. Therefore, only do full type validation once after all includes have been parsed and external type pointers resolved.

Reviewed By: aditya

Test Plan: build ServiceManager.thrift

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665452 13f79535-47bb-0310-9956-ffa450edef68

17 years agoIf a list has a custom CPP type, use push_back
Mark Slee [Thu, 31 Jan 2008 22:02:26 +0000 (22:02 +0000)] 
If a list has a custom CPP type, use push_back

Summary: Can't deserialize by reference into std::list, for example

Reviewed By: dweatherford

Test Plan: Build feed

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665451 13f79535-47bb-0310-9956-ffa450edef68

17 years agoValidate that throws clauses in Thrift contain only exceptions
Mark Slee [Thu, 31 Jan 2008 01:49:16 +0000 (01:49 +0000)] 
Validate that throws clauses in Thrift contain only exceptions

Summary: Throwing non-exceptions, though allowed in some languages, is a weird concept and causes problems in many places. Disallow it in the Thrift compiler and throw an informative error.

Reviewed By: dreiss

Test Plan: Generate a file with an int or something in a throws clause. Peep the nice informative compiler error.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665450 13f79535-47bb-0310-9956-ffa450edef68

17 years agoImprove C++ vector deserialization
Mark Slee [Thu, 31 Jan 2008 00:06:29 +0000 (00:06 +0000)] 
Improve C++ vector deserialization

Summary: Use std::vector::resize() method to default construct placeholder elements. Then grab references via operator[] to deserialize directly into the vector, instead of copy-constructing elements in.

Reviewed By: hzhao

Test Plan: test/cpp contains list serialization/deserialization checks

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665449 13f79535-47bb-0310-9956-ffa450edef68

17 years agoImprove Thrift map deserialization code
Mark Slee [Wed, 30 Jan 2008 23:23:15 +0000 (23:23 +0000)] 
Improve Thrift map deserialization code

Summary: Instead of copy-constructing map values into the map, alter the code such that we insert default-constructed elements into the map and then deserialize them by reference.

Reviewed By: hzhao

Test Plan: Ran the test in test/cpp which include serialization and deserialization of nested maps.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665448 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] iolists and binaries in Erlang
Christopher Piro [Wed, 30 Jan 2008 01:39:01 +0000 (01:39 +0000)] 
[thrift] iolists and binaries in Erlang

Summary: three related changes:
 * for numeric types in tBinaryProtocol call effectful_write with binary(), not [char()]
 * tBinaryProtocol:writeString now takes either [char()], iolist(), or binary() ... now you can use any of the three where a Thrift string is required
 * tBufferedTransport now buffers by building an iolist() rather than Buffer++Data.  zomg.

Reviewed By: eletuchy

Test Plan: everything seems to work as usual, and binary() works as expected

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665447 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift/Ruby: Generate nicer constructors for Thrift structs.
David Reiss [Mon, 28 Jan 2008 20:47:00 +0000 (20:47 +0000)] 
Thrift/Ruby: Generate nicer constructors for Thrift structs.

Submitted by William Morgan.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665446 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift/Ruby: Allow some thrift exceptions to use standard Ruby syntax.
David Reiss [Mon, 28 Jan 2008 20:46:57 +0000 (20:46 +0000)] 
Thrift/Ruby: Allow some thrift exceptions to use standard Ruby syntax.

Submitted by William Morgan.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665445 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift/Ruby: TSimpleServer closes its listen socket on an uncaught exception.
David Reiss [Mon, 28 Jan 2008 20:46:53 +0000 (20:46 +0000)] 
Thrift/Ruby: TSimpleServer closes its listen socket on an uncaught exception.

Submitted by William Morgan.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665444 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift/Ruby: Remove a debugging message.
David Reiss [Mon, 28 Jan 2008 20:46:50 +0000 (20:46 +0000)] 
Thrift/Ruby: Remove a debugging message.

Submitted by William Morgan.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665443 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Better exception handling in Ruby.
David Reiss [Fri, 25 Jan 2008 20:12:26 +0000 (20:12 +0000)] 
Thrift: Better exception handling in Ruby.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Submitted by William Morgan.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665442 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Some sort of Ruby performance fix.
David Reiss [Fri, 25 Jan 2008 20:05:50 +0000 (20:05 +0000)] 
Thrift: Some sort of Ruby performance fix.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Submitted by Dave Simpson.
Approved by Kevin Clark.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665441 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Allow a custom User-Agent with the Cocoa THttpClient.
David Reiss [Wed, 23 Jan 2008 20:35:39 +0000 (20:35 +0000)] 
Thrift: Allow a custom User-Agent with the Cocoa THttpClient.

Reviewed By: mcslee

Test Plan: None.

Other Notes:
Submitted by Andrew McGeachie, the author of the Cocoa bindings.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665440 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift CSharp build to check compiler return code
Mark Slee [Tue, 22 Jan 2008 04:04:30 +0000 (04:04 +0000)] 
Thrift CSharp build to check compiler return code

Summary: If non-zero, toss an error to the log

Reviewed By: dreiss

Other Notes: Submitted by Will Palmeri

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665439 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] Ruby TThreadedServer and TThreadPoolServer
Christopher Piro [Fri, 18 Jan 2008 21:35:34 +0000 (21:35 +0000)] 
[thrift] Ruby TThreadedServer and TThreadPoolServer

Summary: They both use the same handler for all connections and thus assume the handler is thread-safe. The TThreadPoolServer preserves threads, so it wouldn't be too hard to make a variant that used a separate handler for each thread and thus didn't require thread safety.

Reviewed By: mcslee

Test Plan: loads without error

Revert Plan: ok

Other Notes: contributed by William Morgan (w@adap.tv)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665438 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Change the way constants are initialized to avoid segfaults.
David Reiss [Fri, 18 Jan 2008 07:39:36 +0000 (07:39 +0000)] 
Thrift: Change the way constants are initialized to avoid segfaults.

Reviewed By: mcslee

Test Plan: Looked at the patch carefully.

Other Notes:
Patch submitted by Dave Simpson.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665437 13f79535-47bb-0310-9956-ffa450edef68

17 years agotest trigger
mvaradachari [Fri, 18 Jan 2008 01:54:55 +0000 (01:54 +0000)] 
test trigger

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665436 13f79535-47bb-0310-9956-ffa450edef68

17 years agotest triggers
mvaradachari [Fri, 18 Jan 2008 01:00:18 +0000 (01:00 +0000)] 
test triggers

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665435 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix set_name compiler method signature
Mark Slee [Fri, 18 Jan 2008 00:57:59 +0000 (00:57 +0000)] 
Fix set_name compiler method signature

Reviewed By: kholst

Other Notes: Follow up from 78130

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665434 13f79535-47bb-0310-9956-ffa450edef68

17 years agoFix typo of current
Mark Slee [Wed, 16 Jan 2008 21:29:45 +0000 (21:29 +0000)] 
Fix typo of current

Summary: Whoops.

Reviewed By: dreiss

Other Notes: Submitted by Patrick Collison

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665433 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Improve cleanup.sh.
David Reiss [Wed, 16 Jan 2008 06:32:19 +0000 (06:32 +0000)] 
Thrift: Improve cleanup.sh.

Reviewed By: mcslee

Test Plan:
dreiss@dreiss-vmware:cleanup:thrift$ ./bootstrap.sh && ./configure && make -j2 && ./cleanup.sh && git status
# Shows no untracked files.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665432 13f79535-47bb-0310-9956-ffa450edef68

17 years agothrift: Add -cpp_use_include_prefix flag to compiler
kholst [Wed, 16 Jan 2008 02:47:41 +0000 (02:47 +0000)] 
thrift: Add -cpp_use_include_prefix flag to compiler

Summary: Adds a new flag to allow for a mode where #include statements in generated c++ will include path context information.  For example, if my .thrift file includes "foo/bar/baz.thrift", the generated source files will contain #include statements like:

         #include "foo/bar/gen-cpp/baz_types.h"

         instead of just:

         #include "baz_types.h"

         -cpp_use_include_prefix is OFF by default.

Reviewed By: dreiss

Test Plan: Tested against multiple thrift input files both with and without the new flag.

Revert: OK

DiffCamp Revision: 5522

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665431 13f79535-47bb-0310-9956-ffa450edef68

17 years agoMake sure exceptinos in servers are caught
Mark Slee [Wed, 16 Jan 2008 00:38:20 +0000 (00:38 +0000)] 
Make sure exceptinos in servers are caught

Summary: There was potential for a write exception in close() because it might call flush() internally

Reviewed By: dreiss

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665430 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Fix formatting of the CONTRIBUTORS file.
David Reiss [Tue, 15 Jan 2008 19:45:02 +0000 (19:45 +0000)] 
Thrift: Fix formatting of the CONTRIBUTORS file.

Reviewed By: mcslee

Test Plan: no

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665429 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] flesh out thrift Erlang tutorial client
Christopher Piro [Tue, 15 Jan 2008 12:52:51 +0000 (12:52 +0000)] 
[thrift] flesh out thrift Erlang tutorial client

Summary: Added examples for all examples except inheritance and application exception handling (divide by zero); looks like both are currently broken.  Weak.

Reviewed By: eletuchy

Test Plan: works just like RubyClient.rb (modulo the commented out bits)

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665428 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] preliminary tthrift tutorial client for Erlang
Christopher Piro [Tue, 15 Jan 2008 12:04:15 +0000 (12:04 +0000)] 
[thrift] preliminary tthrift tutorial client for Erlang

Summary: we haven't had a client tutorial for the longest time -- added one that basically works.  will iron the bugs out in due order.

Reviewed By: eletuchy

Test Plan: works when launched like server.sh

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665427 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] add a configuration file to the Erlang server tutorial
Christopher Piro [Tue, 15 Jan 2008 12:04:12 +0000 (12:04 +0000)] 
[thrift] add a configuration file to the Erlang server tutorial

Summary: Logger configuration (and all Thrift config in Erlang) now uses application:get_env/2 via thrift:config/2.  Defaults can be provided on the erl command line with ``-config <filename>''.  It may also be helpful to cascade config files; {key, value} pairs provided in subsequent files will override previous ones -- e.g. in our applications we use ``-config base.config -config cpiro.config''.

server.config was added as an example and server.sh was updated to invoke erl with ``-config server.config''.

Reviewed By: eletuchy

Test Plan: the tutorial server now outputs a reasonable set of messages

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665426 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] update thrift_logger bits in Erlang server tutorial
Christopher Piro [Tue, 15 Jan 2008 12:04:09 +0000 (12:04 +0000)] 
[thrift] update thrift_logger bits in Erlang server tutorial

Summary: thrift_logger changed a while back but the tutorial didn't keep up.  fixed.

Reviewed By: eletuchy

Test Plan: compiles now :p

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665425 13f79535-47bb-0310-9956-ffa450edef68

17 years agoAdd some more TThreadPoolServer constructors
Mark Slee [Tue, 15 Jan 2008 02:59:12 +0000 (02:59 +0000)] 
Add some more TThreadPoolServer constructors

Summary: Change the default to Executors.newCachedThreadPool() which is a good default and basically what we should always want.

Reviewed By: dreiss

Test Plan: Run a Java server with default args

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665424 13f79535-47bb-0310-9956-ffa450edef68

17 years agoGenerate structs/exceptions in declared order
Mark Slee [Mon, 14 Jan 2008 23:04:43 +0000 (23:04 +0000)] 
Generate structs/exceptions in declared order

Summary: Otherwise you're liable to get forward declaration problems in the generated C++ code.

Reviewed By: dreiss

Test Plan: Generate some code that mixes exceptions/structs and has methods potentially return a list of exceptions

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665423 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] fix thrift_logger.erl when show_pid option is enabled
Christopher Piro [Mon, 14 Jan 2008 05:54:50 +0000 (05:54 +0000)] 
[thrift] fix thrift_logger.erl when show_pid option is enabled

Summary: this gets rid of a lot of messy useless output every time the error logger prints something

Reviewed By: eletuchy

Test Plan: works as expected

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665422 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: C# Bindings.
David Reiss [Fri, 11 Jan 2008 20:59:12 +0000 (20:59 +0000)] 
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

17 years agoThrift: MinGW port.
David Reiss [Fri, 11 Jan 2008 20:59:03 +0000 (20:59 +0000)] 
Thrift: MinGW port.

Summary:
Todd Berman from imeem has contributed a patch that allows
the Thrift compiler to be built with MinGW and run on Windows.

Reviewed By: mcslee

Test Plan:
Built the compiler from scratch on Linux.
If my changes messed up the MinGW build, I'm sure Todd will yell at me.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665420 13f79535-47bb-0310-9956-ffa450edef68

17 years agoChagnge TThreadPoolServer in Java to use SynchronousQueue by default
Mark Slee [Thu, 10 Jan 2008 19:57:47 +0000 (19:57 +0000)] 
Chagnge TThreadPoolServer in Java to use SynchronousQueue by default

Summary: Read the documentation on ThreadPoolExecutor. It's very confusing. Basically, what we want is a queue that always defers to the threadpool and will always create a new thread to do work. We never want the queue to take priority over the thread pool by default.

Reviewed By: dreiss

Test Plan: Run a Java Thrift server

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665419 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRuby default values patch
Mark Slee [Thu, 10 Jan 2008 00:53:08 +0000 (00:53 +0000)] 
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

17 years agoFix generation for Byte/byte while we're at it
Mark Slee [Wed, 9 Jan 2008 19:51:24 +0000 (19:51 +0000)] 
Fix generation for Byte/byte while we're at it

Summary: If in a container, use Byte not byte

Reviewed By: dreiss

Test Plan: Generate a list of bytes

Other Notes: based upon Kyle's submission

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665417 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Java generator bugfix.
David Reiss [Wed, 9 Jan 2008 19:20:20 +0000 (19:20 +0000)] 
Thrift: Java generator bugfix.

Reviewed By: mcslee

Test Plan: None.

Revert Plan: ok

Other Notes:
Reported by Kyle Shank.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665416 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] in erlang add {nodelay, true} and {reuseaddr, true} to gen_tcp socket options
Christopher Piro [Tue, 8 Jan 2008 03:14:19 +0000 (03:14 +0000)] 
[thrift] in erlang add {nodelay, true} and {reuseaddr, true} to gen_tcp socket options

Summary: for parity with the C++ implementation

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665415 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] py: TApplicationException.__str__
dweatherford [Mon, 7 Jan 2008 22:23:07 +0000 (22:23 +0000)] 
[thrift] py: TApplicationException.__str__

Summary: Now infinitely more printable than ever before!
Reviewed by: mcslee
Test Plan: except TApplicationException, inst: \n\t\t print inst
Revert: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665414 13f79535-47bb-0310-9956-ffa450edef68

17 years agoRemove bogus Iface inclusion from Ruby tutorial
Mark Slee [Mon, 7 Jan 2008 21:50:30 +0000 (21:50 +0000)] 
Remove bogus Iface inclusion from Ruby tutorial

Reviewed By: mcslee

Test Plan: The Ruby tutorial is runnable with this fix

Other Notes: Submitted by Eric Wong

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665413 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[Thrift] disabling catching general type exceptions in Tthreadpoolserver
pfung [Sat, 5 Jan 2008 23:23:53 +0000 (23:23 +0000)] 
[Thrift] disabling catching general type exceptions in Tthreadpoolserver

the threadpoolserver should just crash if an unknown exception type is thrown.

This should probably be true for all server types, will put this on the TODO list.

reviewed by jwang
test plan: network selector servers in production

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665412 13f79535-47bb-0310-9956-ffa450edef68

17 years ago[thrift] add show_pid option to thrift.app.src (Erlang)
Christopher Piro [Fri, 4 Jan 2008 00:21:18 +0000 (00:21 +0000)] 
[thrift] add show_pid option to thrift.app.src (Erlang)

Summary: we've been using this option in our apps but we never added it to thrift's own config

Reviewed By: eletuchy

Test Plan: ok

Other Notes: contributed by Jason Ganetsky (jason@amiestreet.com)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665411 13f79535-47bb-0310-9956-ffa450edef68

17 years agoremoved exit status checking for autoconf in bootstrap.sh -- new changes break builds
mvaradachari [Tue, 1 Jan 2008 04:51:24 +0000 (04:51 +0000)] 
removed exit status checking for autoconf in bootstrap.sh -- new changes break builds

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665410 13f79535-47bb-0310-9956-ffa450edef68

17 years agoThrift: Revamp build to use a single configure.ac.
David Reiss [Fri, 28 Dec 2007 18:25:33 +0000 (18:25 +0000)] 
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

17 years ago[thrift] service functions that begin with a Capital now work for Erlang ...
eletuchy [Thu, 27 Dec 2007 15:20:14 +0000 (15:20 +0000)] 
[thrift] service functions that begin with a Capital now work for Erlang ...

Summary: ... The main interface function has the same name, but as an escaped atom
         (ie 'CapitalizedFun'(Arg1, Arg2) -> is the function sig)

Reviewed by: dweatherford

Test Plan: tested with the following thrift
     service foo {
         Struct1 CapitalizedFun(1: list<Struct2> param);
     }

     Generated erlang code now compiles

Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665408 13f79535-47bb-0310-9956-ffa450edef68