Commit Graph

242 Commits

Author SHA1 Message Date
David Reiss
db0ea15310 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
2008-02-18 01:49:37 +00:00
David Reiss
c005b1b65e 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
2008-02-15 01:38:18 +00:00
Mark Slee
a8de4895f6 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
2008-02-09 00:02:26 +00:00
David Reiss
0c90f6f8af 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
2008-02-06 22:18:40 +00:00
David Reiss
f7baf549bc 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
2008-02-04 21:56:27 +00:00
David Reiss
20f009d625 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
2008-02-04 19:24:00 +00:00
David Reiss
f495f367c9 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
2008-02-02 00:54:55 +00:00
David Reiss
d46eb09bef 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
2008-02-02 00:54:48 +00:00
Mark Slee
2e8a8d4095 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
2008-01-16 00:38:20 +00:00
pfung
e8abada6ad [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
2008-01-05 23:23:53 +00:00
David Reiss
832b262aca 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
2007-12-28 18:25:33 +00:00
Aditya Agarwal
4b6ff2dabc -- Allow ThreadPoolManager tp return immediately from addTask
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
2007-12-25 22:58:50 +00:00
dweatherford
16cf270283 [thrift] Make TTransportException::getType const throw()
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
2007-12-21 07:07:31 +00:00
David Reiss
eaa61e4363 Thrift: A hack to prevent incorrect usage of Mutex Guards.
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
2007-12-20 21:42:05 +00:00
David Reiss
adad4ab203 Thrift: Fix dangling pointer errors and make messages a bit more uniform.
Reviewed By: mcslee

Test Plan: Honestly, just built the library.

Revert Plan: ok

Other Notes:
Thanks to Ben Maurer.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665392 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 20:56:04 +00:00
Mark Slee
77a31384b8 Use HAVE_SYS_TIME_H instead of HAVE_CLOCK_GETTIME
Summary: Still need the right include here

Reviewed By: mcslee

Test Plan: Paul Saab used this fix to build on Leopard


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665390 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 22:47:33 +00:00
pfung
78ee85c911 [Thrift] message debugging for std::exceptions
std::exceptions did not have debug messages printed

reviewed by dreiss
test plan: compiles


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665389 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 22:30:47 +00:00
James Wang
ae3804f8f7 Fix to TThriftTransport corruption detection
Summary: O_APPEND means that even if the file pointer is in the middle of the file, the next write will go to the end of the file. So when initializing the TThriftTransport to be written to, we need to truncate the file after the last good event.  I'm pretty sure this was what was causing queuemap log corruption when the multiplexer is restarted.

         The corruption doesn't necessarily go away at the next chunk boundary because of the offset being recalculated.  I think it's good to have the offset recalculated, but then we shouldn't use the old chunk boundary data there, but rather use the newly calculated offset to determine the padding (could be an entire chunk, but that's okay -- way better than corruption)

Reviewed By: mcslee

Test Plan: Wrote to a ThriftFile using local scribe instance. Printed it. Then cat'd garbage to it from the command line. Then wrote to it again. Then printed it again.  Seems to work fine, whereas with old scribe binary the later entries were corrupted.

Revert: OK

DiffCamp Revision: 4683


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665388 13f79535-47bb-0310-9956-ffa450edef68
2007-12-13 19:46:27 +00:00
Aditya Agarwal
c31769cceb -- better error checking for setRecvTimeout and setSendTimeout
Summary:
- could help prevent a 2.6.13 kernel bug

Reviewed By: mcslee, dreiss

Test Plan:
- Testing kernel crashes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665387 13f79535-47bb-0310-9956-ffa450edef68
2007-12-11 22:23:51 +00:00
Mark Slee
5d1784a7b4 Failing to init eventBase_ to NULL in one constructor
Reviewed By: dreiss

Test Plan: See if scribe works for powerset


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665386 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:20:54 +00:00
Mark Slee
c37b4c5193 Remove unnecessary mutex from C++ socket code
Summary: This is a threadsafe syscall, as it turns out.

Reviewed By: hzhao

Test Plan: Thrift Client C++ sockets don't lock


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665384 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 23:03:37 +00:00
dweatherford
2323cf6422 [thrift] Better default TApplicationException messages
Summary: "Default TApplicationException" is pretty meaningless; if we have this
  extra type information, we might as well present it.

Reviewed By: mcslee
Test Plan: caught a couple of INVALID_MESSAGE_TYPE tapplicationexceptions
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665383 13f79535-47bb-0310-9956-ffa450edef68
2007-12-05 03:40:19 +00:00
David Reiss
ef22dc652f Thrift: Make some server methods public.
Reviewed By: mcslee

Test Plan: Compiles.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665382 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 20:38:49 +00:00
Mark Slee
b16074d53b Add pkgconfig to Thrift C++ libraries
Reviewed By: mcslee

Other Notes: Submitted by Ben Maurer


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665377 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 05:54:33 +00:00
Mark Slee
b4d3e7b052 Create a TServerEventHandler interface in TServer
Summary: Such that users can supply an event handler to a server that will be used to signal various events that take place inside the server core.

Reviewed By: dreiss

Test Plan: Rebuilt all servers, work by default

Other Notes: Partially submitted and also reviewed by Dave Simpson at Powerset


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665371 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 01:51:43 +00:00
Mark Slee
b455292699 Add a few utility methods and helpers to Thrift C++ Sockets
Summary: Submitted by Dave Simpson @ Powerset.

Reviewed By: mcslee

Test Plan: test/cpp


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665370 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 00:12:11 +00:00
Mark Slee
256bdc4448 IPv6 tweaks for Thrift
Summary: Need to pass hints including AI_ADDRCONFIG to getaddrinfo to make sure no IPv6 addresses come back on non-IPv6 enabled systems

Reviewed By: mcslee

Other Notes: Submitted by Paul Saab


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665368 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:42:19 +00:00
Mark Slee
79b1694043 Refactor TNonblockingServer to use event_base construct
Summary: This allows the event loop to be shared across different components of a program of for a separate thread in a TNonblockingServer to safely use its own libevent code without conflicts.

Reviewed By: mcslee

Test Plan: Updated test/ committed here

Other Notes: submitted by Ben Maurer, patched in by mcslee with slight modifications


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665364 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 19:05:29 +00:00
Mark Slee
fb4b514028 IPv6 support for the TNonBlockingServer
Summary: Need to use IPv6 compliant constructs here. Submitted by Paul Saab.

Reviewed By: dreiss

Test Plan: Rebuild Thrift TNonblockingServer with this patch and verify behaves just the same


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665353 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 01:27:08 +00:00
Aditya Agarwal
3788038a35 -- ensure that flush is called in close() of any wrapper transport
Summary:
- unflushed data should be flushed when transport is closed
- this diff calls flush for TBufferedTransport and TFramedTransport

Reviewed By: dreiss


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665323 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 06:33:06 +00:00
dweatherford
14b0ed6fad [thrift] TSocket host and port getters
Summary: "Porting" this feature from PHP; I find it useful in the Synapse client.
Reviewed By: mcslee
Test Plan: It compiles, ship it!
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665304 13f79535-47bb-0310-9956-ffa450edef68
2007-10-19 01:03:32 +00:00
David Reiss
2b9ddab14c Thrift: Kill a warning.
Summary:
These should always have been const.

Reviewed By: mcslee

Test Plan:
Re-ran the dense protocol test.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665303 13f79535-47bb-0310-9956-ffa450edef68
2007-10-17 03:39:55 +00:00
dweatherford
d1372829e6 [thrift] TSocketPool::addServer, c++ version
Summary: Same thing as the previous PHP change. Also includes a new constructor for easy building of a TSocketPool with a single host (for later filling in via addServer) without extra std::vector boxing/unboxing.

Reviewed By: mcslee

Test Plan: Synapse c++ client at r62896 uses this.

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 909


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665297 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 22:57:23 +00:00
yunfang
1454296026 [Explicitly declare shared_ptr]
Summary:
just some simple styling changes. moving  using boost::shared_ptr to .cpp
  and using the full path name in .h
Reviewed by: boz, dreiss
Test Plan: compiled and tested on the adfinder


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665289 13f79535-47bb-0310-9956-ffa450edef68
2007-10-03 22:59:41 +00:00
boz
19cee90ca4 THRIFT: Make the mutex assignable
Summary: we need to use a shared_ptr instead of an old fashioned one if we're
going to stick with this PIMPL model

Reviewed By: dreiss, marc

Test Plan: test program didn't fail or leak memory, foreman (fb303 client)
worked without problem

Revert Plan: just make sure you find some other solution to this problem


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665280 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 23:08:11 +00:00
boz
623096780f THRIFT: Mutex and ReadWriteMutex leaked memory, now they don't
Summary: also added myself to CONTRIBUTORS.

Reviewed By: marc

Test Plan: the following program no longer leaks memory (valgrind):

int main(int argc, char **argv){
  Mutex mu;
  mu.lock();
  mu.unlock();
}

Revert Plan: ok

Notes: this is kind of important


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665279 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 23:24:16 +00:00
David Reiss
b72d19f653 Thrift: Prep for release.
Summary:
- make dist is no fun.  Had to add a lot of stuff to Makefile.am to
  make sure stuff got included in the tarball.
- Added a permanent NEWS file with the release notes for this release.
- clean.sh removes ylwrap also.
- Gave it a real version for make dist.
- Added ACLOCAL_AMFLAGS to lib/cpp/Makefile.am to make it easier to
  work on configure.ac.
- Made concurrency_test a non-installed binary because
  no one wants to install it.
- Dropped some symlinks that were annoying make dist.
- Updated README.

Test Plan:
./bootstrap.sh && ./configure && make dist
Compared contents of tarball to source tree.
Did this from a fresh git tree so no gross untracked files would be around.
On devrs: ./bootstrap.sh && ./configure && make install DESTDIR=/tmp/relinst1
Made sure concurrency_test was built but not installed.
Checked zlib URL with firefox.

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665274 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 19:46:00 +00:00
David Reiss
faebedd356 Thrift: Re-committing zlib.
Summary:
Same as the last (reverted) zlib patch,
but this time with way more awesome support for building
with no zlib headers installed.

Reviewed By: mcslee

Test Plan:
- Did lots of really pathological stuff in my VMware.
- On devrs004:
  ./bootstrap.sh && ./configure && make && make install DESTDIR=/tmp/tzinst && echo "Yay"

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665269 13f79535-47bb-0310-9956-ffa450edef68
2007-09-17 23:20:38 +00:00
David Reiss
79ae0f8d48 Thrift: Compile without libevent.
Summary:
- Totally re-did the libevent check.
- Thrift now compiles and instals cleanly without libevent.
- (libevent is still needed to build libthriftnb.)

Reviewed By: mcslee

Test Plan:
- Ran configure and make in various configurations in my VMware.
- Clean build and install of Thrift on devrs004 (into /tmp).

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665267 13f79535-47bb-0310-9956-ffa450edef68
2007-09-17 21:15:47 +00:00
Martin Kraemer
fd7c26fec0 Thrift - typo in comment
Summary:
Not really worth notice.  Just fixing some stray uppercase chars in a comment block.

Trac Bug: #

Blame Rev:

Reviewed By:

Test Plan:

Revert Plan:

Database Impact:

Memcache Impact:

Other Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665265 13f79535-47bb-0310-9956-ffa450edef68
2007-09-17 06:58:47 +00:00
David Reiss
5aea7c8d00 Thrift: Reverting TZlibTransport
Summary:
Stupid Red Hat.
The dev boxes don't have the development packages for zlib.

Blame Rev: 59856

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665263 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 01:54:56 +00:00
David Reiss
b8c6334d99 Thrift: Zlib transport.
Summary:
Add a new transport to the C++ library: TZLibTransport.
This wraps another transport (just like TBufferedTransport),
compresses the data written to it, and uncompresses the data it reads.

Reviewed By: mcslee

Test Plan:
For ax_lib_zlib.m4
 - Ran ./bootstrap.sh.
 - Looked at configure.
 - Ran ./configure.
 - Looked at config.status
 - Ran ./configure --with-zlib=/usr.
 - Looked at config.status
 - Changed configure.ac to AC_LIB_ZLIB(1.2.4)
 - Ran ./configure.
 - Watched it fail.

For TZlibTransport
 - test/ZlibTest.cpp
 - Code coverage (hotness) report sent with review.
 - 100% line coverage for all the good stuff.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665262 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 01:44:47 +00:00
David Reiss
ce161a96cd Thrift: Clean up and test TDenseProtocol
Summary:
- TDenseProtocol now includes a part of the struct fingerprint in
  the serialized message, to protect from unserialzing trash.
- A lot of cleanups and commenting for TDenseProtocol.
- A lot of test cases for same.

Reviewed By: mcslee

Test Plan: test/DenseProtoTest.cpp

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665257 13f79535-47bb-0310-9956-ffa450edef68
2007-09-11 22:09:42 +00:00
David Reiss
e67c0e63b3 Thrift: TDenseProtocol using variable-length integers.
Reviewed By: mcslee

Test Plan:
test/DenseProtoTest.cpp

Still have to test:
- Bounds checking.
- borrow/consume on TBuffered and TFramed.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665252 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 01:34:12 +00:00
David Reiss
d8429fcc10 Thrift: New methods for C++ transports.
Summary:
To support the upcoming variable-length encoding of integers in
TDenseProtocol, augment Thrift transports with two new methods:
borrow and consume.  Borrow copies some data out of the transport
without consuming it, and consume... consumes it.

Reviewed By: mcslee

Test Plan:
Thrift compiles.
Should check in variable-length integer code for TDenseProtocol
right after this (git ruulz).

Revert Plan: revert stuff that uses these methods also.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665251 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 01:26:30 +00:00
Aditya Agarwal
4529c4b394 -- adding hostinfo and time to GlobalOutput
Summary:
- makes thrift errors a lot more useful

Reviewed By: jwang, mcslee

Test Plan: tested with search


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665249 13f79535-47bb-0310-9956-ffa450edef68
2007-09-05 01:01:15 +00:00
David Reiss
4e7530d4e5 Thrift: TDenseProtocol.
Summary:
- Made some stuff in TBinaryProtocol protected instead of private.
- Added a preliminary version of TDenseProtocol.  This is still
  super highly experimental and gross, and I wrote a super scary
  comment to explain that to anyone foolish enough to try to use
  this in its current state.

Reviewed By: mcslee

Test Plan: test/DenseProtoTest.cpp

Revert Plan: ok

Memcache Impact:
Save memory if/when people use it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665247 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 21:49:53 +00:00
David Reiss
47557bc8ad Thrift: Slight tweaks to local reflection.
Summary:
Local reflection typespecs for structs now have a dummy T_STOP field at the end
so we don't have to check the size on every iteration.
They also contain information about which fields are optional.
Also put a static pointer to the reflection in each structure.

Reviewed By: mcslee

Test Plan: test/DenseLinkingTest.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665246 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 21:31:04 +00:00
James Wang
d3f1a2d2ba Summary: Checking in fix to TFileTransport to remove redundant behavior of readEvent -- just return NULL or the next event
Also, checking in changes to the php generation code I made awhile ago, but forgot to check in

Reviewed By: aditya, mcslee

Test Plan: Compiled thrift and falcon, and confirmed that falcon's print binary still worked

Revert Plan: revertible


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665245 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 23:45:53 +00:00
Aditya Agarwal
000b111922 -- cleaning up some Makefile issues
Reviewed By: jwang

Test Plan: compiled


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665243 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 08:03:05 +00:00