common/thrift.git
17 years agoThrift: Fix fastbinary.c for Python 2.4.
David Reiss [Sun, 26 Aug 2007 02:21:24 +0000 (02:21 +0000)] 
Thrift: Fix fastbinary.c for Python 2.4.

Summary:
The recently committed fastbinary.c doesn't compile with Python 2.4.
This version does.

Blame Rev: 56816

Reviewed By: mcslee

Test Plan: make install on devrs004

Revert Plan: Do 56816 also.

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

17 years agoThrift: Native-code Binary Protocol encoder.
David Reiss [Sat, 25 Aug 2007 18:01:30 +0000 (18:01 +0000)] 
Thrift: Native-code Binary Protocol encoder.

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

17 years agoPossible Thrift memory leak
Mark Slee [Fri, 24 Aug 2007 19:24:10 +0000 (19:24 +0000)] 
Possible Thrift memory leak

Summary: Don't throw new Exception, just throw Exception

Reviewed By: mcslee

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

17 years agoThrift: TMemoryBuffer::getAppendBufferToString fix.
David Reiss [Fri, 24 Aug 2007 00:19:12 +0000 (00:19 +0000)] 
Thrift: TMemoryBuffer::getAppendBufferToString fix.

Summary:
Same fix as getBufferAsString

Blame Rev: 55988

Reviewed By: dreiss

Test Plan: Thrift compiles.

Revert Plan: ok

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

17 years agoTrivial automake fix
Mark Slee [Thu, 23 Aug 2007 23:19:56 +0000 (23:19 +0000)] 
Trivial automake fix

Summary: Apparently needed to fix some install stuff

Reviewed By: mcslee

Test Plan: Build thrift compiler

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

17 years agoThrift: Make use of get_true_type.
David Reiss [Thu, 23 Aug 2007 21:43:25 +0000 (21:43 +0000)] 
Thrift: Make use of get_true_type.

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

17 years agoThrift: TMemoryBuffer::getBufferAsString only returns written portion.
David Reiss [Thu, 23 Aug 2007 17:20:38 +0000 (17:20 +0000)] 
Thrift: TMemoryBuffer::getBufferAsString only returns written portion.
(This change was by Adam, diff sent by email, I'm just checking it in.)

Blame Rev: 55988

Reviewed By: adam

Test Plan: Thrift compiles.

Revert Plan: ok

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

17 years agoThrift: No using namespace.
David Reiss [Thu, 23 Aug 2007 02:37:19 +0000 (02:37 +0000)] 
Thrift: No using namespace.

Summary:
using namespace XXX; is tricky because it imports a lot of crap into your namespace.
Also, if we ever decide to remove boost as a dependency, "using namespace boost"
makes it harder.

This patch removes all using namesapce XXX; with one or more using XXX::YYY;
There are some exceptions, such as test, tutorial, namespace std, and
facebook namespaces.

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
grep --binary-files=without-match -r 'using namespace' . | \
  egrep -v '^[^:]*: *using namespace (std;$|facebook)' | \
  grep -v '<< endl' | \
  grep -v '[^:]*/tutorial/' | \
  grep -v '^./test/'

Revert Plan: ok

Notes: I wouldn't bother, but it is fixathon.

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

17 years agoFix TNonBlockingServer libevent issue in ThreadPool mode
Mark Slee [Thu, 23 Aug 2007 01:43:20 +0000 (01:43 +0000)] 
Fix TNonBlockingServer libevent issue in ThreadPool mode

Summary: If using TNonBlockingServer with a ThreadManager, when you send a task off to the threadmanager you need to cancel the event that you have set on that client socket. Otherwise, when you give control back to libevent, it might trigger more read events if there are more requests coming down the pipe. This is an issue, because the server will be in the wrong state at that point and will have no way of handling reading more data if it is still in the WAIT_TASK state trying to see if it should write something back to the client. So, when we hit that control flow, we must setIdle() on the TConnection so that libevent doesn't trigger it anymore. Later, after the result is written, we'll setRead() and go back to the init state.

Reviewed By: akhil

Test Plan: Akhil's async + TNonBlocking karma server

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

17 years agoThrift: TMemoryBuffer now handles NULLs again.
David Reiss [Thu, 23 Aug 2007 00:14:48 +0000 (00:14 +0000)] 
Thrift: TMemoryBuffer now handles NULLs again.

Summary:
Boz is using TMemoryBuffer by constructing it will a NULL buffer,
then doing a resetBuffer later.  This patch re-enables that.

Blame Rev: 55988

Reviewed By: aditya

Test Plan:
Thrift compiles.
Will test feed after this is comitted.

Revert Plan: ok

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

17 years agoThrift: Better handling of strerror_r.
David Reiss [Wed, 22 Aug 2007 23:20:24 +0000 (23:20 +0000)] 
Thrift: Better handling of strerror_r.

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

17 years agoThrift: Bugfix.
David Reiss [Wed, 22 Aug 2007 02:32:11 +0000 (02:32 +0000)] 
Thrift: Bugfix.

Summary: Missed one.

Blame Rev: 55988

Reviewed By: yunfang

Test Plan: make

Revert Plan: ok

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

17 years agoThrift: Move TStringBuffer functionality into TMemoryBuffer.
David Reiss [Tue, 21 Aug 2007 23:59:34 +0000 (23:59 +0000)] 
Thrift: Move TStringBuffer functionality into TMemoryBuffer.

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

17 years agoNeed sys/types.h includes for FreeBSD
Mark Slee [Tue, 21 Aug 2007 02:39:57 +0000 (02:39 +0000)] 
Need sys/types.h includes for FreeBSD

Reviewed By: dreiss

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

17 years agoFix thread_t cast again
Mark Slee [Tue, 21 Aug 2007 02:39:40 +0000 (02:39 +0000)] 
Fix thread_t cast again

Summary: reinterpret_cast actually breaks on linux, despite working on FreeBSD

Reviewed By: dreiss

Test Plan: Compile on Linux OR FreeBSD

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

17 years agoUse reinterpret_cast instead of static_cast for pthread_t => Thread::id_t
Mark Slee [Tue, 21 Aug 2007 01:54:36 +0000 (01:54 +0000)] 
Use reinterpret_cast instead of static_cast for pthread_t => Thread::id_t

Summary: On FreeBSD pthread_t is a pthread*, not uint64_t, so static_cast gest upset

Reviewed By: dreiss

Test Plan: Compile on FreeBSD

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

17 years ago[adding TStringBuffer for serialization/deserialization from a string]
yunfang [Sun, 19 Aug 2007 22:18:38 +0000 (22:18 +0000)] 
[adding TStringBuffer for serialization/deserialization from a string]
Summary:
/**
 * A string buffer is a tranpsort that simply reads from and writes to a
 * string. Anytime you call write on it, the data is serialized
 * into the underlying buffer, you can call getString() to get the serialized
 * string.  Before you call read, you should call resetString(data) to set the
 * underlying buffer, you can then call read to get the
 * de-serialized data structure.
 *
 * The string buffer is inherited from the memory buffer
 * Thus, buffers are allocated using C constructs malloc,realloc, and the size
 * doubles as necessary.
 */

Reviewed by: aditya

Test Plan:
int main(int argc, char** argv) {
  shared_ptr<TStringBuffer> strBuffer(new TStringBuffer());
  shared_ptr<TBinaryProtocol> binaryProtcol(new TBinaryProtocol(strBuffer));

  testStruct a;
  a.i1 = 10;
  a.i2 = 30;
  a.s1 = string("holla back a");

  a.write(binaryProtcol.get());
  string serialized = strBuffer->getString();

  shared_ptr<TStringBuffer> strBuffer2(new TStringBuffer());
  shared_ptr<TBinaryProtocol> binaryProtcol2(new TBinaryProtocol(strBuffer2));

  strBuffer2->resetString(serialized);
  testStruct a2;
  a2.read(binaryProtcol2.get());

  if (a == a2) {
    printf("serialization working\n");
  } else {
    printf("serialization not working\n");
  }
}

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

17 years agoThrift: OCaml TSocket more helpful exceptions
iproctor [Fri, 17 Aug 2007 21:34:15 +0000 (21:34 +0000)] 
Thrift: OCaml TSocket more helpful exceptions
Summary: On unix error it tells you the cause.
Reviewed by: mcslee
Test plan: Had some unix errors, read the messages.
Revert plan: yes

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

17 years agoPerl pass by reference versioning fix
Mark Slee [Fri, 17 Aug 2007 03:53:13 +0000 (03:53 +0000)] 
Perl pass by reference versioning fix

Summary: I hate Perl the most. Submitted by Jake Luciani.

Reviewed By: mcslee

Test Plan: We don't even use the Perl bindings for Thrift, but we could use Jake's test scripts on this.

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

17 years agoMerging Jake Luciani's latest perl code gen fixes
Mark Slee [Thu, 16 Aug 2007 01:26:31 +0000 (01:26 +0000)] 
Merging Jake Luciani's latest perl code gen fixes

Reviewed By: dreiss

Test Plan: Watch for any weirdness on Thrift code gen, perl specific

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

17 years agoGenerate a -u option for Python Service-remote CLI utility
Mark Slee [Thu, 16 Aug 2007 00:27:21 +0000 (00:27 +0000)] 
Generate a -u option for Python Service-remote CLI utility

Summary: In case you want to hit an HTTP Thrift service

Reviewed By: peter

Test Plan: ServiceClient-remote -u http://dope.vip.facebook.com/intern/smc/smcserver.php getTierByName test

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

17 years agoTHRIFT: mutex trylock support
boz [Wed, 15 Aug 2007 20:55:36 +0000 (20:55 +0000)] 
THRIFT: mutex trylock support

Summary: add trylock support to the Mutex class

Reviewed By: mcslee

Test Plan: added trylock mutexes to foreman, walked through them in gdb
(behaved correctly) and then ran an entire sweep (behaved correctly)

Notes: slee ftw

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

17 years agoThrift: Add a useful helper function (in compiler).
David Reiss [Wed, 15 Aug 2007 00:55:41 +0000 (00:55 +0000)] 
Thrift: Add a useful helper function (in compiler).

Summary:
Add a function to t_generator to traverse the typedef chain.

Reviewed By: mcslee

Test Plan:
Rebuilt thrift.
Re-thrifted ThriftTest.thrift.
Saw that the output was unchanged.

Revert Plan: ok

Notes:
Converting all of the generators to use this will happen later.

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

17 years agoThrift: Merging external patch.
David Reiss [Tue, 14 Aug 2007 19:59:26 +0000 (19:59 +0000)] 
Thrift: Merging external patch.

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

17 years agoThrift: docstring revamp step 2.
David Reiss [Tue, 14 Aug 2007 17:12:33 +0000 (17:12 +0000)] 
Thrift: docstring revamp step 2.

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

17 years agoThrift: docstring revamp step 1.
David Reiss [Tue, 14 Aug 2007 17:12:31 +0000 (17:12 +0000)] 
Thrift: docstring revamp step 1.

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

17 years ago[thrift] erlang: log more tTransportExceptions
Christopher Piro [Sat, 11 Aug 2007 01:15:57 +0000 (01:15 +0000)] 
[thrift] erlang: log more tTransportExceptions

Summary: all tTEs were being filtered from the logs; now just tTEs that come from connections closing are suppressed

Test Plan: logs my bug in channel server :)

Notes: adds logic to thrift_logger, not removes (bad news bears)

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

17 years agoThrift: OCaml TSocket fix
iproctor [Fri, 10 Aug 2007 20:48:12 +0000 (20:48 +0000)] 
Thrift: OCaml TSocket fix

Summary: Now closes input channel on close. Also, transport exceptions are cleaner.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes

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

17 years agoFix Java test cases
Mark Slee [Thu, 9 Aug 2007 03:40:15 +0000 (03:40 +0000)] 
Fix Java test cases

Summary: Use the default TBinaryProtocol constructors for better example.

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

17 years agoFix C++ enum deserialization
Mark Slee [Thu, 9 Aug 2007 03:39:18 +0000 (03:39 +0000)] 
Fix C++ enum deserialization

Summary: Because we're all about strict aliasing rules in the g++, m'holmbie.

Reviewed By: aditya

Test Plan: Should be NO compiler warnings about (enum&) -> (int32_t&) typecasting

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

17 years agoThrift: OCaml and HS servers more general
iproctor [Wed, 8 Aug 2007 01:43:39 +0000 (01:43 +0000)] 
Thrift: OCaml and HS servers more general

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

17 years agoThrift: Fix thrift.vim.
David Reiss [Mon, 6 Aug 2007 20:56:30 +0000 (20:56 +0000)] 
Thrift: Fix thrift.vim.

Summary:
thrift.vim has not been deleting its HiLink command.
This causes you to get a (recoverable) error every time you
open a C++ or PHP file after opening a thrift file.
This change deletes the HiLink command, preventing this error.

Reviewed By: martin

Test Plan:
Opened a thrift file, then opened a C++ file in the same session.
Both were highlighted properly.

Revert Plan: ok

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

17 years agoThrift: More constant enums.
David Reiss [Mon, 6 Aug 2007 20:38:18 +0000 (20:38 +0000)] 
Thrift: More constant enums.

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

17 years agoThrift: Fixed rookie mistake.
David Reiss [Mon, 6 Aug 2007 20:33:00 +0000 (20:33 +0000)] 
Thrift: Fixed rookie mistake.

Summary:
This test now works on 32-bit.

Reviewed By: mcslee

Test Plan: Ran the comment at the top of the file.

Revert Plan: ok

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

17 years agoThrift: Improved test case.
David Reiss [Mon, 6 Aug 2007 20:32:59 +0000 (20:32 +0000)] 
Thrift: Improved test case.

Summary:
By "improved", I mean that I added a totally awesome self-referential joke
to one of the test cases.  Seriously.  In a few years someone is going to
add UTF-8 support to the Debug Protocol and run this test case on a terminal
with really good fonts and they are going to die laughing.  Seriously, die.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled everything and ran the test.

Revert Plan:
Take a good, long look in the mirror, then svn revert.

Notes:
I am awesome.

EImportant:

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

17 years ago[thrift] handle timeouts and other errors gracefully (Erlang)
Christopher Piro [Fri, 3 Aug 2007 23:34:55 +0000 (23:34 +0000)] 
[thrift] handle timeouts and other errors gracefully (Erlang)

Reviewed By: iproctor

Test Plan: tutorial, channel

Revert Plan: ok

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

17 years agoTypo and comment fix
Mark Slee [Thu, 2 Aug 2007 06:37:40 +0000 (06:37 +0000)] 
Typo and comment fix

Reviewed By: marc

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

17 years ago-- fix memory leak in TThreadedServer
Aditya Agarwal [Thu, 2 Aug 2007 06:26:11 +0000 (06:26 +0000)] 
-- fix memory leak in TThreadedServer

Summary:
- need detached=true

Reviewed By: mcslee

Test Plan: replayable test case

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

17 years ago[thrift] make Erlang server noisy when handler has error
Christopher Piro [Wed, 1 Aug 2007 23:42:12 +0000 (23:42 +0000)] 
[thrift] make Erlang server noisy when handler has error

Summary: generate an error message at the server ... before only the client got the error

Reviewed By: iproctor

Test Plan: tutorial, channel server

Revert Plan: ok

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

17 years ago[thrift] improved error logging and handling for Erlang bindings
Christopher Piro [Wed, 1 Aug 2007 22:27:37 +0000 (22:27 +0000)] 
[thrift] improved error logging and handling for Erlang bindings

Summary:
 * custom, extensible error logger -- show only relevant stuff
 * clean up of errors in developer-supplied handler module
   now gives sane error messages and doesn't crash whole server
   (introduces tApplicationException_HANDLER_ERROR)
 * more precise catch in tErlProcessor (exits gracefully only if
   transport closes)

Reviewed By: iproctor

Test Plan: tutorial works

Revert Plan: ok

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

17 years ago-- allow packaging of thrift as an rpm
Aditya Agarwal [Tue, 31 Jul 2007 01:36:08 +0000 (01:36 +0000)] 
-- allow packaging of thrift as an rpm

Summary:
- also allows development as a non-root user
- contributed by Ben Maurer

Reviewed By: marc

Test Plan: "compile", install

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

17 years ago-- Adding TMemoryBuffer.py
Aditya Agarwal [Mon, 30 Jul 2007 23:58:37 +0000 (23:58 +0000)] 
-- Adding TMemoryBuffer.py

Summary:
Submitted by Ben Maurer

Reviewed By: mcslee, aditya

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

17 years agoThrift: Allow whole program doctext.
David Reiss [Mon, 30 Jul 2007 23:46:11 +0000 (23:46 +0000)] 
Thrift: Allow whole program doctext.

Summary:
Allow docstrings at the top of the program.

Blame Rev: 52687

Reviewed By: mcslee

Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.

Revert Plan: Do 52687 also.

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

17 years agoThrift: Change docstring syntax.
David Reiss [Mon, 30 Jul 2007 22:00:27 +0000 (22:00 +0000)] 
Thrift: Change docstring syntax.

Summary:
The old docstring syntax collided with the syntax for list constants.
The new syntax looks a lot like doxygent comments.

Trac Bug: #4664

Blame Rev: 32392

Reviewed By: mcslee

Test Plan:
../compiler/cpp/thrift -cpp DocTest.thrift
(with dump_docs on)
and looked at the output.
Generated C++ is identical to installed thrift.

Revert Plan: ok

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

17 years agoFix Thrift compiler to support reuse of enums and constants in later constants
Mark Slee [Fri, 27 Jul 2007 22:14:41 +0000 (22:14 +0000)] 
Fix Thrift compiler to support reuse of enums and constants in later constants

Summary: So for example, you can make a constant map of enum values to string identifiers.

Reviewed By: dreiss

Test Plan: ConstantsDemo.thrift in the test folder

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

17 years ago[Thrift] fixing python server socket bind permissions
pfung [Fri, 27 Jul 2007 20:43:49 +0000 (20:43 +0000)] 
[Thrift] fixing python server socket bind permissions

Fix made by Paul Saab from powerset (ps@powerset.com)

reviewed by mcslee
test plan: tested

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

17 years agoFix for IPv6 Python sockets binding localhost problem
Mark Slee [Fri, 27 Jul 2007 18:56:56 +0000 (18:56 +0000)] 
Fix for IPv6 Python sockets binding localhost problem

Reviewed By: mcslee

Test Plan: Python Thrift server

Notes: From ps@powerset.com

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

17 years ago-- remove default seekToEnd
Aditya Agarwal [Fri, 27 Jul 2007 07:04:49 +0000 (07:04 +0000)] 
-- remove default seekToEnd

fixed search so no need for this anymore

Reviewed By: jwang

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

17 years agoThrift: Catch what you throw.
David Reiss [Fri, 27 Jul 2007 00:40:19 +0000 (00:40 +0000)] 
Thrift: Catch what you throw.

Summary:
Catch an exception that was being thrown,
and print out the error message.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled Thrift.
Ran it on a broken .thrift that throws one of these exceptions.

Revert Plan: ok

Notes:

EImportant:

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

17 years agoThrift: Cleaned up whitespace.
David Reiss [Thu, 26 Jul 2007 21:10:32 +0000 (21:10 +0000)] 
Thrift: Cleaned up whitespace.

Summary:
Replaced a lot of tabs with spaces in the thrift codebase.
Removed a lot of trailing whitespace from thrift-generated c++.
Added a few things to cleanup.sh.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
Re-thrifted some test .thrifts.
Compiled the genrated c++.
Ran cleanup.sh.

Revert Plan: ok

Notes:

EImportant:

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

17 years ago[thrift] maps, lists, sets, and service inheritance for Erlang
Christopher Piro [Wed, 25 Jul 2007 22:41:00 +0000 (22:41 +0000)] 
[thrift] maps, lists, sets, and service inheritance for Erlang

Reviewed by: cpiro

Test Plan: tested wit tutorial/tutorial.thrift

Revert Plan: ok

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

17 years agoThrift: Haskell library and codegen
iproctor [Wed, 25 Jul 2007 19:06:13 +0000 (19:06 +0000)] 
Thrift: Haskell library and codegen

Summary: It's thrift for haskell. The codegen is complete. The library has binary protocol, io channel transport, and a threaded server.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes

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

17 years agoThrift: Ruby cogeden not creating exception fields properly.
iproctor [Wed, 25 Jul 2007 18:50:50 +0000 (18:50 +0000)] 
Thrift: Ruby cogeden not creating exception fields properly.

Summary: Generated ruby code did not give exception struct fields a class. This broke the result structs for all functions that threw exceptions.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes

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

17 years agoSummary: TSocket shouldn't let you set the timeout before it's got a valid handle
James Wang [Tue, 24 Jul 2007 23:59:51 +0000 (23:59 +0000)] 
Summary: TSocket shouldn't let you set the timeout before it's got a valid handle

Reviewed By: dcorson

Test Plan: tested in sandbox

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

17 years agoThrift: OCaml library binary protocol fix
iproctor [Tue, 24 Jul 2007 19:47:55 +0000 (19:47 +0000)] 
Thrift: OCaml library binary protocol fix

Summary: Binary protocol wasn't dealing with messages properly. Also
there was a math bug in readI32.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes

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

17 years ago[thrift] stupid case bug in Erlang codegen
Christopher Piro [Tue, 24 Jul 2007 06:20:47 +0000 (06:20 +0000)] 
[thrift] stupid case bug in Erlang codegen

Summary: stop generating files/modules in titlecase

Notes: somehow we access service_name_ before the constructor downcases it ... burnsauce

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

17 years ago[thrift] misc. Erlang codegen improvements, cleanups
Christopher Piro [Tue, 24 Jul 2007 04:30:15 +0000 (04:30 +0000)] 
[thrift] misc. Erlang codegen improvements, cleanups

Summary:
 * const/enum namespacing
 * better formatting, less debugging comments in both source and gen-erl/

Notes:
 * in preparation for iproctor's whiz-bang map/list/set support

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

17 years agoReadding seekToEnd() call to openLogFile() temporarily so that search doesn't break
James Wang [Mon, 23 Jul 2007 17:35:32 +0000 (17:35 +0000)] 
Readding seekToEnd() call to openLogFile() temporarily so that search doesn't break

Reviewed By: aditya

Test Plan: Thrift compiles, falcon works

Revert Plan: revertible

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

17 years agoSummary: Changing TFileTransport to not go to end of file by default
James Wang [Sun, 22 Jul 2007 05:48:12 +0000 (05:48 +0000)] 
Summary: Changing TFileTransport to not go to end of file by default

Reviewed By: boz

Test Plan: compiled and tested falcon's print utility

Revert Plan: revertible

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

17 years agoThrift: Debug Protocol
David Reiss [Sat, 21 Jul 2007 01:18:10 +0000 (01:18 +0000)] 
Thrift: Debug Protocol

Summary:
Added TDebugProtocol, a write-only Thrift protocol for C++
that produces human-readable representations of thrift structs.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Recompiled Thrift.
./test/TestDebugProto.* see compile instructions at the top.
Ran that, and it looked good.

Revert Plan:
grep TDebugProtocol <world>
grep ThriftDebugString <world>
Revert or comment out whatever you find so that they still compile.
Then svn revert.

Notes:

EImportant:

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

17 years agoThrift: add an indent to generated cpp files.
David Reiss [Sat, 21 Jul 2007 00:23:32 +0000 (00:23 +0000)] 
Thrift: add an indent to generated cpp files.

Summary:
Someone forgot an indent after a newline.  Added.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan:
Compiled the compiler, compiled a .thrift, and compared the output
with diff -u and diff -w -u.

Revert Plan: svn revert

Notes:

EImportant:

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

17 years ago[thrift] highly concurrent Erlang goodness
Christopher Piro [Wed, 18 Jul 2007 00:26:12 +0000 (00:26 +0000)] 
[thrift] highly concurrent Erlang goodness

Summary:
 * shim to use object-oriented code as gen_servers
 * high(er) performance Erlang-style server and transport
 * sane packaging based on otp-base, i.e. Makefiles and real structure

Test Plan: tutorial server offers the same (subset of) functionality as previous version

Revert Plan: ok

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

17 years agoThrift: OCaml library and generator
iproctor [Mon, 16 Jul 2007 21:59:24 +0000 (21:59 +0000)] 
Thrift: OCaml library and generator

Summary: Added (minimal) library and code generator for OCaml.
Reviewed by: mcslee
Test plan: Test client and server (included).
Revert plan: yes

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

17 years ago[scope lock wrapped for ReadWriteMutex]
yunfang [Sat, 14 Jul 2007 01:23:05 +0000 (01:23 +0000)] 
[scope lock wrapped for ReadWriteMutex]
Summary:
  scope lock wrapped around ReadWriteMutex. It's like Guard but you can specify to use it as a read or write lock.

Reviewed by: boz

Test Plan: used it in AdFinder

Revertible: yes

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

17 years agoAdd typecasting to REST parameters in generated Thrift PHP code
Mark Slee [Tue, 10 Jul 2007 16:48:37 +0000 (16:48 +0000)] 
Add typecasting to REST parameters in generated Thrift PHP code

Trac Bug: #4360

Reviewed By: ari

Test Plan: Honky tonk, view the new generated api_10/x packages

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

17 years agoFix SET serialization borked-ness in Thrift
Mark Slee [Tue, 10 Jul 2007 00:49:04 +0000 (00:49 +0000)] 
Fix SET serialization borked-ness in Thrift

Summary: Extra return floating in the code

Reviewed By: boz

Test Plan: Rebuild and deploy feed

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

17 years agoremoving test file
peterm [Tue, 10 Jul 2007 00:22:20 +0000 (00:22 +0000)] 
removing test file
peterm

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

17 years agopeterm - testing repo sync
peterm [Tue, 10 Jul 2007 00:08:20 +0000 (00:08 +0000)] 
peterm - testing repo sync

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

17 years agoFix addrinfo structure memory leak in TSocket
Mark Slee [Mon, 9 Jul 2007 19:50:30 +0000 (19:50 +0000)] 
Fix addrinfo structure memory leak in TSocket

Summary: Need to free the IPv6 memory structure

Reviewed By: mcslee

Notes: Submitted by paul@powerset.com

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

17 years agosys_errlist is deprecated.
Martin Kraemer [Mon, 9 Jul 2007 19:08:25 +0000 (19:08 +0000)] 
sys_errlist is deprecated.

Summary:
Avoiding usage of sys_errlist.  It is deprecated, prefer strerror or strerror_r instead.

Trac Bug: #

Blame Rev:

Reviewed By: mcslee, karl

Test Plan:

Revert Plan: revertible

Notes:

EImportant:

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

17 years agoTSocket IPv6 support for C++
Mark Slee [Fri, 6 Jul 2007 22:28:15 +0000 (22:28 +0000)] 
TSocket IPv6 support for C++

Summary: From Paul Saab at Powerset

Reviewed By: mcslee

Test Plan: test/cpp/TestClient

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

17 years agoTHRIFT ReadWriteMutex
boz [Fri, 6 Jul 2007 22:27:52 +0000 (22:27 +0000)] 
THRIFT ReadWriteMutex

Summary: Implemented a read/write lock class in thrift::concurrency

Reviewed By: marc

Test Plan: I compiled this, then compiled a version of fb303 that uses this
(future checkin pending further tests), then ran a binary using the new fb303
and it didn't crash as things were added to the map using the ReadWriteMutex

Revert Plan: yup

Notes: this should replace rw_lock.h for most clients

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

17 years agoPython IPv6 support for TSocket
Mark Slee [Fri, 6 Jul 2007 22:20:19 +0000 (22:20 +0000)] 
Python IPv6 support for TSocket

Summary: Contributed by Paul Saab of Powerset

Reviewed By: mcslee

Test Plan: Python test stuff

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

17 years agoFixed possible Thrift serialization bug
David Reiss [Fri, 6 Jul 2007 21:43:48 +0000 (21:43 +0000)] 
Fixed possible Thrift serialization bug

Summary: TBinaryProtocol.cpp was making assumptions about evaluation order
that are not guaranteed by the standard.  Now it does not (at least in these
functions).

Trac Bug: #

Blame Rev:

Reviewed By: mcslee

Test Plan: still compiles.

Revert Plan: svn revert

Notes:

EImportant:

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

17 years agoLots of Ruby code generation improvements
Mark Slee [Fri, 6 Jul 2007 02:45:25 +0000 (02:45 +0000)] 
Lots of Ruby code generation improvements

Summary: Submitted by Kevin Clark, Ruby guru from Powerset

Reviewed By: mcslee

Test Plan: He updated the tests in trunk/test/rb/

Notes: The code is now officially "ruby-ish" and idiomatic

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

17 years agoMake -rest an optional param to the Thrift PHP compiler
Mark Slee [Fri, 6 Jul 2007 00:30:21 +0000 (00:30 +0000)] 
Make -rest an optional param to the Thrift PHP compiler

Summary: You rarely need the generated REST stuff

Reviewed By: jwang

Test Plan: Gen falcon code without REST part

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

17 years ago[thrift] small typo in tserver.rb
Christopher Piro [Mon, 2 Jul 2007 06:35:10 +0000 (06:35 +0000)] 
[thrift] small typo in tserver.rb

Summary: s:procotol:protocol:g

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

17 years agoRuby test code fix, and BNF file for protocol
Mark Slee [Sat, 30 Jun 2007 01:18:12 +0000 (01:18 +0000)] 
Ruby test code fix, and BNF file for protocol

Reviewed By: aditya

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

17 years agoThrift: THttpClient for PHP in Thrift trunk
Mark Slee [Fri, 29 Jun 2007 23:15:00 +0000 (23:15 +0000)] 
Thrift: THttpClient for PHP in Thrift trunk

Reviewed By: peter

Test Plan: In SMC frontend

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

17 years ago[thrift] preliminary Erlang support (initial import)
Christopher Piro [Fri, 29 Jun 2007 07:17:33 +0000 (07:17 +0000)] 
[thrift] preliminary Erlang support (initial import)

Summary:
 * missing {list,map,set}s, inheritance is spotty
 * loose source code, plus everything is one process (application / gen_server behavior is forthcoming)
 * codegen is a mess, need t_fp_generator

Test Plan:
 * codegen invoked without -erl generates identical code for test/
 * calculatorHandler plus 'thrift -erl -r tutorial.thrift' more or less works

Revert Plan: ok

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

17 years agotypo in tutorial/rb/RubyServer.rb
Christopher Piro [Thu, 28 Jun 2007 01:09:22 +0000 (01:09 +0000)] 
typo in tutorial/rb/RubyServer.rb

Reviewed By: mcslee

Test Plan:

Revert Plan:

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

17 years agoRemoving protocol.txt
Mark Slee [Tue, 26 Jun 2007 20:19:56 +0000 (20:19 +0000)] 
Removing protocol.txt

Summary: This is not accurate anymore

Reviewed By: aditya

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

17 years ago-- make sure TFileTransport always starts at EOF
Aditya Agarwal [Tue, 26 Jun 2007 02:57:04 +0000 (02:57 +0000)] 
-- make sure TFileTransport always starts at EOF

Reviewed By: jwang

Test Plan: search

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

17 years ago[thrift] java httpclient needs to close its inputstream
eletuchy [Mon, 25 Jun 2007 18:29:28 +0000 (18:29 +0000)] 
[thrift] java httpclient needs to close its inputstream

Reviewed By: mcslee

Test Plan: run as part of aim importer

Revert Plan: sure

Notes:

EImportant:

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

17 years agoRuby TBinaryProtocol fix
Mark Slee [Sat, 23 Jun 2007 00:08:13 +0000 (00:08 +0000)] 
Ruby TBinaryProtocol fix

Summary: VERSION_1 | type, not &, wrong binary operator

Reviewed By: binary

Test Plan: TestClient.rb

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

17 years agoTeensy insignificant thrift bug
Mark Slee [Fri, 22 Jun 2007 19:43:12 +0000 (19:43 +0000)] 
Teensy insignificant thrift bug

Summary: Wasn't causing any issues because it's a noop with the binary protocol

Reviewed By: jwang

Test Plan: honky tonk, no diff in functionality

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

17 years agoIdiotic typos in Python code
Mark Slee [Fri, 22 Jun 2007 01:03:55 +0000 (01:03 +0000)] 
Idiotic typos in Python code

Summary: No clue how this slid in

Reviewed By: abosworth

Test Plan: I am stupid. TestClient.py

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

17 years agoThrift TBinaryProtocol change
Mark Slee [Wed, 20 Jun 2007 21:51:57 +0000 (21:51 +0000)] 
Thrift TBinaryProtocol change

Summary: New Thrift TBinaryProtocol with a version identifier

Reviewed By: aditya, eugene

Test Plan: Modify your services to have strictRead_ and strictWrite_ both set to FALSE. Then redeploy your services and test running clients against them. Once you have clients and servers running stably on this new code, you should redploy versions with strictWrite_ set to TRUE. Once that's all good, we can set strictRead_ to TRUE as well, and eventually deprecate the old protocol code entirely.

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

17 years ago[thrift] Add optional callback inside of serve()
dweatherford [Tue, 19 Jun 2007 23:10:19 +0000 (23:10 +0000)] 
[thrift] Add optional callback inside of serve()

Summary: If enabled, the callback function will be run after the listening socket is opened and the event loop initialized, just prior to calling event_loop()

This is handy if you want to defer some of your initialization until after the socket is open -- allowing clients to connect, but not processing requests until the initialization is complete. I use this in the Synapse tablet server to minimize the communications interruption that happens during a tablet split (replaying commit logs after opening the listening socket).

Review: mcslee
Test Plan: compiled it into Synapse's tablet server
Revert: ok

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

17 years agoWhitespace fixes on test code
Mark Slee [Fri, 15 Jun 2007 01:45:56 +0000 (01:45 +0000)] 
Whitespace fixes on test code

Reviewed By: thrift

Test Plan: Whitespace

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

17 years agoMissing variable in initializer list for TNonblockingServer constructor
Mark Slee [Fri, 15 Jun 2007 01:43:21 +0000 (01:43 +0000)] 
Missing variable in initializer list for TNonblockingServer constructor

Summary: Making tablemaster very unhappy

Reviewed By: dweatherford

Test Plan: tablemaster on synampse tier

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

17 years ago[thrift] small fixes to java generator
eletuchy [Wed, 13 Jun 2007 04:24:11 +0000 (04:24 +0000)] 
[thrift] small fixes to java generator

Summary: - size generated collections correctly
         - StringBuilder vs StringBuffer

Reviewed By: mcslee

Test Plan: built TestThrift.thrift; it compiled, yay

Revert Plan: sure

Notes:

EImportant:

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

17 years agoDarwin endianness junk
Mark Slee [Sat, 9 Jun 2007 01:23:04 +0000 (01:23 +0000)] 
Darwin endianness junk

Reviewed By: darwin

Test Plan: build on OSX

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

17 years agoAdd thread pool option to NonblockingServer
Mark Slee [Sat, 9 Jun 2007 01:21:16 +0000 (01:21 +0000)] 
Add thread pool option to NonblockingServer

Summary: If you want requests processed outside of the I/O thread

Reviewed By: jake luciani, aditya

Test Plan: nb-main.cpp, in the test folder

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

17 years agoTHRIFT: generic output handler
boz [Tue, 5 Jun 2007 22:41:18 +0000 (22:41 +0000)] 
THRIFT: generic output handler

Summary: I'm tired of getting output from thrift via perror AND exceptions, so
this class allows the client to set an alternate (or empty) handler for error
output

Reviewed By: mcslee

Test Plan: I ran on the worker with the default, got output via perror, then
overloaded with my own function and got output via syslog and then NULL

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

17 years agoModified PosixThreadFactory
Marc Slemko [Tue, 5 Jun 2007 22:20:14 +0000 (22:20 +0000)] 
Modified PosixThreadFactory
        Added explicit detached getter and setter
Modified PosixThreadFactory::~PThread:
        Check for join failing and don't transition to detached_ state if it does.  Potential thread-handle leak for
        threads created joinable who aren't referenced by any external thread.  Solution for now has to be
        "DONT DO THAT", the clever approach doesn't always work.

Added ThreadFactoryTests.floodNThreads:
        Loop M times for N threads where M x N is bigger than 32K to verify that detached threads can be created
        ad infinitum.

Reviewed By: mcslee

Revert Plan: revertible

Test Plan: concurrency_test thread-factory passes

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

17 years agoModified PosixThreadFactory::PThread:
Marc Slemko [Mon, 4 Jun 2007 21:01:19 +0000 (21:01 +0000)] 
Modified PosixThreadFactory::PThread:
        Pay attention to detached flags.  If thread is create non-detached and has not been joined when all references are given up,
        (ie boost::share_ptr calls ~PThread) do the join in the destructor to prevent thread ids from being leaked.

Modified ThreadFactoryTests.reapNThreads:
        Loop M times for M threads where M x N is bigger than 32K to verify that thread ids aren't leaked

Modified TimerManager.cpp:
        Removed debug messages.

Reviewed By: mcslee

Revert Plan: revertible

Test Plan: concurrency_test thread-factory passes

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

17 years agoForgot to add ProcessorFactory
Mark Slee [Fri, 1 Jun 2007 23:04:09 +0000 (23:04 +0000)] 
Forgot to add ProcessorFactory

Reviewed By: biren

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

17 years agoTHRIFT: ADITYASLOP
boz [Thu, 31 May 2007 23:38:37 +0000 (23:38 +0000)] 
THRIFT: ADITYASLOP

Summary: thrift didn't compile

Reviewed By: marc

Test Plan: thrift compiles

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

17 years agoMemory buffer for perl
Mark Slee [Thu, 31 May 2007 02:30:34 +0000 (02:30 +0000)] 
Memory buffer for perl

Reviewed By: Jake Luciani

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