Commit Graph

92 Commits

Author SHA1 Message Date
David Reiss
c51986f438 THRIFT-136. s/async/oneway/ in comments
This is an internal-only change.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757990 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:25 +00:00
Bryan Duxbury
32e04b423d THRIFT-262. java: Generate Javadocs for library classes
This patch adds a 'javadoc' Ant target, and installs the documentation to ${docdir}/thrift/java (/usr/local/share/doc/thrift/java with the default invocation of configure). It also fixes a few Javadoc warnings in the source code.

It also modifies the 'dist' target to include the Java sources in the jar file, so that Eclipse may show the javadocs for Thrift classes automatically (this increases the size of libthrift.jar from 90 Kb to 155 Kb).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756603 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 16:43:06 +00:00
Bryan Duxbury
13083d6d52 THRIFT-294. Remove @author tags
They're gone. Don't add any new ones!



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756307 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 02:19:46 +00:00
Bryan Duxbury
d815c218c8 THRIFT-332. rb: Compact Protocol in Ruby
This patch includes both a pure Ruby and C-extension port of the Compact Protocol described in THRIFT-110. It also fixes a bug in struct.c that was interfering with native protocol method calls, and adds some utility classes to the Java library for serializing/deserializing to a file for the purpose of testing protocols cross-language.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756133 13f79535-47bb-0310-9956-ffa450edef68
2009-03-19 18:57:43 +00:00
David Reiss
48141bf5a6 THRIFT-373. Update lists of files to include in release tarballs
This is mostly EXTRA_DIST, but also includes some headers.
I had to drill down into test because "make dist" builds some
of the test code.  .gitignore is not included in the tarballs.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755791 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 23:59:56 +00:00
Bryan Duxbury
e8ee12242d THRIFT-367. java: Some dead code in TNonblockingSocket.java
All the blocks of commented code are removed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@755463 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 02:47:02 +00:00
Bryan Duxbury
0096b20883 THRIFT-366. java: Lots of little warnings in java library
This cleans up imports, adds generic arguments where necessary, and puts OverloadNonblockingServer into the right package. 



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@753072 13f79535-47bb-0310-9956-ffa450edef68
2009-03-13 00:28:06 +00:00
Bryan Duxbury
d11f2411e2 THRIFT-116. java: Isset fields for non-primitive types unnecessary
This patch gets rid of the __isset fields for non-primitives and updates ToStringTest and EqualityTest appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@746000 13f79535-47bb-0310-9956-ffa450edef68
2009-02-19 21:21:44 +00:00
Bryan Duxbury
c707855048 THRIFT-318. java: Performance of HashSet for enumeration VALID_VALUES seems poor
Instead of a HashSet, enums will now use the special IntRangeSet implementation. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743037 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 18:10:57 +00:00
Bryan Duxbury
538e344122 THRIFT-110. java: A more compact format
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
2009-02-10 04:49:39 +00:00
Bryan Duxbury
bb7826da70 THRIFT-10. java: Descriptors used during serialization should be immutable objects
-Descriptor classes all have final members, making them immutable.
-Generated structs now have static constant versions of their TStruct and TField descriptors, and will be used during writing.
-Protocols that can benefit use static constants for various common returned descriptors.
-A duplicate FieldMetaData.java that should have been removed previously was also removed.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741984 13f79535-47bb-0310-9956-ffa450edef68
2009-02-08 00:12:38 +00:00
Bryan Duxbury
d83e250838 THRIFT-321. java: THRIFT-303 broke EqualityTest
Regenerated test code.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741952 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 20:06:09 +00:00
David Reiss
0b7d6fa5ee THRIFT-314. Purge reflection.limited
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
2009-02-07 02:36:35 +00:00
Bryan Duxbury
d20a1d3619 THRIFT-303. java: Changes to __isset interface
This patch makes __isset always private and adds a method per field to set the __isset state when not using the bean-style generator.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741805 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 01:08:58 +00:00
Bryan Duxbury
d73774f53e java: Added SerializationBenchmark.java, helper class for performing tests on protocols.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740952 13f79535-47bb-0310-9956-ffa450edef68
2009-02-05 00:24:42 +00:00
Bryan Duxbury
f5383b663e THRIFT-297. java: getFieldValue and setFieldValue should be abstract TBase methods
This patch makes getFieldValue, setFieldValue, and isSet TBase interface methods, and adds all the previously beans-only getters and setters to all Java generated classes. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@740169 13f79535-47bb-0310-9956-ffa450edef68
2009-02-03 00:49:25 +00:00
Bryan Duxbury
50119f15aa THRIFT-289. test: "make check" no longer runs the Java tests
Thanks to David for the changes that straighten the makefiles out.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739024 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 21:31:25 +00:00
Bryan Duxbury
986d705578 THRIFT-253. java: Enhance FieldMetaData
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
2009-01-29 01:51:08 +00:00
Bryan Duxbury
249d7cb199 THRIFT-166. java: Java tests should be in lib/java/test/
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
2009-01-29 01:21:20 +00:00
Bryan Duxbury
4371038cd1 THRIFT-240. java: TBase should implement Cloneable
The TBase interface now extends Cloneable.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@736691 13f79535-47bb-0310-9956-ffa450edef68
2009-01-22 16:27:16 +00:00
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
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
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
9837aaf097 THRIFT-145. java: Make TNonblockingServer more robust against errors
TNonblockingServer was throwing a null pointer exception in certain cases.
We're not really sure what the root cause is, but this change prevents
the exception and also improves logging of certain undesirable conditions.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@702661 13f79535-47bb-0310-9956-ffa450edef68
2008-10-07 23:03:47 +00:00
David Reiss
f67ad9e68a THRIFT-130. java: Eliminate frame{Read,Write} from TFramedTransport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@692185 13f79535-47bb-0310-9956-ffa450edef68
2008-09-04 18:23:29 +00:00
David Reiss
4ad40d7c23 java: Specify in build.xml that we are using Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@682453 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 18:38:36 +00:00
David Reiss
6144e428d5 THRIFT-64. java: Allow TServerSocket to bind to a specific IP address
Add a new constructor to TServerSocket that accepts an InetSocketAddress
and binds to that address.  Define the old constructor (which just takes
a port) in terms of the new one.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679505 13f79535-47bb-0310-9956-ffa450edef68
2008-07-24 19:20:32 +00:00
David Reiss
db65e3dd68 java: Close broken connections [THRIFT-73]
Fixes a bug where TNonblockingServer (and by extension THsHaServer) could
permanently lose track of client connections if the message on-wire was
malformed. If the client sends a bad message now, the server will close the
transport at its earliest convenience.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@676456 13f79535-47bb-0310-9956-ffa450edef68
2008-07-13 23:15:55 +00:00
David Reiss
f0c21a72cd [THRIFT-70] Allow the Java install prefix to be configured.
Systems like Debian expect the thrift jar to be in /usr/share/java, not
the default /usr/local/lib This patch allows configure to be passed a
JAVA_PREFIX= flag.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675821 13f79535-47bb-0310-9956-ffa450edef68
2008-07-11 01:26:16 +00:00
David Reiss
03b574fead (THRIFT-5) A TNonblockingServers (single-threaded and thread-pool) for Java
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
2008-07-02 23:55:04 +00:00
David Reiss
fc0646481f (THRIFT-12) Make the Java library use java.util.logging instead of stdout.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672868 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 19:13:23 +00:00
David Reiss
0a2e7a245d Java/TThreadPoolServer: Shut down more gracefully. (THRIFT-11)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666502 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:20:54 +00:00
David Reiss
f9b5b12f4d Tweak Java Makefile.ams to fix "make distclean".
The Java Makefile.ams assume the existence of ANT, but "make distclean"
runs in the Java directories even if ENABLE_JAVA is off.  This change
makes the clean-local target handle the absence of ANT, fixing
"make distclean".


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665683 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 07:17:35 +00:00
David Reiss
c8abb0733f Add build.xml, src, and LICENSE to EXTRA_DIST in lib/java/Makefile.am.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665664 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:08:01 +00:00
David Reiss
04c6267aba Squelch most Java 1.6 warnings.
I actualy wasn't able to test this with Java 1.5.
Hopefully it doesn't break anything.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665636 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:28 +00:00
David Reiss
c631e98cad Moved the java libraries from src to src/com/facebook/thrift.
Apparently this is what all the Java kids are doing these days.
Ran ant in lib/java and it built fine.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665635 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 20:16:10 +00:00
David Reiss
d92ca7dcea Prevent Java's TProtocolUtil.skip from overflowing the stack.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665577 13f79535-47bb-0310-9956-ffa450edef68
2008-03-18 19:32:00 +00:00
David Reiss
ea5e75af3b Add Java JSON protocol implementation.
Implement full-featured JSON protocol, low-level base-64 encode/decode
methods, and related tests.

Conflicts (resolved by dreiss):

	test/java/build.xml


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665562 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:12:20 +00:00
David Reiss
a7f879b81f Add Java memory buffer transport implementation.
Wraps a TByteArrayOutputStream.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665561 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:12:17 +00:00
David Reiss
80f6398b63 Add NOT_IMPLEMENTED exception code.
Preparation for Java JSON protocol implementation.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665560 13f79535-47bb-0310-9956-ffa450edef68
2008-03-07 20:12:13 +00:00
David Reiss
d2a3e566b7 Add a TDeserializer for Java.
The class is the reverse of TSerializer.
It allows you to deserialize a Thrift struct from a byte array (or String).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665540 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:16 +00:00
David Reiss
c0fef71697 Fix a comment in the Java TSerializer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665539 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 06:29:12 +00:00
David Reiss
3de1c4e4d3 Use "all-local" instead of all in Makefile.am.
Summary:
Redefining an Automake rule totally blows away anything Automake puts in place.
By using all-local instead of all, we can just add to the generated rule.

Reviewed By: marc

Test Plan: make


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665499 13f79535-47bb-0310-9956-ffa450edef68
2008-02-24 17:45:03 +00:00
David Reiss
2ca456a8ae Make "make clean" rules a bit more standard.
Summary:
make-generic is some sort of internal undocumented thing.
make-local is what is supposed to be used for this stuff.
Also use $(RM) instead of "rm -f".

Reviewed By: marc

Test Plan: make clean


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665498 13f79535-47bb-0310-9956-ffa450edef68
2008-02-24 16:42:18 +00:00
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