Skip to content

Commit

Permalink
Add Lettuce 5.2 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
malafeev committed Oct 2, 2019
1 parent a8d51d7 commit 657d7a1
Show file tree
Hide file tree
Showing 41 changed files with 18,066 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -40,7 +40,7 @@ pom.xml
```xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-redis-lettuce</artifactId>
<artifactId>opentracing-redis-lettuce-5.2</artifactId>
<version>VERSION</version>
</dependency>
```
Expand Down
Expand Up @@ -14,15 +14,17 @@
the License.
-->
<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">
<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">
<parent>
<artifactId>opentracing-redis-parent</artifactId>
<groupId>io.opentracing.contrib</groupId>
<version>0.1.13-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>opentracing-redis-lettuce5.0</artifactId>
<artifactId>opentracing-redis-lettuce-5.0</artifactId>
<name>OpenTracing Instrumentation for Lettuce 5.0 Redis Client</name>
<description>OpenTracing Instrumentation for Lettuce 5.0 Redis Client</description>

Expand Down
Expand Up @@ -14,17 +14,19 @@
the License.
-->
<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">
<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">
<parent>
<artifactId>opentracing-redis-parent</artifactId>
<groupId>io.opentracing.contrib</groupId>
<version>0.1.13-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>opentracing-redis-lettuce</artifactId>
<name>OpenTracing Instrumentation for Lettuce Redis Client</name>
<description>OpenTracing Instrumentation for Lettuce Redis Client</description>
<artifactId>opentracing-redis-lettuce-5.1</artifactId>
<name>OpenTracing Instrumentation for Lettuce 5.1 Redis Client</name>
<description>OpenTracing Instrumentation for Lettuce 5.1 Redis Client</description>

<dependencies>

Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.RedisFuture;
import java.util.concurrent.CompletableFuture;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import static io.opentracing.contrib.redis.common.TracingHelper.nullable;
import static io.opentracing.contrib.redis.common.TracingHelper.onError;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import static io.opentracing.contrib.redis.common.TracingHelper.nullable;
import static io.opentracing.contrib.redis.common.TracingHelper.onError;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import static io.opentracing.contrib.redis.common.TracingHelper.nullable;
import static io.opentracing.contrib.redis.common.TracingHelper.onError;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;


import static io.opentracing.contrib.redis.common.TracingHelper.nullable;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.RedisFuture;
import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
import io.lettuce.core.pubsub.api.sync.RedisPubSubCommands;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import static io.opentracing.contrib.redis.common.TracingHelper.nullable;

Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.ClientOptions;
import io.lettuce.core.ReadFrom;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.ClientOptions;
import io.lettuce.core.api.StatefulRedisConnection;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import io.lettuce.core.pubsub.RedisPubSubListener;
import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
Expand Down
Expand Up @@ -11,7 +11,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce;
package io.opentracing.contrib.redis.lettuce51;

import static org.awaitility.Awaitility.await;
import static org.hamcrest.core.IsEqual.equalTo;
Expand All @@ -38,7 +38,7 @@
import org.junit.Test;
import redis.embedded.RedisServer;

public class TracingLettuceTest {
public class TracingLettuce51Test {

private MockTracer mockTracer = new MockTracer();

Expand Down
59 changes: 59 additions & 0 deletions opentracing-redis-lettuce-5.2/pom.xml
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2019 The OpenTracing Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
-->
<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">
<parent>
<artifactId>opentracing-redis-parent</artifactId>
<groupId>io.opentracing.contrib</groupId>
<version>0.1.13-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>opentracing-redis-lettuce-5.2</artifactId>
<name>OpenTracing Instrumentation for Lettuce 5.2 Redis Client</name>
<description>OpenTracing Instrumentation for Lettuce 5.2 Redis Client</description>

<dependencies>

<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-redis-common</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>5.2.0.RELEASE</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.github.kstyrc</groupId>
<artifactId>embedded-redis</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,37 @@
/*
* Copyright 2017-2019 The OpenTracing Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.contrib.redis.lettuce52;

import io.lettuce.core.RedisFuture;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

public class CompletableRedisFuture<T> extends CompletableFuture<T> implements RedisFuture<T> {

private RedisFuture<T> wrappedFuture;

public CompletableRedisFuture(RedisFuture<T> wrappedFuture) {
this.wrappedFuture = wrappedFuture;
}

@Override
public String getError() {
return wrappedFuture.getError();
}

@Override
public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
return wrappedFuture.await(timeout, unit);
}
}

0 comments on commit 657d7a1

Please sign in to comment.