Граф коммитов

184 Коммитов

Автор SHA1 Сообщение Дата
Erez Louidor dd7766e9a9 Integrated the new SplitQuery RPC into Vitess. 2016-03-28 16:52:34 -07:00
Anthony Yeh 0caebaff4c java: Add blocking (synchronous) client wrapper. 2016-03-16 17:53:44 -07:00
Anthony Yeh 7c737dd8a5 java: columnIndex starts at 1.
This better matches JDBC ResultSet.
2016-03-16 14:43:39 -07:00
Anthony Yeh 3f0abe8a46 Address Java readability comments. 2016-03-16 14:32:29 -07:00
Anthony Yeh f3937d4833 java: Update dependencies.
* Get rid of transitive dependency on commons-collections 3.2.1 by
  updating hadoop version.
* Move hadoop dependency from `client` project to `hadoop` project.
2016-03-14 22:34:55 -07:00
Anthony Yeh dc56878114 Merge pull request #1544 from enisoc/java-grpc-0.13
java: Update to grpc-java 0.13.1.
2016-03-02 21:27:48 -08:00
Anthony Yeh 5a23054002 java: Update to grpc-java 0.13.1. 2016-03-02 20:58:26 -08:00
Michael Berlin b7ee9ad06a Merge branch 'master' into java_fix_example 2016-03-02 20:46:46 -08:00
Michael Berlin f311d4f072 java/example: Exit with non-zero return value in case of an error. 2016-02-29 19:03:22 -08:00
Anthony Yeh 4e54ba821a Fix missing checkedGet() calls in Java example client. 2016-02-29 14:38:02 -08:00
Anthony Yeh dba5a6b3bb java: Fix time zone offset in DateTime.formatTime().
There was a bug that only showed up in time zones with positive offset
from GMT. I've added explicit tests for time zones with positive and
negative offsets.
2016-02-24 15:05:47 -08:00
Anthony Yeh 9cda983a52 java/client: Enforce limit on in-flight VTGateTx calls.
Because of the session cookie, only one asynchronous call can be
in-flight at a time. Violating that constraint is a bug in the client
app, so we throw an IllegalStateException to prevent race conditions.
2016-02-19 14:16:35 -08:00
Anthony Yeh 2c57e3ab5c java/client: Clarify SQLFuture vs CheckedFuture comment. 2016-02-19 14:16:35 -08:00
Anthony Yeh 6aa9e2b9a7 java/client: Convert client to asynchronous RPCs.
To get the old synchronous behavior, append `.checkedGet()` to a call
that returns SQLFuture. For example:

```
Cursor cursor = vtgateConn.execute(...).checkedGet();
```
2016-02-19 14:16:35 -08:00
Anthony Yeh b40a3b2ae0 java: delete gorpc-client 2016-02-19 14:16:35 -08:00
Anthony Yeh 5ef949a4b4 java/client: Convert to java.sql.Date et al. instead of Joda-Time.
These are the standard types used in JDBC and Connector/J.
2016-02-11 18:26:21 -08:00
Anthony Yeh f70d8927fd java: Add class for working with MySQL DATETIME values.
The valueOf() methods on java.sql.(Date|Time|Timestamp) don't support
MySQL-specific syntax, and will throw exceptions while parsing certain
values returned from MySQL. The toString() methods on those classes
also may produce results that a MySQL user would not want or expect.

This new class contains utility methods for working with MySQL DATE,
TIME, TIMESTAMP, and DATETIME formats, including MySQL-specific syntax.
Unlike the built-in valueOf() and toString() methods, these also support
time zones through the Calendar class, which is necessary when implementing
the JDBC PreparedStatement and ResultSet interfaces. When no Calendar is
specified, we use the default time zone like the built-in methods do.
2016-02-11 17:38:35 -08:00
Anthony Yeh 3b99243910 java/client: Return BIT fields as byte[] instead of String.
They are binary data, not Unicode strings.
2016-02-10 16:06:23 -08:00
Michael Berlin d81b8d1319 java: Document "asTransaction" parameter. 2016-02-08 13:49:20 -08:00
Michael Berlin 01254b9095 java: Remove "notInTransaction" parameter from transaction Execute* methods.
The underlying protobuf field is not used in open-source and therefore we don't want to expose it in our API.

Since the protobuf field will no longer be set, proto3 should always return "false" as zero value for it.

This commit also removes the "asTransaction" flag from the transaction object ExecuteBatch* methods because vtgate ignores this flag anyway when the request is within a transaction.
2016-02-08 13:47:58 -08:00
Alain Jobart 963e0f761c Fixing one more place. 2016-01-29 15:01:08 -08:00
Alain Jobart e2a14d9390 Renaming xid_{type,value} to {type,value} in the proto3
entity id. Should be safe.
2016-01-29 14:19:14 -08:00
Anthony Yeh cea5f486a7 java: Fix handling of SQL NULL in Row class.
Previously, getters that convert to primitive types
(like `long getLong()`) would throw NullPointerException if the value
was actually SQL NULL. To better match the expectations set by the JDBC
ResultSet interface, which we intend to mimic, we now will instead
return 0 when asked to convert SQL NULL to a primitive type.

To distinguish between 0 and SQL NULL, the JDBC ResultSet interface
provides two mechanisms, which we now support as well:

1. Call `wasNull()` after `getLong()` returns 0.
2. Call `getObject(..., Long.class)` instead of `getLong()`
   to get a (possibly-null) `Long` instead of a `long`.
2016-01-25 14:38:59 -08:00
Michael Berlin 3ddcdcfff2 java/grpc-client: Imports reordered by Eclipse save action in one file. 2016-01-09 00:11:07 +01:00
Michael Berlin ef075d1181 java/grpc-client: Remove null check in instanceof condition. 2016-01-09 00:10:22 +01:00
Michael Berlin a9e0b1eb85 java/example: Do not use a trailing semicolon in try-with-resource blocks. 2016-01-09 00:09:23 +01:00
Michael Berlin 1a714be962 java/example: Print exception ourselves instead of throwing it. 2016-01-08 13:52:11 +01:00
Michael Berlin c0ad4584bb java/example: Use try-resource blocks instead of explicit close() statements. 2016-01-08 13:49:54 +01:00
Michael Berlin 9ff2967d6e java/grpc-client: For exceptions related to connection failures, mention that the address might be wrong. 2016-01-08 13:41:28 +01:00
Michael Berlin 19a4f8032c java/example: Format code using open-source Google Java Style Guide Eclipse formatter. 2016-01-08 13:35:15 +01:00
Anthony Yeh 93dc38bd48 java: Make Row class more useful without Cursor.
Sometimes we want the type conversion offered by Row,
without the QueryResult processing of Cursor.
2015-12-28 16:15:47 -08:00
Michael Berlin 840b6fb1cc test: Fix running the Java example.
Specified dependeny for the Maven exec plugin (Travis tried to use an old location which no longer works).

Also added missing checking of the error code.
2015-12-18 19:59:03 -08:00
Michael Berlin c7f2b17d5c java: Add "example" project to demonstrate how to use the Java client. 2015-12-17 22:31:16 -08:00
Alain Jobart d3877e3dd7 Actually looking at what should be there, this should be it. 2015-11-16 12:55:53 -08:00
Alain Jobart 5038926712 Another pass at java test. 2015-11-16 11:52:03 -08:00
Alain Jobart f51fcdb6dc Fixing php and java tests. 2015-11-16 10:24:23 -08:00
Alain Jobart 9b59e8f782 Removing last use of key.KeyRange in vtgate gorpc code.
And then removing key.KeyRange.
2015-11-06 09:45:04 -08:00
Alain Jobart 51be389106 Submitting changes that were already made internally. 2015-11-05 07:33:02 -08:00
Alain Jobart b540fce0b2 Migrating from go's Session to proto3 Session. 2015-11-04 10:29:51 -08:00
Anthony Yeh 830a77922f java: Fix client for query.proto revamp. 2015-10-27 21:38:31 -07:00
Sugu Sougoumarane 7db52ac2d1 proto: Fix java Row to use new proto 2015-10-25 11:27:05 -07:00
Shengzhe 26d66e5bd8 Merge pull request #1221 from yaoshengzhe/use_InetSocketAddress_in_RpcClientFactory
Use InetSocketAddress as function param in RpcClientFactory
2015-10-15 20:13:22 -07:00
Ammar Aijazi c03a1a2eed Delete old Java client 2015-10-15 17:39:26 -07:00
Ammar Aijazi 21e934a6a2 Revert "Merge pull request #1215 from youtube/revert-1209-aaijazi_cleanup_error_flag"
This reverts commit 3ae5b3b510, reversing
changes made to 6860161fcf.
2015-10-15 17:37:56 -07:00
Shengzhe Yao 1fb9c7a003 Use InetSocketAddress as function param in RpcClientFactory
SocketAddress represents a socket address with no protocol attachment.
It is too general to be useful as often the subclass needs to know the
hostname and port info.
2015-10-15 17:24:31 -07:00
Ammar Aijazi 5ce1f5492e Revert "Remove --rpc-only-in-reply flag from VTGate" 2015-10-14 16:05:49 -07:00
Shengzhe Yao b5d4bf062b Add RowWritable class in hadoop package
cursor.Row implments Writable interface which only presents in hadoop.
To get rid of this dependency, a new RowWritable class is created.
2015-10-14 14:44:05 -07:00
Ammar Aijazi 79659856ef Java GoRPC SplitQuery correctly reads error response 2015-10-13 19:38:33 -07:00
Shengzhe Yao 7217dd2adc add hadoop support in java/client
1. Move maven-compiler-plugin from sub packages to java/pom.xml.
2. Move row related methods from Cursor class to a new Row class, this
   simplifies operations in Hadoop where it needs a wriable row object.
3. Refactor both SimpleCursor and StreamCursor to follow the Cursor change.
4. Add Hadoop package which depends on java/client and java/grpc.
2015-10-13 11:47:53 -07:00
Anthony Yeh 60db50c68e java: Fix doc comment. 2015-10-08 16:17:29 -07:00