Commit Graph

48 Commits

Author SHA1 Message Date
David Reiss
223d6bd1ac Make "make check" work properly for Python and Java.
Summary:
The Python and Java versions of "make check" only work if "make all" has
been run.  Our automake-fu isn't strong enough to make proper dependencies,
so this hack suggested by Nitay will force the libraries to be built
before make check is run.

Test Plan: make check


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665497 13f79535-47bb-0310-9956-ffa450edef68
2008-02-24 02:03:17 +00:00
David Reiss
f8dcf03416 Add automake support for building the Java library.
If java, javac, and ant are all available, the Java library will be built as part of the standard make target.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665494 13f79535-47bb-0310-9956-ffa450edef68
2008-02-23 22:07:39 +00:00
David Reiss
132cc46d07 Rename TJSONProtocol.java -> TSimpleJSONProtocol.java
Summary:
Chad Walters is developing a full-featured JSON-based protocol for Java,
so we're renaming the existing protocol to something more descriptive.
I also edited the file to rename the class and add to the header comment.
I have no idea if Subversion does explicit rename tracking, or if
git svn is smart enough to mark renames as such, but I would predict
"yes" to both.  Let's find out.

Reviewed By: mcslee, jssarma

Test Plan: Ran "ant" in lib/java

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665492 13f79535-47bb-0310-9956-ffa450edef68
2008-02-21 22:49:58 +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
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
Mark Slee
737ce021d1 Add some more TThreadPoolServer constructors
Summary: Change the default to Executors.newCachedThreadPool() which is a good default and basically what we should always want.

Reviewed By: dreiss

Test Plan: Run a Java server with default args


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665424 13f79535-47bb-0310-9956-ffa450edef68
2008-01-15 02:59:12 +00:00
Mark Slee
19c9777583 Chagnge TThreadPoolServer in Java to use SynchronousQueue by default
Summary: Read the documentation on ThreadPoolExecutor. It's very confusing. Basically, what we want is a queue that always defers to the threadpool and will always create a new thread to do work. We never want the queue to take priority over the thread pool by default.

Reviewed By: dreiss

Test Plan: Run a Java Thrift server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665419 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 19:57:47 +00:00
David Reiss
5ddd2f13fa Thrift: Fix a bug in the Java runtime.
Reviewed By: mcslee

Test Plan: Looked at the C++ version side-by-side.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665396 13f79535-47bb-0310-9956-ffa450edef68
2007-12-17 09:49:10 +00:00
David Reiss
4a15eb7f71 Thrift: Maximum read length for Java.
Summary:
A feature to improve handling of invalid wire data by the Java Thrift library.

Reviewed By: mcslee

Test Plan: I trust Dave Engberg.

Revert Plan: ok

Other Notes:
Submitted by Dave Engberg.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665393 13f79535-47bb-0310-9956-ffa450edef68
2007-12-14 22:14:47 +00:00
Mark Slee
f60467efc9 Custom HTTP headers patch from Dave Engberg
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665380 13f79535-47bb-0310-9956-ffa450edef68
2007-11-29 02:57:34 +00:00
Mark Slee
d602f822d5 Complete the proper handling of all special characters in JSON strings for TJSONProtocol
Reviewed By: dreiss

Test Plan: test/java/TestClient


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665373 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:45:13 +00:00
Mark Slee
fe6ed0dff4 Clean up the TSerializer
Summary: Nested Transport subclass wasn't necessary, add comments

Reviewed By: dreiss

Test Plan: Same as before, test/java/TestClient


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665369 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 21:54:38 +00:00
Mark Slee
844ac12489 TJSONProtocol writing support in Java
Summary: TJSONProtocol for Java with write support and a TSerializer utility for easier conversion of Thrift objects into byte[] or strings.

Reviewed By: dreiss

Test Plan: Included a basic piece of this in test/ client for Java.

Revert: OK

DiffCamp Revision: 3890


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665367 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 08:38:52 +00:00
Mark Slee
a1d4cab45f Make Java TBinaryProtocol default to strictWrite
Summary: About time we did this. Breaks the test suite's defaults


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665357 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 04:58:16 +00:00
Mark Slee
6eb5892662 Deal with UnsupportedEncodingException in TBinaryProtocol
Summary: In case you are running on a horrendous JVM that doesn't have UTF-8 support

Reviewed By: dreiss

Test Plan: Compile.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665326 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 00:48:47 +00:00
Mark Slee
0502e61fb9 Add programatic shutdown option to Java Thrift servers
Summary: Same paradigm as in C++ model. Allow ServerTransport to be interrupted to block an accept loop and cleanly stop serving client requests.

Reviewed By: dreiss

Test Plan: Invoke shutdown() method on a TServer


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665322 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 05:30:32 +00:00
Mark Slee
52182d674e Make Java TbinaryProtocol enfore UTF-8
Summary: Java Strings have to have an encoding, they can't just be binary. The constructor and getBytes() method enforce this, so we are standardizing on UTF-8 to avoid string-mangling.

Reviewed By: dreiss

Test Plan: Code all works the exact same in the normal case, and doesn't mangle characters beyond ASCII or ISO-LATIN-1


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665321 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 04:48:43 +00:00
Mark Slee
34b2926d5c Java Thrift objects implement common base interface
Reviewed By: dreiss

Test Plan: Generate java code and run against new library.

Revert: OK

DiffCamp Revision: 900


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665296 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 20:55:10 +00:00
Mark Slee
780e4ecac9 Fix missing break statements in Java ProtocolUtil
Summary: Oops. switch statement n00b error.

Reviewed By: jssarma


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665286 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 04:43:31 +00:00
eletuchy
b8f0d496c1 [thrift] checking in generated reflection code into java library
Summary: Generated this code using:
          /usr/local/share/thrift/if/reflection_limited.thrift

Reviewed By: dreiss

Test Plan: compiled chat_importer (a java FacebookService) against this.

Revert Plan: sure

Database Impact:

Memcache Impact:

Other Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665275 13f79535-47bb-0310-9956-ffa450edef68
2007-09-19 01:23:19 +00:00
eletuchy
66ccee2a74 [thrift] java httpclient needs to close its inputstream
Reviewed By: mcslee

Test Plan: run as part of aim importer

Revert Plan: sure

Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665142 13f79535-47bb-0310-9956-ffa450edef68
2007-06-25 18:29:28 +00:00
Mark Slee
808454ec63 Thrift TBinaryProtocol change
Summary: New Thrift TBinaryProtocol with a version identifier

Reviewed By: aditya, eugene

Test Plan: Modify your services to have strictRead_ and strictWrite_ both set to FALSE. Then redeploy your services and test running clients against them. Once you have clients and servers running stably on this new code, you should redploy versions with strictWrite_ set to TRUE. Once that's all good, we can set strictRead_ to TRUE as well, and eventually deprecate the old protocol code entirely.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665138 13f79535-47bb-0310-9956-ffa450edef68
2007-06-20 21:51:57 +00:00
Mark Slee
5e707a6cd9 Forgot to add ProcessorFactory
Reviewed By: biren


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665128 13f79535-47bb-0310-9956-ffa450edef68
2007-06-01 23:04:09 +00:00
Mark Slee
448849deed ProcessorFactory for Java
Reviewed By: simon forman


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665124 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 01:30:22 +00:00
Mark Slee
8d725a2738 Add explicit binary type to Thrift
Summary: Identical to string in all languages except Java. Java String is NOT binary-safe, so we need to use raw byte[] in that case. PHP/RUBY/Python strings are all binary safe, and C++ std::string works fine and manages memory for you so it's the safest route. Java just needs this tweak.

Reviewed By: aditya

Test Plan: Use "binary" as a type instead of String.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665099 13f79535-47bb-0310-9956-ffa450edef68
2007-04-13 01:57:12 +00:00
Mark Slee
54b7ab9b53 READMEs and DOCs and ant tasks, oh my
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665048 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 00:06:27 +00:00
Mark Slee
7eb0d63542 Apply Thrift license to Java sources
Reviewed By: bash


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665031 13f79535-47bb-0310-9956-ffa450edef68
2007-03-01 00:00:27 +00:00
Mark Slee
e5341192fd protocol exceptions in java
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665012 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 04:56:26 +00:00
Mark Slee
b46c0418c7 More java error codes in thrift
Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665011 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 04:54:38 +00:00
Mark Slee
3d42440e42 Thrift application exceptions in Java
Reviewed By: thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665008 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 04:17:34 +00:00
Aditya Agarwal
5a429586f8 -- Protocol and transport factories now wrap around a single protocol/transport
Summary:
- This is an analagous to the C++ change made in r31441

Reviewed By: slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664978 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 02:51:15 +00:00
Mark Slee
eb0d024ee1 Full automake/autoconf compliance for thrift
Summary: Including the compiler!!!

Reviewed By: automake


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664949 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 07:58:55 +00:00
Mark Slee
456b7a868c New protocol wrapping transport model for Thrift Java
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664846 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 20:53:37 +00:00
Mark Slee
b6f10d1fd1 Clean up Java Thrift transport code
Summary: More robust error checking


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664845 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 19:58:36 +00:00
Mark Slee
7d5da16362 Thrift Java HTTP client
line, and those below, will be ignored--

A    java/src/transport/THttpClient.java


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664820 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 01:38:25 +00:00
Mark Slee
845fe3da64 Add better socket linger, tcp_nodelay and timeout handling to thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664807 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 20:51:11 +00:00
Mark Slee
9ffe9d426c Set linger off and nodelay true on accepted ServerSockets
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664806 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 20:40:23 +00:00
Mark Slee
5bcde6eba9 Add socket and server socket timeout support to thrift java
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664804 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 17:50:32 +00:00
Mark Slee
c2e8ff5ae6 Fix potential multithreading protocol issue in Thrift Java
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664802 13f79535-47bb-0310-9956-ffa450edef68
2006-09-22 16:57:38 +00:00
Mark Slee
4e755cae58 Thrift: Rename run() to serve() in java interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664797 13f79535-47bb-0310-9956-ffa450edef68
2006-09-12 00:46:08 +00:00
Mark Slee
ade2c83d11 Thrift PHP TSocketPool client
Summary: Client that connects to one of an arbitrary pool of servers

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664795 13f79535-47bb-0310-9956-ffa450edef68
2006-09-08 03:41:50 +00:00
Mark Slee
d788b2e046 Thrift TTransportFactory model for servers
Summary: Servers need to create bufferedtransports etc. around the transports they get in a user-definable way. So use a factory pattern to allow the user to supply an object to the server that defines this behavior.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664792 13f79535-47bb-0310-9956-ffa450edef68
2006-09-07 01:26:35 +00:00
Mark Slee
ffcddd688a Thrift multithreaded Java server
Summary: Ported the Pillar multithreaded Java server to Thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664791 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 20:37:03 +00:00
Mark Slee
c98d050d65 Thrift: Added support for double type across all languages
Summary: Just for completeness cause I'm crazy. Let's never use these!

Notes: Also made thrift grammar support # style comments, so you can do this at the top of your files

#!/usr/local/bin/thrift --cpp

/**
 * This is a thrift def file youc an invoke directly and gen code!
 */

blah


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664789 13f79535-47bb-0310-9956-ffa450edef68
2006-09-06 02:42:25 +00:00
Mark Slee
78f58e2559 Thrift generation for Java
Summary: Java works, benchmark roundtrip at around 3ms, so right in between C++ and PHP


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664775 13f79535-47bb-0310-9956-ffa450edef68
2006-09-02 04:17:07 +00:00
Mark Slee
530fd662c0 Java Thrift libraries no longer use specially defined UInt32 etc. classes
Summary: There was really no need for these now that we are getting rid of unsigned, they should all just use the builtin int and long types





git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664741 13f79535-47bb-0310-9956-ffa450edef68
2006-08-09 00:05:18 +00:00
Mark Slee
f3c322b4a3 Thrift: getting rid of U32s for map/list/set/string lengths and field ids etc.
Summary: U32s are on the out. Make way for the I32.

Reviewed By: aditya





git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664718 13f79535-47bb-0310-9956-ffa450edef68
2006-06-26 23:52:22 +00:00
Mark Slee
83c52a8d7a Java libraries for Thrift
Summary: The basic Thrift stack implemented in Java, still in need of a lot of work but fully functional.

Reviewed By: aditya

Test Plan: Unit tests are the NEXT checkin, I swear

Notes: Perf on the Java stuff actually isn't that bad, and it's far from optimized at the moment. Barely any tweaking has been done. Testing shows that a Java server with the C++ client has RPC performance within 2x of the pure C++ implementations. This is pretty sweet, since this cost will be eclipsed by the cost of whatever processing is being done on an actual server doing real work.




git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664715 13f79535-47bb-0310-9956-ffa450edef68
2006-06-07 06:51:18 +00:00