This patch includes the Java implementation of the new Compact Protocol outlined in the issue and a matching test. It also creates Fixtures.java, a helper class that contains some useful test structure instances.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@742847 13f79535-47bb-0310-9956-ffa450edef68
The old version of type_name did not fully qualify parent service names
when they were defined in the same IDL file, but it is necessary because
they end up in different Python files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741833 13f79535-47bb-0310-9956-ffa450edef68
This was a feature designed to allow a Thrift server to report
information about its interface. However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good. Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
This involved adding a few methods to provide lower-level access to the
internal read buffer. This will allow us to use TBinaryProtocolAccelerated
with TFramedTransport.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739632 13f79535-47bb-0310-9956-ffa450edef68
- The async test was making the server sleep for 2 seconds. Cut it to 0.5.
- The test driver was waiting 5 seconds for shutdown. Cut it to 1.
- Add a 0.25 second sleep to make sure the server comes up before the client.
This is all a bit hacky, but it is better than the status quo.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739628 13f79535-47bb-0310-9956-ffa450edef68
The code generator new creates a static map of field id to metadata for each field, including information like the field TType, class of embedded structs, required/optional/default, etc. Additionally, on loading, generated classes statically register their class and metadata map with the global FieldMetaData map, so you can get the metadata for any TBase-implementing class easily.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738708 13f79535-47bb-0310-9956-ffa450edef68
THRIFT-221. java: Make java build classpath more dynamic and configurable
This issue moves all the tests from test/java to lib/java/test/src and combines the build files. In addition, rather than continue on with the same busted approach to finding dependent jars for the tests, THRIFT-221 has been implemented, allowing the user to specify a .thrift-build.properties file in their home directory that contains additional classpath entries.
As a result of this patch, "make check" does not currently work as it is expected to. This will be resolved in a follow-up commit.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738695 13f79535-47bb-0310-9956-ffa450edef68
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
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
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
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
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
- 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
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
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
TNonblockingServer and TFramedTransport used to have the option to only
frame messages on one side of the communication. This capability was
removed from TFramedTransport because it was poorly implemented and not
useful. This change removes it from TNonblockingServer as well, and
removes references to it in some of the C++ test code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673791 13f79535-47bb-0310-9956-ffa450edef68
This patch adds two Thrift servers for Java that both use non-blocking I/O
to avoid locking up worker threads for idle connections. The two classes are
- TNonblockingServer, which supports single-threaded serving
- THsHaServer, which performs I/O in one thread and method invocations in
a configurable thread pool.
To support these servers, TNonblockingServerSocket and TNonblockingSocket
have been added.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673550 13f79535-47bb-0310-9956-ffa450edef68
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.
I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work. However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
I changed the behavior of TFramedTransport when flush is called without
writing any data to the transport. This broke the unit test, which was
relying on a weird corner of TFramedTransport's behavior in order to do
some stricter checking. I altered the unit test to never flush without
writing and added a new test to verfy the "empty flush" behavior.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672881 13f79535-47bb-0310-9956-ffa450edef68