Commit Graph

92 Commits

Author SHA1 Message Date
Bryan Duxbury
22903cb542 THRIFT-1015. java: TUnion does not handle ByteBuffer in toString
This patch adds a test case and fixes the toString method of TBaseHelper for ByteBuffers.

Patch: Takashi Yonebayashi

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1041590 13f79535-47bb-0310-9956-ffa450edef68
2010-12-02 21:29:20 +00:00
Bryan Duxbury
708971351f THRIFT-1009. java: TUnion does not correctly deep copy a ByteBuffer
This patch adds a case to deepCopyObject for ByteBuffer, along with a test case that verifies the change in functionality.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1040358 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30 00:33:48 +00:00
Bryan Duxbury
a5eb848930 THRIFT-1008. java: byte[] accessors throw NPE on unset field
Further extra null check in accessors that use TBaseHelper.rightSize().

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038850 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24 22:30:38 +00:00
Bryan Duxbury
fea49cb840 THRIFT-1008. java: byte[] accessors throw NPE on unset field
This patch adds a null check to TBaseHelper.rightSize().

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1038833 13f79535-47bb-0310-9956-ffa450edef68
2010-11-24 21:30:00 +00:00
Bryan Duxbury
a6ce16470d THRIFT-949. java: Modify the TEnum interface so it defines a method similar to findByValue
This patch adds a new helper class that makes it easier to get instances of generic TEnum descendents by value.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1028051 13f79535-47bb-0310-9956-ffa450edef68
2010-10-27 17:54:10 +00:00
Roger Meier
2067c1f01b THRIFT-960 switch back to TThreadPoolServer with AbstractServerArgs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1026714 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 23:50:48 +00:00
Roger Meier
5ad70a1a55 THRIFT-960 update to use AbstractServerArgs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1026712 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 23:35:46 +00:00
Roger Meier
62b7cfb7b9 THRIFT-960 Java: add TestServer, TestNonblockingServer and TestClient again
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1026704 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 22:25:04 +00:00
Bryan Duxbury
e703ed2ce6 THRIFT-745. java: Make it easier to instantiate servers
This patch replaces the multitude of constructors with builder-esque Args objects for each server and single constructor.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1026482 13f79535-47bb-0310-9956-ffa450edef68
2010-10-22 20:23:57 +00:00
Bryan Duxbury
206c0dc1af THRIFT-947. java: Provide a helper method to determine the TProtocol used to serialize some data.
Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1024455 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 23:00:27 +00:00
Bryan Duxbury
1b13083def THRIFT-106. java: TSSLServerSocket
This patch adds support for SSL-encrypted client and server sockets.

Patch: Nirmal Ranganathan

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1024328 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 17:20:57 +00:00
Bryan Duxbury
8684df9a79 clear a bunch of java warnings, unused code and imports, etc
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1021531 13f79535-47bb-0310-9956-ffa450edef68
2010-10-11 22:01:27 +00:00
Bryan Duxbury
f969bcb7d8 THRIFT-862. java: Async client issues / improvements
This patch improves quite a large number of things about the async client code.

Patch: Ning Liang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005221 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 20:04:40 +00:00
Bryan Duxbury
b3d0aa0c82 THRIFT-946. java: Augment FieldValueMetaData so it differentiates 'string' and 'binary' fields.
This patch adds a new method to the FieldMetaData class that indicates binary or not.

Patch: Mathias Herberts

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 20:00:03 +00:00
Bryan Duxbury
1df96ce22f THRIFT-945. java: TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.
This patch adds a test for the problem and fixes the issue by setting the current method after a call has been started.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004865 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:28:10 +00:00
Bryan Duxbury
5bb525ccf9 THRIFT-939. java: optional binary fields throw NPE on default byte[] getters
This patch deals with null ByteBuffers correctly.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1003212 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30 19:36:05 +00:00
Todd Lipcon
b1a283f11e THRIFT-912. java: Fix some bugs in SASL implementation, update protocol spec slightly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001973 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 00:11:01 +00:00
Todd Lipcon
84a7c2a901 THRIFT-931. java: Add log4j.properties missing from previous commit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1001971 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 00:02:53 +00:00
Bryan Duxbury
d920765c66 THRIFT-882. java: deep copy of binary fields does not copy ByteBuffer characteristics (arrayOffset, position)
This patch ensures that binary fields are copied correctly.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998275 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 19:27:36 +00:00
Bryan Duxbury
a7420b6593 THRIFT-894. java: Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version
This patch causes the underlying ByteBuffer that backs a binary field to be hidden behind a default accessor that provides a byte[] interface. This should allow users who skipped 0.4 to update their generated code without breaking any of their other code. A new accessor has been added that allows a way down to the underlying ByteBuffer for those experts who want to take advantage.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996579 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 15:42:36 +00:00
Bryan Duxbury
a4c6d64e80 java: tiny improvement to async client manager test, for real this time
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996329 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:31:50 +00:00
Bryan Duxbury
a97414674c java: tiny improvement to async client manager test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996328 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:30:06 +00:00
Bryan Duxbury
13ad873d18 THRIFT-896. java: TNonblockingSocket.isOpen() returns true even after close()
This patch makes TNonblockingSocket.isOpen() have more expected behavior.

Patch: Eric Jensen

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995939 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 19:08:00 +00:00
Bryan Duxbury
855294b213 THRIFT-888. java: async client should also have nonblocking connect
This patch adds optional nonblocking connect behavior.

Patch: Eric Jensen

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995262 13f79535-47bb-0310-9956-ffa450edef68
2010-09-08 21:47:45 +00:00
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