Commit Graph

68 Commits

Author SHA1 Message Date
Bryan Duxbury
d483712972 THRIFT-876. java: Add SASL support
This patch adds support for a SASL-secured transport to the Java library. In its current form, it only works for the blocking-IO servers.

Patch: Aaron T Meyers

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@993563 13f79535-47bb-0310-9956-ffa450edef68
2010-09-08 00:06:35 +00:00
Todd Lipcon
90ec5bfcd0 THRIFT-873. java: Java tests fail due to Too many open files
- Drops TestTAsyncClientManager to use only 200 clients instead of 500
- Changes each unit test to run in its own JVM instead of sharing them.
- Allows the port used for binding the test servers to be configured from the command line


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990032 13f79535-47bb-0310-9956-ffa450edef68
2010-08-27 06:16:37 +00:00
Bryan Duxbury
66467a7779 THRIFT-693. java: Thrift compiler generated java code that throws compiler warnings about deprecated methods.
This patch removes the deprecated methods from TBase and makes some generator changes to accommodate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987805 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 17:48:18 +00:00
Bryan Duxbury
3adf8aad36 THRIFT-845. java: async client does not respect timeout
This patch adds timeout handling to async method calls through TAsyncClientManager.

Patch: Ning Liang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987323 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 21:41:58 +00:00
Bryan Duxbury
0bb034008c THRIFT-831. java: FramedTransport implementation that reuses its buffers
This patch adds a TFastFramedTransport that is compatible with TFramedTransport, but makes use of a pair of internal, automatically-expanding buffers to avoid unnecessary reallocations. This makes interactions with the transport up to 2.5x faster.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985049 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 00:13:16 +00:00
Bryan Duxbury
f5abd26858 THRIFT-830. java: Switch binary field implementation from byte[] to ByteBuffer
This patch switches the implementation of binary fields to ByteBuffer in the Java generated code, yielding up to 2.5x speed boost.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982839 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 00:18:25 +00:00
Bryan Duxbury
067a7beb73 THRIFT-836. java: Race condition causes CancelledKeyException in TAsyncClientManager
This patch removes an erroneous key cancellation and adds exception handling for a bunch of different exceptions.
Patch: Ning Liang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982789 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 21:13:06 +00:00
Bryan Duxbury
dc4a871e12 add license headers to a smattering of files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@979366 13f79535-47bb-0310-9956-ffa450edef68
2010-07-26 17:18:30 +00:00
Bryan Duxbury
99f2ab7790 THRIFT-818. java: Async client doesn't send method args
This patch amends the tests and fixes the bug.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@963901 13f79535-47bb-0310-9956-ffa450edef68
2010-07-13 23:11:04 +00:00
Bryan Duxbury
162b3ac646 THRFIT-804. java: CompareTo is broken for unions set to map, set, or list
This patch fixes TUnion's compareTo, and factors out the standard part of the comparison to TBaseHelper.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957350 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23 21:17:48 +00:00
Bryan Duxbury
b7887b860b THRIFT-789. Files missing proper Apache license header
Added the Apache license header to a bunch of files that were missing it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@953167 13f79535-47bb-0310-9956-ffa450edef68
2010-06-09 21:30:54 +00:00
Bryan Duxbury
d58ccec660 THRIFT-768. java: Async client for Java
This patch adds an implementation of a fully-asynchronous client that makes use of NIO. Stubs for the async method calls are generated along with the existing synchronous ones.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@948492 13f79535-47bb-0310-9956-ffa450edef68
2010-05-26 16:34:48 +00:00
Bryan Duxbury
fb90e77e45 THRIFT-774. java: TDeserializer should provide a partialDeserialize method for primitive types
This patch adds partialDeserialize* methods for each of the supported Thrift primitives.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@943679 13f79535-47bb-0310-9956-ffa450edef68
2010-05-12 20:54:07 +00:00
Bryan Duxbury
06491d7bb5 THRIFT-765. java: Revert the changes applied by THRIFT-765, as they appear to be unstable
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940013 13f79535-47bb-0310-9956-ffa450edef68
2010-05-01 13:45:38 +00:00
Bryan Duxbury
12abe94977 THRIFT-765. java: Improved string encoding and decoding performance
This patch fixes a regression caused by the previous 'fast' implementation, in particular, dealing with unicode characters that need to be encoded as surrogate pairs. The performance stays about the same.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@939822 13f79535-47bb-0310-9956-ffa450edef68
2010-04-30 21:35:38 +00:00
Bryan Duxbury
abfc54fa06 java: add another testcase to TestUtf8Helper
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@939142 13f79535-47bb-0310-9956-ffa450edef68
2010-04-29 00:33:34 +00:00
Bryan Duxbury
719ab84318 THRIFT-765. java: Improved string encoding and decoding performance
This change makes Java's string/utf8 encoding and decoding about 2x faster.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@937812 13f79535-47bb-0310-9956-ffa450edef68
2010-04-25 15:20:02 +00:00
Bryan Duxbury
15e2930ccf THRIFT-761. java: Include the symbolic name of a typedef field in the field metadata
This patch adds a new isTypedef() method to FieldValueMetaData and converts MetaDataTest to a testcase in TestStruct.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@936588 13f79535-47bb-0310-9956-ffa450edef68
2010-04-22 01:05:02 +00:00
Bryan Duxbury
3292b3fed9 java: convert UnionTest to TestTUnion using JUnit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@934300 13f79535-47bb-0310-9956-ffa450edef68
2010-04-15 07:01:51 +00:00
Bryan Duxbury
88569a25d1 THRIFT-752. java: Use a faster Stack implementation in TCompactProtocol
This patch adds ShortStack, an internal implementation of Stack that works directly on primitive short objects, and makes TCompactProtocol use this. A brief performance test shows that this makes serialization about 8% faster and deserialization about 15% faster, though the actual gain you see will be dependent on the nature of your structs - the more levels, the more gain.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930593 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 22:52:03 +00:00
Bryan Duxbury
75526c999e java: Enhance TMemoryInputTransport to allow operation on specific range of a buffer rather than the whole thing. This will allow us to avoid making array copies in some instances.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930574 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 20:25:04 +00:00
Bryan Duxbury
c81a10a432 java: add a basic test for TMemoryInputTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930568 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 19:45:20 +00:00
Bryan Duxbury
c5de56cdfd java: reorganize ProtocolTestBase slightly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@930530 13f79535-47bb-0310-9956-ffa450edef68
2010-04-03 15:18:47 +00:00
Bryan Duxbury
5557beffae THRIFT-723: java: Thrift buffers with set and map types in Java should implement Comparable
This makes structs that contain sets and maps in their hierarchy Comparable.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928944 13f79535-47bb-0310-9956-ffa450edef68
2010-03-29 23:57:09 +00:00
Bryan Duxbury
e5e5c7b9d2 java: Move contents of CompareTest into TestStruct; delete old version
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928159 13f79535-47bb-0310-9956-ffa450edef68
2010-03-27 06:24:12 +00:00
Bryan Duxbury
981869c6ac java: Move contents of DeepCopyTest to TestStruct; delete old version
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928157 13f79535-47bb-0310-9956-ffa450edef68
2010-03-27 06:13:09 +00:00
Bryan Duxbury
c23e09e7b0 java: Move contents of IdentityTest into TestStruct
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928153 13f79535-47bb-0310-9956-ffa450edef68
2010-03-27 05:56:26 +00:00
Bryan Duxbury
d10f2bb480 java: get rid of old OverloadNonblockingServer.java (since it's not actually a test), move Fixtures up to o.a.thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928103 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 23:45:41 +00:00
Bryan Duxbury
dffa072afc java: convert PartialDeserializeTest to testcase of TestTDeserializer (new junit test); add apache header to a few of the new test files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928101 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 23:38:23 +00:00
Bryan Duxbury
dd6dc838d9 java: convert Framed Transport test to JUnit, remove old version of test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@928100 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 23:30:35 +00:00
Bryan Duxbury
bf0595fcb8 java: Convert TJSONProtocol test to JUnit, making a few minor changes to ProtocolTestBase in the process.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@927967 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 16:59:46 +00:00
Bryan Duxbury
98c45872f9 java: Convert Binary and Compact protocol tests to JUnit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@927699 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 05:58:34 +00:00
Bryan Duxbury
951e7e2480 java: Add JUnit to ivy config. Convert Nonblocking server tests to use JUnit. Framework laid to convert the remainder of the tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@927693 13f79535-47bb-0310-9956-ffa450edef68
2010-03-26 05:05:59 +00:00
Bryan Duxbury
27c9785758 THRIFT-739. java: TCompactProtocol isn't suitable for reuse in partialDeserialize
This patch changes TProtocol to support a reset() method that should clear any internal state. Stateless protocols can ignore it; stateful ones should implement it. TDeserializer has been updated to take advantage of this method.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@926460 13f79535-47bb-0310-9956-ffa450edef68
2010-03-23 03:50:16 +00:00
Bryan Duxbury
a268019e85 THRIFT-710. java: TBinaryProtocol should access buffers directly when possible
This patch makes TBinaryProtocol use direct buffer access in the relevant methods. Performance testing indicates as much as 2x speed boost, though your mileage may vary.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@918147 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 18:49:02 +00:00
Bryan Duxbury
0f52f07201 THRIFT-711. java: TFramedTransport should support direct buffer access
This patch adds direct buffer read access to TFramedTransport as well as a simple test for reading, direct buffer reading, and writing.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@918142 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 18:39:57 +00:00
Bryan Duxbury
dee6d4260c THRIFT-713. java: Java compareTo method throws NPE when any field isn't set.
This patch fixes a somewhat egregious bug in the generated compareTo for non-union structs and avoids possible NPEs.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@915499 13f79535-47bb-0310-9956-ffa450edef68
2010-02-23 19:06:25 +00:00
Bryan Duxbury
becaf53621 THRIFT-685. java: Direct buffer access to improve deserialization performance
This initial patch adds direct buffer access support to TDeserializer and TCompactProtocol, with the framework in place to be extended to other areas.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911510 13f79535-47bb-0310-9956-ffa450edef68
2010-02-18 18:27:51 +00:00
Bryan Duxbury
cd43a06405 THRIFT-703. Attempting to hash an unset union struct results in NPE
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911162 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 20:01:29 +00:00
Bryan Duxbury
f94f008d80 THRIFT-702. TUnion's toString method throws NPE if the union is unset
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@909645 13f79535-47bb-0310-9956-ffa450edef68
2010-02-12 22:49:40 +00:00
Bryan Duxbury
c2ec7cae04 THRIFT-670. java: Unions don't skip unrecognizable fields correctly
This patch adds a test and a fix for the bug.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@894924 13f79535-47bb-0310-9956-ffa450edef68
2009-12-31 18:59:15 +00:00
Bryan Duxbury
2d80470bcb THRIFT-632. java: Constants of enum types don't behave well
This patch causes constants of all types to be resolved differently by the compiler, and makes it so that constants of enum types contain a reference to the enum type so that code generators can produce the correct names.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@892358 13f79535-47bb-0310-9956-ffa450edef68
2009-12-18 19:41:11 +00:00
David Reiss
2727fab22f THRIFT-645. java: Create ant rules for running the test client and server
I didn't make these depend on compile-test since ant doesn't seem to
detect that the class files are up to date, so it takes a really long
time to recompile everything.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@888931 13f79535-47bb-0310-9956-ffa450edef68
2009-12-09 19:30:01 +00:00
Todd Lipcon
53ae9f39d5 THRIFT-622. Add appropriate licensing information to get Thrift ready for a release.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@887812 13f79535-47bb-0310-9956-ffa450edef68
2009-12-07 00:42:38 +00:00
Bryan Duxbury
9af23d9327 THRIFT-551. java: Enumeration doesn't generate real enum in Java
This patch makes the compiler generate actual Enum classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@882211 13f79535-47bb-0310-9956-ffa450edef68
2009-11-19 17:26:38 +00:00
Bryan Duxbury
aa9fb5dc9d THRIFT-623. java: Use a Java enum to represent field ids in generated structs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@835538 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 20:52:25 +00:00
Bryan Duxbury
e2e4ea1dcf THRIFT-624. java: compareTo is broken for Unions with binary fields
This patch adds a special case for byte[] values in TUnion. It also fixes a related bug in TBaseHelper for comparing two byte arrays.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@835065 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 21:01:35 +00:00
Bryan Duxbury
72fd472476 THRIFT-589. java: Add Field Name to Field ID Mapping
Java Thrift structs now have a static mapping of field name to field ID.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@825371 13f79535-47bb-0310-9956-ffa450edef68
2009-10-15 01:24:26 +00:00
Bryan Duxbury
51f288062d THRIFT-446. java: PartialDeserialization in Java
This patch adds a partialDeserialize method to TDeserializer that allows you to request a specific subfield of the serialized data.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@820786 13f79535-47bb-0310-9956-ffa450edef68
2009-10-01 20:53:45 +00:00
Bryan Duxbury
315a5dbe29 THRIFT-588. java: Generated .equals method throws NPE for thrift object
If other is null, then they're not equal.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@818998 13f79535-47bb-0310-9956-ffa450edef68
2009-09-25 20:28:35 +00:00