Commit Graph

1543 Commits

Author SHA1 Message Date
Bryan Duxbury
afa80ea73d THRIFT-34 Java libraries should be namespaced under org.apache.thrift, not com.facebook.thrift
Library classes and tests have been moved to the proper package and directory structure, and references to com.facebook.thrift where replaced with org.apache.thrift throughout the code. The fb303 contrib project still contains com.facebook packages.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734855 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 23:47:51 +00:00
Kevin Clark
c85fd50e2b THRIFT-216. Add validate method to fixtures so tests pass
Author: Esteve Fernandez


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734565 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 23:55:10 +00:00
David Reiss
46bb4aeb5e THRIFT-242. python: Used named arguments in __init__ instead of a dict
This is a wire-compatible but non-source-compatible change.
When initializing structures, you must use

Foo(bar=1, baz="qux")
Foo(**{"bar": 1, "baz": "qux"})

instead of

Foo({"bar": 1, "baz": "qux"})


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734536 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 22:34:15 +00:00
David Reiss
7bcf866c16 THRIFT-249. java: Add @param lines to function docstrings
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732116 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 20:54:27 +00:00
David Reiss
c654416843 THRIFT-129. csharp: Make all Thrift structures extend TBase
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732081 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:33 +00:00
David Reiss
b0f31ef92f THRIFT-46. csharp: Throw the correct exception for an unknown method
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732080 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:29 +00:00
David Reiss
6319133cac THRIFT-25. csharp: Various compiler and library improvements
Compiler:
- Thrift structures are serializable.
- The member fields of thrift structures are now private and only accessible
  through Properties, which keep the appropriate __isset up to date.

Library
- Addition of TBufferedTransport, which can be used to wrap other Transports.
- Addition of TThreadedServer, which manually manages threads instead of
  relying on .NET ThreadPool.
- Servers use a log delegate that defaults to System.Console but allows
  servers to use log4net without introducing the dependency.

ThriftTest Visual Studio Project
- Test client and server that use ThriftTest.thrift. The project references
  thrift.exe and Thrift.dll from the subversion tree and automatically builds
  generated code. This makes it very easy to test changes in both the compiler
  and library.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732079 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:22 +00:00
Kevin Clark
d6b7182df5 THRIFT-246. rb: Generate #struct_fields rather than reflect.
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731806 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 01:34:28 +00:00
Kevin Clark
41baeaba96 THRIFT-157. rb: Quote strings and qualify class names properly
Author: Dave Engberg


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731763 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:10:17 +00:00
Kevin Clark
bcb4cf83e5 THRFIT-231. rb: Make Thrift::Structs hashable
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731760 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 23:00:22 +00:00
David Reiss
8eaebfedc1 THRIFT-235. java: Explicitly cast integer constants to double
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731723 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:03:01 +00:00
David Reiss
25be92bf0d THRIFT-222. java: Better exposure if __isset in beans style
- Generate an isSet method for each field to test its set-ness.
- Generate a generic isSet method that checks by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731722 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:58 +00:00
David Reiss
2db737df8f java: Add a helper function to implement nocamel style
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731721 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:55 +00:00
David Reiss
b936ffdbd1 THRIFT-191. java: Create a static field id -> name map for each struct
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731720 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:52 +00:00
David Reiss
5455f00348 THRIFT-138. java: Fix copy constructor for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731719 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:48 +00:00
David Reiss
888f88b05d THRIFT-241. python: Generate a better implementation of __repr__
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731685 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 20:14:52 +00:00
T Jake Luciani
41687fc6cf THRIFT-193: Patch for proper namespace support in perl compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728863 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:45:43 +00:00
T Jake Luciani
0d738890ba THRIFT-2: check for thrift::socket handle being null
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728860 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:12:50 +00:00
David Reiss
0a136c8ca8 THRIFT-208. Fix ax_java.m4 for Ubuntu 8.10
On Ubuntu 8.10, /bin/sh is a symlink to dash (a minimal
Bourne-compatible shell).  ./configure is smart enough
to detect when the shell it is run with is missing features.
In such cases, it switches to a more capable shell (like bash).
This causes it to enable certain shell constructs that are
not supported by dash.  However, the Autoconf macro file that
we use to detect Java support interacts poorly with Autoconf
because it uses divert(-1) for large comments.  This somehow
causes configure to set SHELL to /bin/sh.  As a result, the
libtool script generated during the build process is not
compatible with the shell that is used to run it (if a recent
version of libtool is in use).

This change replaces all of the "divert(-1)" comments
with more traditional "dnl" comments.  This allows Thrift
to build on Ubuntu 8.10.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728756 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22 19:54:12 +00:00
T Jake Luciani
a60df1fab4 THRIFT-190. Added dependency check to perl Makefile
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728678 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22 13:13:56 +00:00
David Reiss
681e04e47c THRIFT-220. Add some stuff to svn:ignore
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727131 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:31:26 +00:00
David Reiss
a8efac862a THRIFT-225. java/cpp: Handle non-i32 integer constants properly
Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:28:13 +00:00
Kevin Clark
083c07a265 rb: Thrift.check_type should check struct classes [THRIFT-185]
Author: Piotr Kozikowski


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@726156 13f79535-47bb-0310-9956-ffa450edef68
2008-12-13 02:39:20 +00:00
David Reiss
a230999667 THRIFT-121. Support arbitrary type annotations
Adds syntax for attaching arbitrary key/value pairs to types.
These annotations can be accessed by individual generators to alter
the code they produce.

This version supports annotations on container types and structures.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@724954 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 01:52:48 +00:00
David Reiss
322e595c2a THRIFT-203. cpp: Make library headers compile under g++ -pedantic
It turns out that trailing commas in enum definitions are
not actually valid C++.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@723562 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 02:54:09 +00:00
David Reiss
fbb14ef1b3 THRIFT-214. cpp: Qualify a cast to fix OSX compilation
id_t is defined in some OSX header, and the id_t in this function
resolved to that one instead of Thread::id_t.  This change fully
qualifies the type to make sure it resolves properly.

Also remove a comment about eliminating the C-style cast, since it
is actually quite appropriate in this case.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722337 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:32:25 +00:00
David Reiss
428d5695ab THRIFT-215. cpp: Disable an assertion that fails on various platforms
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722336 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:22:01 +00:00
David Reiss
0c87ad41ee THRIFT-217. Use "--gen py" instead of "-py" in build scripts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722333 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:11:13 +00:00
David Reiss
603d50437c THRIFT-138. java: Create deep-copy constructors for Thrift structs
- Create a copy constructor for every Thrift struct.  The constructor
  performs a deep copy on the argument, resulting in no shared state.
- Make thrift structions implement Cloneable and implement .clone()
  using the copy constructor.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:06:31 +00:00
David Reiss
04c315946c THRIFT-81. java: TNonblockingServer: Support a limit on read buffer size
This change makes it possible to set a maximum amount of memory that
TNonblockingServer will use for all read buffers (combined).
If it is exceeded, no new data will be read from clients until
memory is freed.  The current implementation does a busy wait in
the main thread when this happens.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719741 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 23:07:05 +00:00
David Reiss
fd71808e35 THRIFT-142. java: Better handling of required fields
- On reading, behave the same way as the C++ code:
  throw an exception if a required field is missing.
- In addition, throw an exception if a required field is missing
  when writing.  For the JavaBeans code, this means that __isset
  is false (because it is maintained automatically).  For non-beans
  code, this means that the field is null.  Non-nullable fields are
  not checked in non-beans code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719727 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:55:52 +00:00
David Reiss
e31b77e90e THRIFT-194. cpp: Properlyl namespace exception types in catch
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719721 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:36:41 +00:00
David Reiss
30a9360e3f THRIFT-172. java: Improve toString output for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719720 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:31:36 +00:00
David Reiss
7f5e184785 THRIFT-139. java: Fix indentation in beans mode
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719701 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 20:25:14 +00:00
David Reiss
c26da0a391 THRIFT-202: java: Fix "make check"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719407 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 22:22:23 +00:00
David Reiss
466b3fafcd Remove compiler/cpp/version.h in "make clean"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719380 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 21:24:32 +00:00
David Reiss
8c28df2569 Fix "make distclean" when Ruby is not in use
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719379 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 21:24:18 +00:00
Kevin Clark
1d5a1f6500 rb: Remove extra validate in read [THRIFT-207]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719126 13f79535-47bb-0310-9956-ffa450edef68
2008-11-19 23:24:12 +00:00
Kevin Clark
031baf7086 Merge branch 'THRIFT-143'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714070 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:11:39 +00:00
Kevin Clark
713623bee6 rb: Validate struct _after_ read. [THRIFT-206]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@714069 13f79535-47bb-0310-9956-ffa450edef68
2008-11-14 17:09:52 +00:00
Kevin Clark
159383f789 rb: raise if an object is serialized without required fields [THRIFT-143]
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712945 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 05:46:04 +00:00
David Reiss
74421273ad THRIFT-67. python: Add TNonblockingServer
This TNonblockingServer is very similar to the C++ implementation.
It assumes the framed transport, but it uses select instead of libevent.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712306 13f79535-47bb-0310-9956-ffa450edef68
2008-11-07 23:09:31 +00:00
Kevin Clark
762e9bd15f rb: Performance tweaks in Struct#initialize [THRIFT-188]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709313 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 00:39:20 +00:00
Kevin Clark
cfca336fad rb: Add docstrings to generated ruby code [THRIFT-147]
Author: Bryan Duxbury


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709309 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 00:32:25 +00:00
David Reiss
080991bf98 THRIFT-186. erl: Make the Makefile work on OpenSolaris
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709086 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 04:28:42 +00:00
David Reiss
d90cd1f539 THRIFT-168. cpp: Clear transport buffers before a flush
Previously, TBufferedTransport and TFramedTransport could
leave data in their buffers if a flush threw an exception.
This patch makes them reset their internal pointers before
flushing to the underlying transport.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709037 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 22:50:34 +00:00
David Reiss
f33e03c6fa THRIFT-179. java: Include per-field docstrings in generated code
This also involves refactoring a bit of the functionality into
t_oop_generator.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708737 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:49 +00:00
David Reiss
f011bd4312 Make t_field inherit from t_doc instead of reimplementing it
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708736 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 00:07:45 +00:00
Mark Slee
babaea2f0f THRIFT-183 let non-root issues run fb303 status commands
Reviewed By: mcslee



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@708364 13f79535-47bb-0310-9956-ffa450edef68
2008-10-27 22:45:26 +00:00
David Reiss
66f5e9ba0b Make a pointer const to fix a warning
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@707213 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 22:07:03 +00:00