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
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
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
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
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
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
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
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
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
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:
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
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
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: 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
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
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
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: ... 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
Summary:
This patch allows the TBinaryProtocol to encode wide character strings
as UTF-8 before serializing. It does not support decoding when receiving.
Reviewed By: mcslee
Test Plan: None.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665407 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- it should be possible to specify a zero timeout if the pendingTaskQueue
is already full
Reviewed By: marc
Test Plan:
- Tested in search
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665406 13f79535-47bb-0310-9956-ffa450edef68
Summary: All the subclasses do that so it causes warnings not to and is dumb because copy constructing std::string is dumb
Reviewed By: kholst
Test Plan: Generate some codes, compile with -Werror
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665405 13f79535-47bb-0310-9956-ffa450edef68
Summary: const so that catching via "catch (const TTransportException& e)" works
properly, and throw() for good convention.
Reviewed By: mcslee
Test Plan: still compiles
Revert: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665403 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: boz
Test Plan:
dreiss@dreiss-vmware:safe_concurrency:thrift/test$ nl -ba guard_test.cc
1 #include "../lib/cpp/src/concurrency/Mutex.h"
2 using facebook::thrift::concurrency::Guard;
3 void test() {
4 facebook::thrift::concurrency::Mutex m;
5 Guard(m);
6 Guard g1(m);
7
8 facebook::thrift::concurrency::ReadWriteMutex rwm;
9 facebook::thrift::concurrency::RWGuard(m);
10 facebook::thrift::concurrency::RWGuard g2(rwm);
11 }
dreiss@dreiss-vmware:safe_concurrency:thrift/test$ g++ -c guard_test.cc
guard_test.cc: In function ‘void test()’:
guard_test.cc:5: error: ‘incorrect_use_of_Guard’ was not declared in this scope
guard_test.cc:9: error: ‘incorrect_use_of_RWGuard’ is not a member of ‘facebook::thrift::concurrency’
dreiss@dreiss-vmware:safe_concurrency:thrift/test$
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665402 13f79535-47bb-0310-9956-ffa450edef68
Summary: Solution, dummy static class var to use instanceof
Reviewed By: dweatherford
Test Plan: Regen'd some mobile code in trunk using this
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665401 13f79535-47bb-0310-9956-ffa450edef68
Summary: there's a new format for errors in R12B-0, so don't echo a crash report if it matches the new one
Reviewed By: eletuchy
Test Plan: completely unnecessary
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665400 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Thrifted ThriftTest.thrift and looked at the output.
Revert Plan: ok
Other Notes:
Based on a patch from Jon Dugan.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665399 13f79535-47bb-0310-9956-ffa450edef68
Summary:
The Java generator wasn't setting default values for base types
in the zero argument constructor. This check was probably brought over
from the C++ generator, where base types are given their default values
in the member variable initializer list (or whatever that thing is called).
Blame Rev: Somewhere in the mysterious past. I tried to find it, but failed.
Reviewed By: mcslee
Test Plan: Recompiled Thrift and thrifted a file that showed the bug.
Revert Plan: ok
Other Notes:
Bug reported by Jake Luciani.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665398 13f79535-47bb-0310-9956-ffa450edef68
Summary: Because self. puts you in public scope
Reviewed By: mcslee
Test Plan: Use Ruby framed transport
Other Notes: Submitted by Jake Luciani
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665397 13f79535-47bb-0310-9956-ffa450edef68
Summary:
A feature to improve handling of invalid wire data by the Java Thrift library.
Reviewed By: mcslee
Test Plan: I trust Dave Engberg.
Revert Plan: ok
Other Notes:
Submitted by Dave Engberg.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665393 13f79535-47bb-0310-9956-ffa450edef68
Reviewed By: mcslee
Test Plan: Built the compiler.
Revert Plan: ok
Other Notes:
Contributed by Ben Matasar.
Signed off by Patrick Collison.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665391 13f79535-47bb-0310-9956-ffa450edef68