Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #254 from benjchristensen/remove-jsr305-dependency

Remove jsr305 Dependency
  • Loading branch information...
commit a3724bc953f99fe2034cca892d2a7e336467354a 2 parents 2972125 + 00d8ecb
@benjchristensen benjchristensen authored
Showing with 35 additions and 51 deletions.
  1. +2 −1  hystrix-core/build.gradle
  2. +2 −4 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCircuitBreaker.java
  3. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapser.java
  4. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java
  5. +4 −5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java
  6. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java
  7. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixObservableCollapser.java
  8. +4 −5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixObservableCommand.java
  9. +1 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPool.java
  10. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java
  11. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapser.java
  12. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapserFactory.java
  13. +3 −6 hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixRequestVariableDefault.java
  14. +2 −3 hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingNumber.java
  15. +3 −3 hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java
View
3  hystrix-core/build.gradle
@@ -6,7 +6,6 @@ dependencies {
compile 'com.netflix.archaius:archaius-core:0.4.1'
compile 'com.netflix.rxjava:rxjava-core:0.18.1'
compile 'org.slf4j:slf4j-api:1.7.0'
- compile 'com.google.code.findbugs:jsr305:2.0.0'
testCompile 'junit:junit-dep:4.10'
}
@@ -25,6 +24,8 @@ javadoc {
options.addStringOption('top').value = '<a href="https://github.com/Netflix/Hystrix"><img width="92" height="79" border="0" align="left" src="http://netflix.github.com/Hystrix/images/hystrix-logo-small.png"></a><h2 class="title" style="padding-top:40px">Hystrix: Latency and Fault Tolerance for Distributed Systems</h2>'
}
+// skip if not on Java 6 (every JDK changes Javadoc behavior)
+javadoc.onlyIf { JavaVersion.current().java6 }
eclipse {
classpath {
View
6 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCircuitBreaker.java
@@ -19,8 +19,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
-import javax.annotation.concurrent.ThreadSafe;
-
import com.netflix.hystrix.HystrixCommandMetrics.HealthCounts;
/**
@@ -53,8 +51,8 @@
/**
* @ExcludeFromJavadoc
+ * @ThreadSafe
*/
- @ThreadSafe
public static class Factory {
// String is HystrixCommandKey.name() (we can't use HystrixCommandKey directly as we can't guarantee it implements hashcode/equals correctly)
private static ConcurrentHashMap<String, HystrixCircuitBreaker> circuitBreakersByCommand = new ConcurrentHashMap<String, HystrixCircuitBreaker>();
@@ -120,8 +118,8 @@ public static HystrixCircuitBreaker getInstance(HystrixCommandKey key) {
* The default production implementation of {@link HystrixCircuitBreaker}.
*
* @ExcludeFromJavadoc
+ * @ThreadSafe
*/
- @ThreadSafe
/* package */static class HystrixCircuitBreakerImpl implements HystrixCircuitBreaker {
private final HystrixCommandProperties properties;
private final HystrixCommandMetrics metrics;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapser.java
@@ -20,8 +20,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
-import javax.annotation.concurrent.NotThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -504,8 +502,9 @@ private static String getDefaultNameFromClass(@SuppressWarnings("rawtypes") Clas
* Setter.withCollapserKey(HystrixCollapserKey.Factory.asKey("CollapserName"))
.andScope(Scope.REQUEST);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private final HystrixCollapserKey collapserKey;
private Scope scope = Scope.REQUEST; // default if nothing is set
View
5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCollapserProperties.java
@@ -17,8 +17,6 @@
import static com.netflix.hystrix.strategy.properties.HystrixProperty.Factory.*;
-import javax.annotation.concurrent.NotThreadSafe;
-
import com.netflix.hystrix.strategy.properties.HystrixPropertiesChainedArchaiusProperty;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy;
import com.netflix.hystrix.strategy.properties.HystrixProperty;
@@ -118,8 +116,9 @@ public static Setter Setter() {
* .setMaxRequestsInBatch(100)
* .setTimerDelayInMilliseconds(10);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private Boolean collapsingEnabled = null;
private Integer maxRequestsInBatch = null;
View
9 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java
@@ -18,9 +18,6 @@
import java.util.List;
import java.util.concurrent.Future;
-import javax.annotation.concurrent.NotThreadSafe;
-import javax.annotation.concurrent.ThreadSafe;
-
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Scheduler;
@@ -42,8 +39,9 @@
*
* @param <R>
* the return type
+ *
+ * @ThreadSafe
*/
-@ThreadSafe
public abstract class HystrixCommand<R> implements HystrixExecutable<R>, HystrixExecutableInfo<R> {
private final HystrixCommandFromObservableCommand<R> observableCommand;
@@ -120,8 +118,9 @@ protected HystrixCommand(Setter setter) {
.andCommandKey(HystrixCommandKey.Factory.asKey("CommandName"))
.andEventNotifier(notifier);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
protected final HystrixCommandGroupKey groupKey;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandProperties.java
@@ -19,8 +19,6 @@
import java.util.concurrent.Future;
-import javax.annotation.concurrent.NotThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -469,8 +467,9 @@ public static Setter Setter() {
* .setExecutionTimeoutInMilliseconds(100)
* .setExecuteCommandOnSeparateThread(true);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private Boolean circuitBreakerEnabled = null;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixObservableCollapser.java
@@ -20,8 +20,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
-import javax.annotation.concurrent.NotThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -474,8 +472,9 @@ private static String getDefaultNameFromClass(@SuppressWarnings("rawtypes") Clas
* Setter.withCollapserKey(HystrixCollapserKey.Factory.asKey("CollapserName"))
.andScope(Scope.REQUEST);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private final HystrixCollapserKey collapserKey;
private Scope scope = Scope.REQUEST; // default if nothing is set
View
9 hystrix-core/src/main/java/com/netflix/hystrix/HystrixObservableCommand.java
@@ -21,9 +21,6 @@
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.concurrent.NotThreadSafe;
-import javax.annotation.concurrent.ThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,8 +55,9 @@
*
* @param <R>
* the return type
+ *
+ * @ThreadSafe
*/
-@ThreadSafe
public abstract class HystrixObservableCommand<R> extends HystrixExecutableBase<R> implements HystrixExecutable<R>, HystrixExecutableInfo<R> {
private static final Logger logger = LoggerFactory.getLogger(HystrixObservableCommand.class);
@@ -123,8 +121,9 @@ protected HystrixObservableCommand(Setter setter) {
.andCommandKey(HystrixCommandKey.Factory.asKey("CommandName"))
.andEventNotifier(notifier);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
protected final HystrixCommandGroupKey groupKey;
View
4 hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPool.java
@@ -20,8 +20,6 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import javax.annotation.concurrent.ThreadSafe;
-
import rx.Scheduler;
import com.netflix.hystrix.strategy.HystrixPlugins;
@@ -157,8 +155,8 @@
/**
* @ExcludeFromJavadoc
+ * @ThreadSafe
*/
- @ThreadSafe
/* package */static class HystrixThreadPoolDefault implements HystrixThreadPool {
private final HystrixThreadPoolProperties properties;
private final BlockingQueue<Runnable> queue;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolProperties.java
@@ -21,8 +21,6 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import javax.annotation.concurrent.NotThreadSafe;
-
import com.netflix.hystrix.strategy.concurrency.HystrixConcurrencyStrategy;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesChainedArchaiusProperty;
import com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy;
@@ -166,8 +164,9 @@ public static Setter Setter() {
* .setCoreSize(10)
* .setQueueSizeRejectionThreshold(10);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private Integer coreSize = null;
private Integer keepAliveTimeMinutes = null;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapser.java
@@ -5,8 +5,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.concurrent.ThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -24,8 +22,9 @@
* Instances of this are retrieved from the RequestCollapserFactory.
*
* Must be thread-safe since it exists within a RequestVariable which is request-scoped and can be accessed from multiple threads.
+ *
+ * @ThreadSafe
*/
-@ThreadSafe
public class RequestCollapser<BatchReturnType, ResponseType, RequestArgumentType> {
static final Logger logger = LoggerFactory.getLogger(HystrixCollapser.class);
View
5 hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapserFactory.java
@@ -2,8 +2,6 @@
import java.util.concurrent.ConcurrentHashMap;
-import javax.annotation.concurrent.NotThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -215,8 +213,9 @@ public void shutdown(RequestCollapser<BatchReturnType, ResponseType, RequestArgu
* Setter.withCollapserKey(HystrixCollapserKey.Factory.asKey("CollapserName"))
.andScope(Scope.REQUEST);
* } </pre>
+ *
+ * @NotThreadSafe
*/
- @NotThreadSafe
public static class Setter {
private final HystrixCollapserKey collapserKey;
private Scope scope = Scopes.REQUEST; // default if nothing is set
View
9 hystrix-core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixRequestVariableDefault.java
@@ -17,9 +17,6 @@
import java.util.concurrent.ConcurrentHashMap;
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.ThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,8 +52,8 @@
* Example 2: {@code HystrixRequestVariable<PojoThatIsThreadSafe>}
*
* @ExcludeFromJavadoc
+ * @ThreadSafe
*/
-@ThreadSafe
public class HystrixRequestVariableDefault<T> implements HystrixRequestVariable<T> {
static final Logger logger = LoggerFactory.getLogger(HystrixRequestVariableDefault.class);
@@ -188,14 +185,14 @@ public void shutdown(T value) {
* @param <T>
*/
/* package */static final class LazyInitializer<T> {
- @GuardedBy("synchronization on get() or construction")
+ // @GuardedBy("synchronization on get() or construction")
private T value;
/*
* Boolean to ensure only-once initialValue() execution instead of using
* a null check in case initialValue() returns null
*/
- @GuardedBy("synchronization on get() or construction")
+ // @GuardedBy("synchronization on get() or construction")
private boolean initialized = false;
private final HystrixRequestVariableDefault<T> rv;
View
5 hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingNumber.java
@@ -23,8 +23,6 @@
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.concurrent.locks.ReentrantLock;
-import javax.annotation.concurrent.ThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,8 +43,9 @@
* ensure the sum is up-to-date when the read can easily iterate each bucket to get the sum when it needs it.
* <p>
* See UnitTest for usage and expected behavior examples.
+ *
+ * @ThreadSafe
*/
-@ThreadSafe
public class HystrixRollingNumber {
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(HystrixRollingNumber.class);
View
6 hystrix-core/src/main/java/com/netflix/hystrix/util/HystrixRollingPercentile.java
@@ -25,8 +25,6 @@
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.concurrent.locks.ReentrantLock;
-import javax.annotation.concurrent.NotThreadSafe;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -313,7 +311,9 @@ public int length() {
}
- @NotThreadSafe
+ /**
+ * @NotThreadSafe
+ */
/* package for testing */ static class PercentileSnapshot {
private final int[] data;
private final int length;
Please sign in to comment.
Something went wrong with that request. Please try again.