Skip to content

Commit 9b4d03c

Browse files
committed
fix async ops
1 parent b01b35e commit 9b4d03c

File tree

4 files changed

+79
-66
lines changed

4 files changed

+79
-66
lines changed

pom.xml

Lines changed: 74 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,77 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
3-
4-
<groupId>org.tarantool</groupId>
5-
<artifactId>connector</artifactId>
6-
<version>1.7.6-SNAPSHOT</version>
7-
<packaging>jar</packaging>
8-
<properties>
9-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10-
</properties>
11-
<name>Tarantool Connector for Java</name>
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<groupId>org.tarantool</groupId>
5+
<artifactId>connector-java8</artifactId>
6+
<version>1.7.6</version>
7+
<packaging>bundle</packaging>
8+
9+
<properties>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
</properties>
12+
13+
<name>Tarantool Connector for Java</name>
14+
<url>https://github.com/tarantool/tarantool-java</url>
15+
<description>Tarantool client for java</description>
16+
17+
<licenses>
18+
<license>
19+
<name>The BSD licence</name>
20+
<url>http://opensource.org/licenses/BSD-3-Clause</url>
21+
<distribution>repo</distribution>
22+
</license>
23+
</licenses>
24+
25+
<scm>
1226
<url>https://github.com/tarantool/tarantool-java</url>
13-
<description>Tarantool client for java</description>
14-
<licenses>
15-
<license>
16-
<name>The BSD licence</name>
17-
<url>http://opensource.org/licenses/BSD-3-Clause</url>
18-
<distribution>repo</distribution>
19-
</license>
20-
</licenses>
21-
22-
<scm>
23-
<url>https://github.com/tarantool/tarantool-java</url>
24-
<connection>scm:git:git://github.com/tarantool/tarantool-java.git</connection>
25-
<developerConnection>scm:git:[email protected]:tarantool/tarantool-java.git</developerConnection>
26-
</scm>
27-
<developers>
28-
<developer>
29-
<name>Dmitry Grytsovets</name>
30-
<email>[email protected]</email>
31-
<organization>Tarantool</organization>
32-
<organizationUrl>http://tarantool.org/</organizationUrl>
33-
</developer>
34-
</developers>
35-
<build>
36-
<plugins>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-compiler-plugin</artifactId>
40-
<version>3.7.0</version>
41-
<configuration>
42-
<source>1.8</source>
43-
<target>1.8</target>
44-
</configuration>
45-
</plugin>
46-
</plugins>
47-
</build>
48-
<dependencies>
49-
<dependency>
50-
<groupId>junit</groupId>
51-
<artifactId>junit</artifactId>
52-
<version>4.12</version>
53-
<scope>test</scope>
54-
</dependency>
55-
</dependencies>
56-
57-
<parent>
58-
<groupId>org.sonatype.oss</groupId>
59-
<artifactId>oss-parent</artifactId>
60-
<version>7</version>
61-
</parent>
27+
<connection>scm:git:git://github.com/tarantool/tarantool-java.git</connection>
28+
<developerConnection>scm:git:[email protected]:tarantool/tarantool-java.git</developerConnection>
29+
</scm>
30+
<developers>
31+
<developer>
32+
<name>Dmitry Grytsovets</name>
33+
<email>[email protected]</email>
34+
<organization>Tarantool</organization>
35+
<organizationUrl>http://tarantool.org/</organizationUrl>
36+
</developer>
37+
</developers>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-compiler-plugin</artifactId>
44+
<version>3.7.0</version>
45+
<configuration>
46+
<source>1.8</source>
47+
<target>1.8</target>
48+
</configuration>
49+
</plugin>
50+
51+
<plugin>
52+
<groupId>org.apache.felix</groupId>
53+
<artifactId>maven-bundle-plugin</artifactId>
54+
<version>3.5.0</version>
55+
<extensions>true</extensions>
56+
<executions>
57+
<execution>
58+
<id>bundle-manifest</id>
59+
<phase>process-classes</phase>
60+
<goals>
61+
<goal>manifest</goal>
62+
</goals>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
</plugins>
67+
</build>
68+
69+
<dependencies>
70+
<dependency>
71+
<groupId>junit</groupId>
72+
<artifactId>junit</artifactId>
73+
<version>4.12</version>
74+
<scope>test</scope>
75+
</dependency>
76+
</dependencies>
6277
</project>

src/it/java/org/tarantool/TestTarantoolClient.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
import java.sql.SQLException;
88
import java.util.Arrays;
99
import java.util.List;
10-
import java.util.concurrent.ExecutionException;
11-
import java.util.concurrent.ExecutorService;
12-
import java.util.concurrent.Executors;
13-
import java.util.concurrent.Semaphore;
14-
import java.util.concurrent.TimeUnit;
10+
import java.util.concurrent.*;
1511

1612

1713
public class TestTarantoolClient {
@@ -81,7 +77,7 @@ protected void reconnect(int retry, Throwable lastError) {
8177
}
8278

8379
@Override
84-
protected void complete(long code, FutureImpl<List<?>> q) {
80+
protected void complete(long code, CompletableFuture<List<?>> q) {
8581
super.complete(code, q);
8682
if (code != 0) {
8783
System.out.println(code);

src/main/java/org/tarantool/TarantoolClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public interface TarantoolClient {
99
TarantoolClientOps<Integer, List<?>, Object, List<?>> syncOps();
1010

11-
TarantoolClientOps<Integer, List<?>, Object, Future<List<?>>> asyncOps();
11+
TarantoolClientOps<Integer, List<?>, Object, ? extends Future<List<?>>> asyncOps();
1212

1313
TarantoolClientOps<Integer, List<?>, Object, CompletionStage<List<?>>> composableAsyncOps();
1414

src/main/java/org/tarantool/TarantoolClientImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ public TarantoolClientImpl(SocketChannelProvider socketProvider, TarantoolClient
8686
this.connector.setDaemon(true);
8787
this.connector.setName("Tarantool connector");
8888
this.syncOps = new SyncOps();
89+
this.composableAsyncOps = new ComposableAsyncOps();
8990
this.fireAndForgetOps = new FireAndForgetOps();
9091
if (config.useNewCall) {
9192
setCallCode(Code.CALL);
9293
this.syncOps.setCallCode(Code.CALL);
9394
this.fireAndForgetOps.setCallCode(Code.CALL);
95+
this.composableAsyncOps.setCallCode(Code.CALL);
9496
}
9597
connector.start();
9698
try {

0 commit comments

Comments
 (0)