diff --git a/redisson_3.16.4/build.gradle b/redisson_3.16.4/build.gradle new file mode 100644 index 0000000..35533d8 --- /dev/null +++ b/redisson_3.16.4/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.16.4' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.16.4' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.16.4,3.16.7)' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.16.4/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonList.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonMap.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..993a47b --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,331 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(final Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(final Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture loadAllAsync(final Iterable keys, boolean replaceExistingValues, int parallelism, Map loadedEntires) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + public RFuture putAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(final K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(final K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..557be1d --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,148 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonObject.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..52b0563 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,219 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.buffer.ByteBufUtil; +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; +import io.netty.util.internal.ThreadLocalRandom; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(final int permits, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(final AtomicLong time, final int permits, final RFuture subscribeFuture, final RPromise result, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(final int permits, final RFuture subscribeFuture, final RPromise result, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(final int permits, long waitTime, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(final String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..86c99ab --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,178 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.codec.StringCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(final int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(final AtomicLong time, final int permits, final RFuture subscribeFuture, final RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(final int permits, final RFuture subscribeFuture, final RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(final int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..d835e48 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,147 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAsync(long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAtAsync(long timestamp) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREAT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.16.4/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.16.4/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.16.4/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..6c5854c --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,78 @@ +package org.redisson.command; + +import org.redisson.api.RFuture; +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.RPromise; +import org.redisson.misc.RedissonPromise; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(RFuture RFuture) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public void async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, RPromise mainPromise, + boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + if(mainPromise instanceof RedissonPromise) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + RedissonPromise promise = (RedissonPromise)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Weaver.callOriginal(); + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.16.4/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.16.4/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.4/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.16.4/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.16.4/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.16.4/src/test/resources/redis.properties b/redisson_3.16.4/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.16.4/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/redisson_3.16.7/build.gradle b/redisson_3.16.7/build.gradle new file mode 100644 index 0000000..00d4a90 --- /dev/null +++ b/redisson_3.16.7/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.16.7' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.16.7' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.16.7]' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.16.7/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonList.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonMap.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..993a47b --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,331 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(final Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(final Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture loadAllAsync(final Iterable keys, boolean replaceExistingValues, int parallelism, Map loadedEntires) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + public RFuture putAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(final K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(final K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..557be1d --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,148 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonObject.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..52b0563 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,219 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.buffer.ByteBufUtil; +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; +import io.netty.util.internal.ThreadLocalRandom; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(final int permits, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(final AtomicLong time, final int permits, final RFuture subscribeFuture, final RPromise result, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(final int permits, final RFuture subscribeFuture, final RPromise result, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(final int permits, long waitTime, final long ttl, final TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(final String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..86c99ab --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,178 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.codec.StringCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(final int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(final AtomicLong time, final int permits, final RFuture subscribeFuture, final RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(final int permits, final RFuture subscribeFuture, final RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(final int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..d835e48 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,147 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAsync(long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAtAsync(long timestamp) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREAT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.16.7/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.16.7/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.16.7/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..7321129 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,79 @@ +package org.redisson.command; + +import java.util.concurrent.ExecutionException; + +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.RPromise; +import org.redisson.misc.RedissonPromise; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(ExecutionException ee) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public void async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, RPromise mainPromise, + boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + if(mainPromise instanceof RedissonPromise) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + RedissonPromise promise = (RedissonPromise)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Weaver.callOriginal(); + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.16.7/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.16.7/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.7/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.16.7/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.16.7/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.16.7/src/test/resources/redis.properties b/redisson_3.16.7/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.16.7/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/redisson_3.16.8/build.gradle b/redisson_3.16.8/build.gradle new file mode 100644 index 0000000..c2ac5c7 --- /dev/null +++ b/redisson_3.16.8/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.16.8' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.16.7' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.16.8]' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.16.8/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonList.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonMap.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..993a47b --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,331 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(final Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(final Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture loadAllAsync(final Iterable keys, boolean replaceExistingValues, int parallelism, Map loadedEntires) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + public RFuture putAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(final K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(final K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..ce0bcfc --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,135 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonObject.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..8cd2f6f --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,220 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.buffer.ByteBufUtil; +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; +import io.netty.util.internal.ThreadLocalRandom; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(int permits, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, RPromise result, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private CompletableFuture acquireAsync(int permits, RedissonLockEntry entry, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long waitTime, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..5b51ed1 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,178 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.codec.StringCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(int permits, RedissonLockEntry entry, RPromise result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..d835e48 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,147 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAsync(long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireAtAsync(long timestamp) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREAT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.16.8/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.16.8/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.16.8/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..e154863 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,80 @@ +package org.redisson.command; + +import java.util.concurrent.ExecutionException; + +import org.redisson.api.RFuture; +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.RedissonPromise; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(ExecutionException ee) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public RFuture async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + RFuture mainPromise = Weaver.callOriginal(); + + if(mainPromise instanceof RedissonPromise) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + RedissonPromise promise = (RedissonPromise)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + return mainPromise; + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.16.8/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.16.8/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.16.8/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.16.8/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.16.8/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.16.8/src/test/resources/redis.properties b/redisson_3.16.8/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.16.8/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/redisson_3.16/build.gradle b/redisson_3.16/build.gradle index 08f5c6a..bbe06f9 100644 --- a/redisson_3.16/build.gradle +++ b/redisson_3.16/build.gradle @@ -28,6 +28,6 @@ jar { } verifyInstrumentation { - passes 'org.redisson:redisson:[3.15.6,)' + passes 'org.redisson:redisson:[3.15.6,3.16.4)' excludeRegex '.*-NR.*' } \ No newline at end of file diff --git a/redisson_3.17.2/build.gradle b/redisson_3.17.2/build.gradle new file mode 100644 index 0000000..4e0d161 --- /dev/null +++ b/redisson_3.17.2/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.17.2' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.17.2' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.17.2,3.17.6)' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.17.2/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonList.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonMap.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..993a47b --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,331 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(final Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(final Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture loadAllAsync(final Iterable keys, boolean replaceExistingValues, int parallelism, Map loadedEntires) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + public RFuture putAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(final K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(final K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..ce0bcfc --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,135 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonObject.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..21fda58 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,208 @@ +package org.redisson; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(int permits, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private CompletableFuture acquireAsync(int permits, RedissonLockEntry entry, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long waitTime, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..e6aba4b --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,166 @@ +package org.redisson; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..a9c9a4e --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,121 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.17.2/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.17.2/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.17.2/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..c48e082 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,80 @@ +package org.redisson.command; + +import java.util.concurrent.ExecutionException; + +import org.redisson.api.RFuture; +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.CompletableFutureWrapper; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(ExecutionException ee) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public RFuture async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + RFuture mainPromise = Weaver.callOriginal(); + + if(mainPromise instanceof CompletableFutureWrapper) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + CompletableFutureWrapper promise = (CompletableFutureWrapper)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + return mainPromise; + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.17.2/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.17.2/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.2/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.17.2/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.17.2/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.17.2/src/test/resources/redis.properties b/redisson_3.17.2/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.17.2/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/redisson_3.17.6/build.gradle b/redisson_3.17.6/build.gradle new file mode 100644 index 0000000..ef1bc7e --- /dev/null +++ b/redisson_3.17.6/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.17.6' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.17.6' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.17.6,)' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.17.6/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonList.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonMap.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..b535a27 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,351 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Spliterator; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; + +import org.redisson.api.AsyncIterator; +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(K key, V oldValue, V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture loadAllAsync(Supplier> supplier, boolean replaceExistingValues, int parallelism) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + CompletionStage> loadAllAsync(AsyncIterator iterator, List elements, AtomicInteger workers) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..ce0bcfc --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,135 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonObject.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..21fda58 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,208 @@ +package org.redisson; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(int permits, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private CompletableFuture acquireAsync(int permits, RedissonLockEntry entry, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long waitTime, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..e6aba4b --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,166 @@ +package org.redisson; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..a9c9a4e --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,121 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.17.6/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.17.6/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.17.6/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..c48e082 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,80 @@ +package org.redisson.command; + +import java.util.concurrent.ExecutionException; + +import org.redisson.api.RFuture; +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.CompletableFutureWrapper; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(ExecutionException ee) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public RFuture async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + RFuture mainPromise = Weaver.callOriginal(); + + if(mainPromise instanceof CompletableFutureWrapper) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + CompletableFutureWrapper promise = (CompletableFutureWrapper)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + return mainPromise; + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.17.6/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.17.6/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17.6/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.17.6/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.17.6/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.17.6/src/test/resources/redis.properties b/redisson_3.17.6/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.17.6/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/redisson_3.17/build.gradle b/redisson_3.17/build.gradle new file mode 100644 index 0000000..9be5252 --- /dev/null +++ b/redisson_3.17/build.gradle @@ -0,0 +1,33 @@ + +// Build.gradle generated for instrumentation module redisson_3.16 + +apply plugin: 'java' + +dependencies { + implementation 'org.redisson:redisson:3.17.0' + + // New Relic Java Agent dependencies + implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0' + implementation 'com.newrelic.agent.java:newrelic-api:6.4.0' + implementation fileTree(include: ['*.jar'], dir: '../libs') + + testImplementation 'junit:junit:4.12' + testImplementation fileTree(include: ['*.jar'], dir: '../test-lib') + testImplementation 'com.github.kstyrc:embedded-redis:0.6' + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testImplementation 'org.slf4j:slf4j-simple:1.7.32' +} + +jar { + manifest { + attributes 'Implementation-Title': 'com.newrelic.instrumentation.redisson_3.17' + attributes 'Implementation-Vendor': 'New Relic' + attributes 'Implementation-Vendor-Id': 'com.newrelic' + attributes 'Implementation-Version': 1.0 + } +} + +verifyInstrumentation { + passes 'org.redisson:redisson:[3.17.0,3.17.2)' + excludeRegex '.*-NR.*' +} diff --git a/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java new file mode 100644 index 0000000..f16cd03 --- /dev/null +++ b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRBiConsumer.java @@ -0,0 +1,40 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.BiConsumer; + +import com.newrelic.api.agent.ExternalParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; + +public class NRBiConsumer implements BiConsumer { + + private Segment segment = null; + private ExternalParameters params = null; + + + + public NRBiConsumer(Segment segment, ExternalParameters params) { + super(); + this.segment = segment; + this.params = params; + } + + + + @Override + @Trace + public void accept(T t, Throwable u) { + if(u != null) { + NewRelic.noticeError(u); + } + if(segment != null) { + if(params != null) { + segment.reportAsExternal(params); + } + segment.end(); + segment = null; + } + } + +} diff --git a/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java new file mode 100644 index 0000000..f2acb5c --- /dev/null +++ b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/NRSupplierWrapper.java @@ -0,0 +1,36 @@ +package com.nr.instrumentation.redisson; + +import java.util.function.Supplier; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; + +public class NRSupplierWrapper implements Supplier> { + + private Supplier> delegate = null; + private String cmdName = null; + private String subName = null; + private DatastoreParameters params = null; + + + + public NRSupplierWrapper(Supplier> supplier, String cmd, String sub, DatastoreParameters p) { + delegate = supplier; + cmdName = cmd; + subName = sub; + params = p; + } + + @Override + public RFuture get() { + RFuture future = delegate.get(); + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + subName); + NRBiConsumer action = new NRBiConsumer(segment, params ); + + return (RFuture) future.whenComplete(action); + } + +} diff --git a/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/Utils.java b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/Utils.java new file mode 100644 index 0000000..bcdccc5 --- /dev/null +++ b/redisson_3.17/src/main/java/com/nr/instrumentation/redisson/Utils.java @@ -0,0 +1,70 @@ +package com.nr.instrumentation.redisson; + +public class Utils { + + static ThreadLocal operation = new ThreadLocal(); + static ThreadLocal redissonType = new ThreadLocal(); + static ThreadLocal objectName = new ThreadLocal(); + + + public static boolean operationIsSet() { + String operationName = operation.get(); + return operationName != null && !operationName.isEmpty(); + } + + public static String getOperation() { + String operationName = operation.get(); + return operationName; + } + + public static void setOperation(String operationName) { + operation.set(operationName); + } + + public static void unSetOperation() { + operation.remove(); + } + + public static boolean typeSet() { + String type = redissonType.get(); + return type != null && !type.isEmpty(); + } + + public static void setType(Object obj) { + Class clazz = obj.getClass(); + String classname = clazz.getSimpleName().replace("Redisson", "").replace("Reactive", ""); + + redissonType.set(classname); + } + + public static void setType(String type) { + redissonType.set(type); + } + + public static String getType() { + return redissonType.get(); + } + + public static void unSetType() { + redissonType.remove(); + } + + public static boolean objectNameSet() { + String oName = objectName.get(); + return oName != null && !oName.isEmpty(); + } + + public static void setObjectName(String oName) { + if(oName.startsWith("{")) return; + objectName.set(oName); + } + + public static String getObjectName() { + return objectName.get(); + } + + public static void unSetObjectName() { + objectName.remove(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonAtomicDouble.java b/redisson_3.17/src/main/java/org/redisson/RedissonAtomicDouble.java new file mode 100644 index 0000000..da12e15 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonAtomicDouble.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicDouble implements RAtomicDouble { + + + public RFuture addAndGetAsync(double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(double expect, double update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync(final double delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public double getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(double newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonAtomicLong.java b/redisson_3.17/src/main/java/org/redisson/RedissonAtomicLong.java new file mode 100644 index 0000000..187a27b --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonAtomicLong.java @@ -0,0 +1,171 @@ +package org.redisson; + +import org.redisson.api.RAtomicLong; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonAtomicLong implements RAtomicLong { + + + public RFuture addAndGetAsync(long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(long expect, long update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture decrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DECREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long get() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndAddAsync( long delta) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndDecrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndDecrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDDECREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture incrementAndGetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("INCREMENTANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public long getAndIncrement() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndIncrementAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDINCREMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonBitSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonBitSet.java new file mode 100644 index 0000000..65e9daa --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonBitSet.java @@ -0,0 +1,240 @@ +package org.redisson; + +import java.util.BitSet; + +import org.redisson.api.RBitSet; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBitSet implements RBitSet { + + + + public RFuture getAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(long bitIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture toByteArrayAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("toByteArray"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture lengthAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LENGTH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex, boolean value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(BitSet bs) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture notAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("NOT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture setAsync(long fromIndex, long toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture cardinalityAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CARDINALITY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync(long bitIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture clearAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture orAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture andAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("AND"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture xorAsync(String... bitSetNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("XOR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonBlockingDeque.java b/redisson_3.17/src/main/java/org/redisson/RedissonBlockingDeque.java new file mode 100644 index 0000000..00e04d9 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonBlockingDeque.java @@ -0,0 +1,384 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingDeque implements RBlockingDeque{ + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V take() throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V poll(long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELASTANDOFFERFIRSTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainTo(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int drainTo(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void putFirst(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public void putLast(V e) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRSTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonBlockingQueue.java b/redisson_3.17/src/main/java/org/redisson/RedissonBlockingQueue.java new file mode 100644 index 0000000..6cb10d2 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonBlockingQueue.java @@ -0,0 +1,127 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBlockingQueue implements RBlockingQueue { + + + + public RFuture putAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture takeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAKE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollAsync(long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFROMANY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture takeLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("takeLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture drainToAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture drainToAsync(Collection c, int maxElements) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DrainTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonBucket.java b/redisson_3.17/src/main/java/org/redisson/RedissonBucket.java new file mode 100644 index 0000000..6d686ff --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonBucket.java @@ -0,0 +1,120 @@ +package org.redisson; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RBucket; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBucket implements RBucket { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAndSetAsync(V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture compareAndSetAsync(V expect, V update) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COMPAREANDSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(V value, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonBuckets.java b/redisson_3.17/src/main/java/org/redisson/RedissonBuckets.java new file mode 100644 index 0000000..cb2caee --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonBuckets.java @@ -0,0 +1,47 @@ +package org.redisson; + +import java.util.Map; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonBuckets { + + + public Map get(String... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public boolean trySet(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + public void set(Map buckets) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonDelayedQueue.java b/redisson_3.17/src/main/java/org/redisson/RedissonDelayedQueue.java new file mode 100644 index 0000000..2ab2166 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonDelayedQueue.java @@ -0,0 +1,248 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDelayedQueue implements RDelayedQueue { + + + public RFuture offerAsync(V e, long delay, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + void remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLASTANDOFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + } diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonDeque.java b/redisson_3.17/src/main/java/org/redisson/RedissonDeque.java new file mode 100644 index 0000000..9451033 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonDeque.java @@ -0,0 +1,289 @@ +package org.redisson; + +import org.redisson.api.RDeque; +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonDeque implements RDeque { + + + public RFuture addFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerFirstAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture offerLastAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFERLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEKLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture popAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pushAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void push(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUSH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRSTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonGeo.java b/redisson_3.17/src/main/java/org/redisson/RedissonGeo.java new file mode 100644 index 0000000..a6e0f87 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonGeo.java @@ -0,0 +1,518 @@ +package org.redisson; + +import java.util.List; +import java.util.Map; + +import org.redisson.api.GeoEntry; +import org.redisson.api.GeoOrder; +import org.redisson.api.GeoPosition; +import org.redisson.api.GeoUnit; +import org.redisson.api.RFuture; +import org.redisson.api.RGeo; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonGeo implements RGeo { + + + + public RFuture addAsync(double longitude, double latitude, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(GeoEntry... entries) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture distAsync(V firstMember, V secondMember, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture> hashAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HASH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + @SuppressWarnings("unchecked") + public RFuture> posAsync(V... members) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHDISTANCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSWITHPOSITION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RADIUSSTORETO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonHyperLogLog.java b/redisson_3.17/src/main/java/org/redisson/RedissonHyperLogLog.java new file mode 100644 index 0000000..3006f6a --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonHyperLogLog.java @@ -0,0 +1,85 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RHyperLogLog; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonHyperLogLog implements RHyperLogLog { + + + public RFuture addAsync(V obj) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture mergeWithAsync(String... otherLogNames) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MERGEWITH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonLexSortedSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonLexSortedSet.java new file mode 100644 index 0000000..7e7360b --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonLexSortedSet.java @@ -0,0 +1,238 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RLexSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLexSortedSet implements RLexSortedSet { + + public RFuture removeRangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGETOTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGEHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGETAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture countTailAsync(String fromElement, boolean fromInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTTAIL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countHeadAsync(String toElement, boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNTHEAD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(String fromElement, boolean fromInclusive, String toElement, + boolean toInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(String e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection range(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> rangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonList.java b/redisson_3.17/src/main/java/org/redisson/RedissonList.java new file mode 100644 index 0000000..76897e3 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonList.java @@ -0,0 +1,477 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonList implements RList { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + protected RFuture addAsync(V e, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonListMultimap.java b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimap.java new file mode 100644 index 0000000..c988792 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimap.java @@ -0,0 +1,154 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RListMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimap implements RListMultimap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapCache.java b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapCache.java new file mode 100644 index 0000000..29327bf --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapCache.java @@ -0,0 +1,97 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.RListMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapCache implements RListMultimapCache { + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList get(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapValues.java b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapValues.java new file mode 100644 index 0000000..e020341 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonListMultimapValues.java @@ -0,0 +1,791 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.api.RList; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListMultimapValues implements RList { + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(final Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> getAsync(int ...indexes) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V set(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastSet(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void fastRemove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture fastRemoveAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void trim(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RList subList(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBLIST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAfterAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture addBeforeAsync(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addAfter(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDAFTER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int addBefore(V elementToFind, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDBEFORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public List readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public List readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, + SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonLocalCachedMap.java b/redisson_3.17/src/main/java/org/redisson/RedissonLocalCachedMap.java new file mode 100644 index 0000000..210dd08 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonLocalCachedMap.java @@ -0,0 +1,200 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RLocalCachedMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonLocalCachedMap implements RLocalCachedMap { + + + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture getAsync(final Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonMap.java b/redisson_3.17/src/main/java/org/redisson/RedissonMap.java new file mode 100644 index 0000000..993a47b --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonMap.java @@ -0,0 +1,331 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMap implements RMap { + + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture valueSizeAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUESIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(final Set keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(final Map map) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllMapAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLMAP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture putIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, V oldValue, final V newValue) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture replaceAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture loadAllAsync(final Iterable keys, boolean replaceExistingValues, int parallelism, Map loadedEntires) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LOADALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + + } + + public RFuture putAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastPutOperationAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(final K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAndGetAsync(final K key, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ANDANDGET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonMapCache.java b/redisson_3.17/src/main/java/org/redisson/RedissonMapCache.java new file mode 100644 index 0000000..ce0bcfc --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonMapCache.java @@ -0,0 +1,135 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RMapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMapCache implements RMapCache { + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastPutIfAbsentAsync(final K key, final V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTPUTIFABSENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> readAllEntrySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLENTRYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllValuesAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonMultimap.java b/redisson_3.17/src/main/java/org/redisson/RedissonMultimap.java new file mode 100644 index 0000000..a52630d --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonMultimap.java @@ -0,0 +1,94 @@ +package org.redisson; + +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RMultimap; +import org.redisson.client.protocol.RedisCommand; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonMultimap implements RMultimap { + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readAllKeySetAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALLKEYSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unchecked") + public RFuture fastRemoveAsync(K ... keys) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + protected RFuture fastRemoveAsync(List mapKeys, List listKeys, RedisCommand evalCommandType) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTREMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture keySizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("KEYSIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonObject.java b/redisson_3.17/src/main/java/org/redisson/RedissonObject.java new file mode 100644 index 0000000..25db2bb --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonObject.java @@ -0,0 +1,123 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RObject; +import org.redisson.client.codec.Codec; +import org.redisson.command.CommandAsyncExecutor; +import org.redisson.command.CommandAsyncService; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonObject implements RObject { + + @NewField + public String objectName = null; + + public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name) { + if(commandExecutor instanceof CommandAsyncService) { + CommandAsyncService cmdAsyncService = (CommandAsyncService)commandExecutor; + if(cmdAsyncService.objectType == null) { + + String clazzname = objectName != null ? objectName : getClass().getSimpleName().replace("Redisson", ""); + cmdAsyncService.objectType = clazzname; + } + } + } + + public RFuture renameAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAME"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(int database) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture renamenxAsync(String newName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RENAMENX"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unlinkAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNLINK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture touchAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TOUCH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture isExistsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEXISTS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java b/redisson_3.17/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java new file mode 100644 index 0000000..766d58d --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonPermitExpirableSemaphore.java @@ -0,0 +1,220 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.buffer.ByteBufUtil; +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; +import io.netty.util.internal.ThreadLocalRandom; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPermitExpirableSemaphore implements RPermitExpirableSemaphore { + + + public RFuture acquireAsync(long leaseTime, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture acquireAsync(int permits, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private CompletableFuture acquireAsync(int permits, RedissonLockEntry entry, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long timeoutDate) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private RFuture tryAcquireAsync(int permits, long waitTime, long ttl, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryReleaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYRELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(String permitId) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture availablePermitsAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonPriorityDeque.java b/redisson_3.17/src/main/java/org/redisson/RedissonPriorityDeque.java new file mode 100644 index 0000000..67f4c95 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonPriorityDeque.java @@ -0,0 +1,148 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityDeque; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityDeque implements RPriorityDeque { + + public RFuture getLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETASYNC"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V pollFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V pop() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POP"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeFirstOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeFirstOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("removeFirstOccurrence".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture removeLastOccurrenceAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public boolean removeLastOccurrence(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVELASTOCCURRENCE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonPriorityQueue.java b/redisson_3.17/src/main/java/org/redisson/RedissonPriorityQueue.java new file mode 100644 index 0000000..3cce098 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonPriorityQueue.java @@ -0,0 +1,222 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RPriorityQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonPriorityQueue implements RPriorityQueue { + + + public boolean offer(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonQueue.java b/redisson_3.17/src/main/java/org/redisson/RedissonQueue.java new file mode 100644 index 0000000..93e3468 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonQueue.java @@ -0,0 +1,136 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RQueue; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueue implements RQueue { + + + public RFuture offerAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("OFFER"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V getFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeFirst() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V remove() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V element() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ELEMENT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture peekAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public V peek() { + if(!Utils.operationIsSet()) { + Utils.setOperation("PEEK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture pollLastAndOfferFirstToAsync(String queueName) { + if(!Utils.operationIsSet()) { + Utils.setOperation("pollLastAndOfferFirstTo".toUpperCase()); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonQueueSemaphore.java b/redisson_3.17/src/main/java/org/redisson/RedissonQueueSemaphore.java new file mode 100644 index 0000000..6798337 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonQueueSemaphore.java @@ -0,0 +1,26 @@ +package org.redisson; + +import org.redisson.api.RFuture; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonQueueSemaphore extends RedissonSemaphore { + + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonScoredSortedSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonScoredSortedSet.java new file mode 100644 index 0000000..c2878d8 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -0,0 +1,659 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.SortOrder; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.client.protocol.ScoredEntry; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonScoredSortedSet implements RScoredSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollFirstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLFIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture pollLastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLLLAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture poll(int from, int to, RedisCommand command) { + if(!Utils.operationIsSet()) { + Utils.setOperation("POLL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture firstScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRSTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastScoreAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Map objects) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAddAsync(double score, V object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByRankAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANGEBYSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture removeAsync(Object object) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture getScoreAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture rankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addScoreAsync(V object, Number value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDSCORE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(int startIndex, int endIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, + boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("VALUERANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, + double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ENTRYRANGEREVERSED"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture revRankAsync(V o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REVRANK"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive) { + if(!Utils.operationIsSet()) { + Utils.setOperation("COUNT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(Aggregate aggregate, Map nameWithWeight) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSemaphore.java b/redisson_3.17/src/main/java/org/redisson/RedissonSemaphore.java new file mode 100644 index 0000000..5cacb0e --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSemaphore.java @@ -0,0 +1,179 @@ +package org.redisson; + +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import org.redisson.api.RFuture; +import org.redisson.api.RSemaphore; +import org.redisson.client.codec.LongCodec; +import org.redisson.client.codec.StringCodec; +import org.redisson.client.protocol.RedisCommands; +import org.redisson.misc.RPromise; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +import io.netty.util.Timeout; +import io.netty.util.TimerTask; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.FutureListener; + +@SuppressWarnings("unused") +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSemaphore implements RSemaphore { + + public void acquire(int permits) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture acquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + private void acquireAsync(int permits, RedissonLockEntry entry, CompletableFuture result) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean tryAcquire(int permits, long waitTime, TimeUnit unit) throws InterruptedException { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture tryAcquireAsync(int permits, long waitTime, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYACQUIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture releaseAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RELEASE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int drainPermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DRAINPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int availablePermits() { + if(!Utils.operationIsSet()) { + Utils.setOperation("AVAILABLEPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trySetPermitsAsync(int permits) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRYSETPERMITS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonSet.java new file mode 100644 index 0000000..dd55ef2 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSet.java @@ -0,0 +1,367 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSet implements RSet { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSetCache.java b/redisson_3.17/src/main/java/org/redisson/RedissonSetCache.java new file mode 100644 index 0000000..fd4c844 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSetCache.java @@ -0,0 +1,157 @@ +package org.redisson; + +import java.util.Collection; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCache implements RSetCache { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V value, long ttl, TimeUnit unit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimap.java b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimap.java new file mode 100644 index 0000000..bb0a714 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimap.java @@ -0,0 +1,146 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimap; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimap implements RSetMultimap { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAsync(K key, V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture putAllAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUTALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> replaceValuesAsync(K key, Iterable values) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REPLACEVALUES"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapCache.java b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapCache.java new file mode 100644 index 0000000..a9c9a4e --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapCache.java @@ -0,0 +1,121 @@ +package org.redisson; + +import java.util.Collection; +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RFuture; +import org.redisson.api.RSetMultimapCache; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapCache implements RSetMultimapCache { + + public RFuture containsKeyAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsValueAsync(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSVALUE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsEntryAsync(Object key, Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSENTRY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> getAllAsync(K key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GETALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeAllAsync(Object key) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture expireKeyAsync(K key, long timeToLive, TimeUnit timeUnit) { + if(!Utils.operationIsSet()) { + Utils.setOperation("EXPIREKEY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture clearExpireAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAREXPIRE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapValues.java b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapValues.java new file mode 100644 index 0000000..17148aa --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSetMultimapValues.java @@ -0,0 +1,631 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.redisson.api.RFuture; +import org.redisson.api.RSet; +import org.redisson.api.SortOrder; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetMultimapValues implements RSet { + + public RFuture deleteAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("DELETE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V removeRandom() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeRandomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> removeRandomAsync(int amount) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVERANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture randomAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("RANDOM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture moveAsync(String destination, V member) { + if(!Utils.operationIsSet()) { + Utils.setOperation("MOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture unionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("UNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readUnionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READUNION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture diffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("DIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readDiffAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READDIFF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture intersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readIntersectionAsync(String... names) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READINTERSECTION"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Set readSort(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public Collection readSort(String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readSortAsync(String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("READSORT"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int sortTo(String destName, String byPattern, List getPatterns, SortOrder order, int offset, + int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture sortToAsync(String destName, String byPattern, List getPatterns, SortOrder order, + int offset, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SORTTO"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSortedSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonSortedSet.java new file mode 100644 index 0000000..28e68fc --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSortedSet.java @@ -0,0 +1,195 @@ +package org.redisson; + +import java.util.Collection; + +import org.redisson.api.RFuture; +import org.redisson.api.RSortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSortedSet implements RSortedSet { + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean contains(final Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean add(V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAsync(final V value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(final Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object value) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSubList.java b/redisson_3.17/src/main/java/org/redisson/RedissonSubList.java new file mode 100644 index 0000000..030fdc4 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSubList.java @@ -0,0 +1,235 @@ +package org.redisson; + +import java.util.Collection; +import java.util.List; + +import org.redisson.api.RFuture; +import org.redisson.client.protocol.convertor.Convertor; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSubList extends RedissonList { + + public RFuture sizeAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture> readAllAsync() { + if(!Utils.operationIsSet()) { + Utils.setOperation("READALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture removeAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture containsAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture addAllAsync(int index, Collection coll) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + @SuppressWarnings("unused") + private RFuture removeAllAsync(Collection c, int count) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture retainAllAsync(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RETAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public RFuture getAsync(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public V get(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("GET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture setAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture fastSetAsync(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("FASTSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public void add(int index, V element) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public V remove(int index) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture indexOfAsync(Object o, Convertor convertor) { + if(!Utils.operationIsSet()) { + Utils.setOperation("INDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture lastIndexOfAsync(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("LASTINDEXOF"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + public RFuture trimAsync(int fromIndex, int toIndex) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TRIM"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + if(!Utils.objectNameSet()) { + Utils.setObjectName(getName()); + } + return Weaver.callOriginal(); + } + + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonSubSortedSet.java b/redisson_3.17/src/main/java/org/redisson/RedissonSubSortedSet.java new file mode 100644 index 0000000..8a3f7ea --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonSubSortedSet.java @@ -0,0 +1,164 @@ +package org.redisson; + +import java.util.Collection; +import java.util.SortedSet; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +abstract class RedissonSubSortedSet { + + public int size() { + if(!Utils.operationIsSet()) { + Utils.setOperation("SIZE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean isEmpty() { + if(!Utils.operationIsSet()) { + Utils.setOperation("ISEMPTY"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean contains(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINS"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean add(V e) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADD"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean remove(Object o) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVE"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean containsAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("CONTAINSALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean addAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean retainAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("RERTAINALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public boolean removeAll(Collection c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("REMOVEALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public void clear() { + if(!Utils.operationIsSet()) { + Utils.setOperation("CLEAR"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + Weaver.callOriginal(); + } + + public SortedSet subSet(V fromElement, V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("SUBSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet headSet(V toElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("HEADSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public SortedSet tailSet(V fromElement) { + if(!Utils.operationIsSet()) { + Utils.setOperation("TAILSET"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V first() { + if(!Utils.operationIsSet()) { + Utils.setOperation("FIRST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + public V last() { + if(!Utils.operationIsSet()) { + Utils.setOperation("LAST"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/RedissonTopic.java b/redisson_3.17/src/main/java/org/redisson/RedissonTopic.java new file mode 100644 index 0000000..e9df86d --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/RedissonTopic.java @@ -0,0 +1,24 @@ +package org.redisson; + +import org.redisson.api.RFuture; +import org.redisson.api.RTopic; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonTopic implements RTopic { + + public RFuture publishAsync(Object message) { + if(!Utils.operationIsSet()) { + Utils.setOperation("PUBLISH"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/Redisson_instrumentation.java b/redisson_3.17/src/main/java/org/redisson/Redisson_instrumentation.java new file mode 100644 index 0000000..0741f75 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/Redisson_instrumentation.java @@ -0,0 +1,719 @@ +package org.redisson; + +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.MapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBinaryStream; +import org.redisson.api.RBitSet; +import org.redisson.api.RBlockingDeque; +import org.redisson.api.RBlockingQueue; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RBuckets; +import org.redisson.api.RDelayedQueue; +import org.redisson.api.RDeque; +import org.redisson.api.RGeo; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLexSortedSet; +import org.redisson.api.RList; +import org.redisson.api.RListMultimap; +import org.redisson.api.RListMultimapCache; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RMapCache; +import org.redisson.api.RPatternTopic; +import org.redisson.api.RPermitExpirableSemaphore; +import org.redisson.api.RPriorityDeque; +import org.redisson.api.RPriorityQueue; +import org.redisson.api.RQueue; +import org.redisson.api.RReadWriteLock; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RSemaphore; +import org.redisson.api.RSet; +import org.redisson.api.RSetCache; +import org.redisson.api.RSetMultimap; +import org.redisson.api.RSetMultimapCache; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.client.codec.Codec; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; + +@Weave(originalName="org.redisson.Redisson") +public abstract class Redisson_instrumentation { + + + public RBinaryStream getBinaryStream(String name) { + RBinaryStream obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BinaryStream"; + } + return obj; + } + + + public RGeo getGeo(String name) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RGeo getGeo(String name, Codec codec) { + RGeo obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Geo"; + } + return obj; + } + + + public RBucket getBucket(String name) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBucket getBucket(String name, Codec codec) { + RBucket obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Bucket"; + } + return obj; + } + + + public RBuckets getBuckets() { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RBuckets getBuckets(Codec codec) { + RBuckets obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Buckets"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RHyperLogLog getHyperLogLog(String name, Codec codec) { + RHyperLogLog obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "HyperLogLog"; + } + return obj; + } + + + public RList getList(String name) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RList getList(String name, Codec codec) { + RList obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "List"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RListMultimap getListMultimap(String name, Codec codec) { + RListMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RLocalCachedMap getLocalCachedMap(String name, Codec codec, LocalCachedMapOptions options) { + RLocalCachedMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LocalCachedMap"; + } + return obj; + } + + + public RMap getMap(String name) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RSetMultimapCache getSetMultimapCache(String name, Codec codec) { + RSetMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RListMultimapCache getListMultimapCache(String name, Codec codec) { + RListMultimapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ListMultiMapCache"; + } + return obj; + } + + + public RSetMultimap getSetMultimap(String name, Codec codec) { + RSetMultimap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetMultiMap"; + } + return obj; + } + + + public RSetCache getSetCache(String name) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RSetCache getSetCache(String name, Codec codec) { + RSetCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SetCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMapCache getMapCache(String name, Codec codec, MapOptions options) { + RMapCache obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "MapCache"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RMap getMap(String name, Codec codec, MapOptions options) { + RMap obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Map"; + } + return obj; + } + + + public RLock getLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Lock"; + } + return obj; + } + + + public RLock getFairLock(String name) { + RLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "FairLock"; + } + return obj; + } + + + public RReadWriteLock getReadWriteLock(String name) { + RReadWriteLock obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ReadWriteLock"; + } + return obj; + } + + + public RSet getSet(String name) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSet getSet(String name, Codec codec) { + RSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Set"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RSortedSet getSortedSet(String name, Codec codec) { + RSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "SortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RScoredSortedSet getScoredSortedSet(String name, Codec codec) { + RScoredSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "ScoredSortedSet"; + } + return obj; + } + + + public RLexSortedSet getLexSortedSet(String name) { + RLexSortedSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "LexSortedSet"; + } + return obj; + } + + + public RTopic getTopic(String name) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RTopic getTopic(String name, Codec codec) { + RTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Topic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RPatternTopic getPatternTopic(String pattern, Codec codec) { + RPatternTopic obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PatternTopic"; + } + return obj; + } + + + public RDelayedQueue getDelayedQueue(RQueue destinationQueue) { + RDelayedQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "DelayedQueue"; + } + return obj; + } + + + public RQueue getQueue(String name) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RQueue getQueue(String name, Codec codec) { + RQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Queue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBlockingQueue getBlockingQueue(String name, Codec codec) { + RBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RBoundedBlockingQueue getBoundedBlockingQueue(String name, Codec codec) { + RBoundedBlockingQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BoundedBlockingQueue"; + } + return obj; + } + + + public RDeque getDeque(String name) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RDeque getDeque(String name, Codec codec) { + RDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Deque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + } + + + public RBlockingDeque getBlockingDeque(String name, Codec codec) { + RBlockingDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BlockingDeque"; + } + return obj; + }; + + + public RAtomicLong getAtomicLong(String name) { + RAtomicLong obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicLong"; + } + return obj; + } + + + public RAtomicDouble getAtomicDouble(String name) { + RAtomicDouble obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "AtomicDouble"; + } + return obj; + } + + + public RBitSet getBitSet(String name) { + RBitSet obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BitSet"; + } + return obj; + } + + + public RSemaphore getSemaphore(String name) { + RSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "Semaphore"; + } + return obj; + } + + public RPermitExpirableSemaphore getPermitExpirableSemaphore(String name) { + RPermitExpirableSemaphore obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PermitExpirableSemaphore"; + } + return obj; + } + + + + public RBloomFilter getBloomFilter(String name) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RBloomFilter getBloomFilter(String name, Codec codec) { + RBloomFilter obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "BloomFilter"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityQueue getPriorityQueue(String name, Codec codec) { + RPriorityQueue obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityQueue"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + + + public RPriorityDeque getPriorityDeque(String name, Codec codec) { + RPriorityDeque obj = Weaver.callOriginal(); + if(obj instanceof RedissonObject) { + RedissonObject redissonObj = (RedissonObject)obj; + redissonObj.objectName = "PriorityDeque"; + } + return obj; + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson_3.17/src/main/java/org/redisson/command/CommandAsyncService.java new file mode 100644 index 0000000..e154863 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/command/CommandAsyncService.java @@ -0,0 +1,80 @@ +package org.redisson.command; + +import java.util.concurrent.ExecutionException; + +import org.redisson.api.RFuture; +import org.redisson.client.RedisException; +import org.redisson.client.codec.Codec; +import org.redisson.client.protocol.RedisCommand; +import org.redisson.connection.ConnectionManager; +import org.redisson.connection.NodeSource; +import org.redisson.liveobject.core.RedissonObjectBuilder; +import org.redisson.misc.RedissonPromise; + +import com.newrelic.api.agent.DatastoreParameters; +import com.newrelic.api.agent.NewRelic; +import com.newrelic.api.agent.Segment; +import com.newrelic.api.agent.Trace; +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.NewField; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.NRBiConsumer; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandAsyncService implements CommandAsyncExecutor { + + @NewField + public String objectType = null; + + public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) { + + } + + + public RedisException convertException(ExecutionException ee) { + RedisException e = Weaver.callOriginal(); + if(e != null) { + NewRelic.noticeError(e); + } + return e; + } + + @Trace(excludeFromTransactionTrace=true) + public RFuture async(boolean readOnlyMode, NodeSource source, Codec codec, + RedisCommand command, Object[] params, boolean ignoreRedirect, boolean noRetry) { + String operationName = Utils.getOperation(); + + String cmdName = operationName != null ? operationName : command.getName(); + if(cmdName == null || cmdName.isEmpty()) { + cmdName = "UnknownCommandName"; + } + + String subName = command.getSubName(); + + String oName = Utils.getObjectName(); + + RFuture mainPromise = Weaver.callOriginal(); + + if(mainPromise instanceof RedissonPromise) { + + String collectionName = Utils.typeSet() ? Utils.getType() : objectType != null ? objectType : "?"; + Segment segment = NewRelic.getAgent().getTransaction().startSegment(cmdName + "-" + collectionName); + segment.addCustomAttribute("Command", cmdName); + if(subName != null) { + segment.addCustomAttribute("Sub", subName); + } + if(oName != null && !oName.isEmpty()) segment.addCustomAttribute("Redisson Object Name", oName); + DatastoreParameters dsParams = DatastoreParameters.product("Redisson").collection(collectionName).operation(cmdName).build(); + RedissonPromise promise = (RedissonPromise)mainPromise; + NRBiConsumer listener = new NRBiConsumer(segment, dsParams); + promise.onComplete(listener); + } + Utils.unSetOperation(); + Utils.unSetType(); + Utils.unSetObjectName(); + return mainPromise; + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/reactive/CommandReactiveService.java b/redisson_3.17/src/main/java/org/redisson/reactive/CommandReactiveService.java new file mode 100644 index 0000000..6bc7fa1 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/reactive/CommandReactiveService.java @@ -0,0 +1,9 @@ +package org.redisson.reactive; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; + +@Weave(type=MatchType.BaseClass) +public abstract class CommandReactiveService { + +} diff --git a/redisson_3.17/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java new file mode 100644 index 0000000..e8434e3 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonLexSortedSetReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave +public abstract class RedissonLexSortedSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17/src/main/java/org/redisson/reactive/RedissonListReactive.java b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonListReactive.java new file mode 100644 index 0000000..85a499a --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonListReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonListReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java new file mode 100644 index 0000000..ac90838 --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetCacheReactive.java @@ -0,0 +1,24 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetCacheReactive { + + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + +} diff --git a/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetReactive.java b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetReactive.java new file mode 100644 index 0000000..e3af4aa --- /dev/null +++ b/redisson_3.17/src/main/java/org/redisson/reactive/RedissonSetReactive.java @@ -0,0 +1,25 @@ +package org.redisson.reactive; + +import org.reactivestreams.Publisher; + +import com.newrelic.api.agent.weaver.MatchType; +import com.newrelic.api.agent.weaver.Weave; +import com.newrelic.api.agent.weaver.Weaver; +import com.nr.instrumentation.redisson.Utils; + +@Weave(type=MatchType.BaseClass) +public abstract class RedissonSetReactive { + + public Publisher addAll(Publisher c) { + if(!Utils.operationIsSet()) { + Utils.setOperation("ADDALL"); + } + if(!Utils.typeSet()) { + Utils.setType(this); + } + return Weaver.callOriginal(); + } + + + +} diff --git a/redisson_3.17/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java b/redisson_3.17/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java new file mode 100644 index 0000000..7dca207 --- /dev/null +++ b/redisson_3.17/src/test/java/com/nr/instrumentation/redisson/RedissonTestClient.java @@ -0,0 +1,234 @@ +package com.nr.instrumentation.redisson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +//import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.reactivestreams.Publisher; +import org.redisson.Redisson; +import org.redisson.api.RBucket; +import org.redisson.api.RDequeReactive; +import org.redisson.api.RQueue; +import org.redisson.api.RedissonClient; +import org.redisson.api.RedissonReactiveClient; + +import com.newrelic.agent.introspec.InstrumentationTestConfig; +import com.newrelic.agent.introspec.InstrumentationTestRunner; +import com.newrelic.agent.introspec.Introspector; +//import com.newrelic.agent.introspec.TraceSegment; +import com.newrelic.agent.introspec.TracedMetricData; +import com.newrelic.api.agent.Trace; + +import reactor.core.publisher.Mono; +import redis.embedded.RedisServer; + + +@RunWith(InstrumentationTestRunner.class) +@InstrumentationTestConfig(includePrefixes = { "org.redisson" }) +public class RedissonTestClient { + + static RedissonClient client = null; + static RedissonReactiveClient reactive = null; + protected static RedisServer redisServer = null; + + @BeforeClass + public static void beforeClass() throws IOException { + InputStream stream = RedissonTestClient.class.getResourceAsStream("/redis.properties"); + if (stream != null) { + System.out.println("Opened inputstream to redis.properties"); + } else { + System.out.println("Failed to open inputstream to redis.properties"); + } + Properties properties = new Properties(); + if (stream != null) { + properties.load(stream); + } + + boolean useEmbedded = Boolean.parseBoolean(properties.getProperty("redis-server-embedded", "true")); + + String host = properties.getProperty("redis-server-host", "localhost"); + int port = Integer.parseInt(properties.getProperty("redis-server-port", "6379")); + + if (useEmbedded) { + redisServer = new RedisServer(port); + redisServer.start(); + System.out.println("Embedded Redis Server started on port " + port); + } else { + System.out.println("Will use external Redis server on " + host + " and port " + port); + } + try { + Thread.sleep(5000L); + } catch (Exception e) { + e.printStackTrace(); + } + client = Redisson.create(); + reactive = Redisson.create().reactive(); + } + + @AfterClass + public static void afterClass() { + if(redisServer != null) { + redisServer.stop(); + } + } + + @Test + public void dequeReactiveTest() { + testDequeReactive(); + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + System.out.println("There are "+count+" transactions"); + assertEquals(1,count); + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testDequeReactive"; + assertTrue(txnNames.contains(txnName)); + + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/POP")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/ADDFIRST")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Deque/DELETE")); + } + + @Trace(dispatcher=true) + public void testDequeReactive() { + RDequeReactive deque = reactive.getDeque("testDeque"); + Integer size = sync(deque.size()); + System.out.println("Size is "+size); + if(size != null && size > 0) { + for(int i=0;i txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testQueue"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/ADD")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CLEAR")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Queue/CONTAINS")); + + } + + @Test + public void bucketTest() { + testBucket(); + + Introspector introspector = InstrumentationTestRunner.getIntrospector(); + int count = introspector.getFinishedTransactionCount(2500); + assertEquals(count, 1); + + Collection txnNames = introspector.getTransactionNames(); + String txnName = "OtherTransaction/Custom/com.nr.instrumentation.redisson.RedissonTestClient/testBucket"; + assertTrue(txnNames.contains(txnName)); + Map metrics = introspector.getMetricsForTransaction(txnName); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/GETANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/COMPAREANDSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SIZE")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/TRYSET")); + assertTrue(metrics.containsKey("Datastore/statement/Redisson/Bucket/SET")); + } + + @Trace(dispatcher=true) + public void testBucket() { + RBucket bucket = client.getBucket("test"); + bucket.set("123"); + boolean isUpdated = bucket.compareAndSet("123", "4948"); + assertTrue("compareAndSet Failed",isUpdated); + String prevObject = bucket.getAndSet("321"); + System.out.println("Result of getAndSet is "+prevObject); + + boolean isSet = bucket.trySet("901"); + System.out.println("Result of trySet is "+isSet); + long objectSize = bucket.size(); + System.out.println("Result of size is "+objectSize); + + // set with expiration + bucket.set("value", 10, TimeUnit.SECONDS); + boolean isNewSet = bucket.trySet("nextValue", 10, TimeUnit.SECONDS); + System.out.println("Result of isNewSet is "+isNewSet); + + } + + @Trace(dispatcher=true) + public void testQueue() { + RQueue queue = client.getQueue("myQueue"); + + queue.clear(); + + boolean added = queue.add("1"); + assertTrue("1 not added", added); + added = queue.add("2"); + assertTrue("2 not added", added); + added = queue.add("3"); + assertTrue("3 not added", added); + + boolean contains = queue.contains("1"); + assertTrue("queue does not contain 1", contains); + + int size = queue.size(); + assertEquals(size, 3); + } + +// private void reportMetrics(Map metrics) { +// for(String name : metrics.keySet()) { +// TracedMetricData data = metrics.get(name); +// System.out.println("\tMetric: "+name); +// System.out.println("\t\tCall Count: "+data.getCallCount()); +// } +// } +// +// private void reportTrace(TraceSegment segment,int indent) { +// StringBuffer sb = new StringBuffer(); +// for(int i=0;i children = segment.getChildren(); +// System.out.println(prefix+"Number of children: " + children.size()); +// for(TraceSegment child : children) { +// reportTrace(child, indent+1); +// } +// } + + private static V sync(Publisher obs) { + return Mono.from(obs).block(); + } +} diff --git a/redisson_3.17/src/test/resources/redis.properties b/redisson_3.17/src/test/resources/redis.properties new file mode 100644 index 0000000..dd8ba66 --- /dev/null +++ b/redisson_3.17/src/test/resources/redis.properties @@ -0,0 +1,4 @@ +redis-server-embedded=true +# the following properties are only used if not using embedded to test +redis-server-host=localhost +redis-server-port=6379 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 7eff613..895222f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,3 +10,9 @@ include 'redisson_3.10.3' include 'redisson_3.15.2' include 'redisson_3.13.5' include 'redisson_3.16' +include 'redisson_3.16.4' +include 'redisson_3.16.7' +include 'redisson_3.16.8' +include 'redisson_3.17' +include 'redisson_3.17.2' +include 'redisson_3.17.6'