-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
11,310 additions
and
6 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...cing-redis-common/src/main/java/io/opentracing/contrib/redis/common/ThrowingSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2017-2018 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.common; | ||
|
||
@FunctionalInterface | ||
public interface ThrowingSupplier<T extends Exception, V> { | ||
|
||
V get() throws T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright 2017-2018 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.0.14-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>opentracing-redis-redisson</artifactId> | ||
<name>OpenTracing Instrumentation for Redisson</name> | ||
<description>OpenTracing Instrumentation for Redisson</description> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>io.opentracing.contrib</groupId> | ||
<artifactId>opentracing-redis-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.redisson</groupId> | ||
<artifactId>redisson</artifactId> | ||
<version>3.9.0</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.github.kstyrc</groupId> | ||
<artifactId>embedded-redis</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
102 changes: 102 additions & 0 deletions
102
...edis-redisson/src/main/java/io/opentracing/contrib/redis/redisson/CompletableRFuture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Copyright 2017-2018 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.redisson; | ||
|
||
import io.netty.util.concurrent.FutureListener; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.TimeUnit; | ||
import org.redisson.api.RFuture; | ||
|
||
public class CompletableRFuture<T> extends CompletableFuture<T> implements RFuture<T> { | ||
private RFuture<T> wrappedFuture; | ||
|
||
public CompletableRFuture(RFuture<T> wrappedFuture) { | ||
this.wrappedFuture = wrappedFuture; | ||
} | ||
|
||
@Override | ||
public boolean isSuccess() { | ||
return wrappedFuture.isSuccess(); | ||
} | ||
|
||
@Override | ||
public Throwable cause() { | ||
return wrappedFuture.cause(); | ||
} | ||
|
||
@Override | ||
public T getNow() { | ||
return wrappedFuture.getNow(); | ||
} | ||
|
||
@Override | ||
public boolean await(long timeout, TimeUnit unit) throws InterruptedException { | ||
return wrappedFuture.await(timeout, unit); | ||
} | ||
|
||
@Override | ||
public boolean await(long timeoutMillis) throws InterruptedException { | ||
return wrappedFuture.await(timeoutMillis); | ||
} | ||
|
||
@Override | ||
public RFuture<T> addListener(FutureListener<? super T> listener) { | ||
return wrappedFuture.addListener(listener); | ||
} | ||
|
||
@Override | ||
public RFuture<T> addListeners(FutureListener<? super T>... listeners) { | ||
return wrappedFuture.addListeners(listeners); | ||
} | ||
|
||
@Override | ||
public RFuture<T> removeListener(FutureListener<? super T> listener) { | ||
return wrappedFuture.removeListener(listener); | ||
} | ||
|
||
@Override | ||
public RFuture<T> removeListeners(FutureListener<? super T>... listeners) { | ||
return wrappedFuture.removeListeners(listeners); | ||
} | ||
|
||
@Override | ||
public RFuture<T> sync() throws InterruptedException { | ||
return wrappedFuture.sync(); | ||
} | ||
|
||
@Override | ||
public RFuture<T> syncUninterruptibly() { | ||
return wrappedFuture.syncUninterruptibly(); | ||
} | ||
|
||
@Override | ||
public RFuture<T> await() throws InterruptedException { | ||
return wrappedFuture.await(); | ||
} | ||
|
||
@Override | ||
public RFuture<T> awaitUninterruptibly() { | ||
return wrappedFuture.awaitUninterruptibly(); | ||
} | ||
|
||
@Override | ||
public boolean awaitUninterruptibly(long timeout, TimeUnit unit) { | ||
return wrappedFuture.awaitUninterruptibly(timeout, unit); | ||
} | ||
|
||
@Override | ||
public boolean awaitUninterruptibly(long timeoutMillis) { | ||
return wrappedFuture.awaitUninterruptibly(timeoutMillis); | ||
} | ||
} |
Oops, something went wrong.