Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Changes as per Design Review #338

Merged
merged 5 commits into from
Dec 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import com.netflix.hystrix.util.HystrixTimer;
import com.netflix.hystrix.util.HystrixTimer.TimerListener;

/* package */abstract class AbstractCommand<R> implements HystrixExecutableInfo<R>, HystrixObservable<R> {
/* package */abstract class AbstractCommand<R> implements HystrixInvokableInfo<R>, HystrixObservable<R> {
// TODO make this package private

private static final Logger logger = LoggerFactory.getLogger(AbstractCommand.class);
Expand Down Expand Up @@ -1146,7 +1146,7 @@ public AbstractCommand<R> getCommand() {
}

/**
* @return {@link HystrixCommandGroupKey} used to group together multiple {@link HystrixAsyncCommand} objects.
* @return {@link HystrixCommandGroupKey} used to group together multiple {@link HystrixFutureCommand} objects.
* <p>
* The {@link HystrixCommandGroupKey} is used to represent a common relationship between commands. For example, a library or team name, the system all related commands interace with,
* common business purpose etc.
Expand Down Expand Up @@ -1175,7 +1175,7 @@ public HystrixThreadPoolKey getThreadPoolKey() {
}

/**
* The {@link HystrixCommandMetrics} associated with this {@link HystrixAsyncCommand} instance.
* The {@link HystrixCommandMetrics} associated with this {@link HystrixFutureCommand} instance.
*
* @return HystrixCommandMetrics
*/
Expand All @@ -1184,7 +1184,7 @@ public HystrixCommandMetrics getMetrics() {
}

/**
* The {@link HystrixCommandProperties} associated with this {@link HystrixAsyncCommand} instance.
* The {@link HystrixCommandProperties} associated with this {@link HystrixFutureCommand} instance.
*
* @return HystrixCommandProperties
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*
* @ThreadSafe
*/
public abstract class HystrixCommand<R> extends AbstractCommand<R> implements HystrixExecutable<R>, HystrixExecutableInfo<R>, HystrixObservable<R> {
public abstract class HystrixCommand<R> extends AbstractCommand<R> implements HystrixExecutable<R>, HystrixInvokableInfo<R>, HystrixObservable<R> {

/**
* Construct a {@link HystrixCommand} with defined {@link HystrixCommandGroupKey}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.util.List;

public interface HystrixExecutableInfo<R> {
public interface HystrixInvokableInfo<R> {

public HystrixCommandGroupKey getCommandGroup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @ThreadSafe
*/
public abstract class HystrixObservableCommand<R> extends AbstractCommand<R> implements HystrixObservable<R>, HystrixExecutableInfo<R> {
public abstract class HystrixObservableCommand<R> extends AbstractCommand<R> implements HystrixObservable<R>, HystrixInvokableInfo<R> {

/**
* Construct a {@link HystrixObservableCommand} with defined {@link HystrixCommandGroupKey}.
Expand Down Expand Up @@ -205,7 +205,7 @@ private HystrixCommandProperties.Setter setDefaults(HystrixCommandProperties.Set
*
* @return R or UnsupportedOperationException if not implemented
*/
protected Observable<R> onFailureResumeWithFallback() {
protected Observable<R> resumeWithFallback() {
return Observable.error(new UnsupportedOperationException("No fallback available."));
}

Expand All @@ -216,6 +216,6 @@ final protected Observable<R> getExecutionObservable() {

@Override
final protected Observable<R> getFallbackObservable() {
return onFailureResumeWithFallback();
return resumeWithFallback();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void shutdown(HystrixRequestLog value) {
private LinkedBlockingQueue<HystrixCommand<?>> executedCommands = new LinkedBlockingQueue<HystrixCommand<?>>(MAX_STORAGE);

/**
* History of {@link HystrixExecutableInfo} executed in this request.
* History of {@link HystrixInvokableInfo} executed in this request.
*/
private LinkedBlockingQueue<HystrixExecutableInfo<?>> allExecutedCommands = new LinkedBlockingQueue<HystrixExecutableInfo<?>>(MAX_STORAGE);
private LinkedBlockingQueue<HystrixInvokableInfo<?>> allExecutedCommands = new LinkedBlockingQueue<HystrixInvokableInfo<?>>(MAX_STORAGE);

// prevent public instantiation
private HystrixRequestLog() {
Expand Down Expand Up @@ -112,7 +112,7 @@ public Collection<HystrixCommand<?>> getExecutedCommands() {
*
* @return {@code Collection<HystrixCommand<?>>}
*/
public Collection<HystrixExecutableInfo<?>> getAllExecutedCommands() {
public Collection<HystrixInvokableInfo<?>> getAllExecutedCommands() {
return Collections.unmodifiableCollection(allExecutedCommands);
}

Expand All @@ -122,7 +122,7 @@ public Collection<HystrixExecutableInfo<?>> getAllExecutedCommands() {
* @param command
* {@code HystrixCommand<?>}
*/
/* package */void addExecutedCommand(HystrixExecutableInfo<?> command) {
/* package */void addExecutedCommand(HystrixInvokableInfo<?> command) {
if (!allExecutedCommands.offer(command)) {
// see RequestLog: Reduce Chance of Memory Leak https://github.com/Netflix/Hystrix/issues/53
logger.warn("RequestLog ignoring command after reaching limit of " + MAX_STORAGE + ". See https://github.com/Netflix/Hystrix/issues/53 for more information.");
Expand Down Expand Up @@ -169,7 +169,7 @@ public String getExecutedCommandsAsString() {

StringBuilder builder = new StringBuilder();
int estimatedLength = 0;
for (HystrixExecutableInfo<?> command : allExecutedCommands) {
for (HystrixInvokableInfo<?> command : allExecutedCommands) {
builder.setLength(0);
builder.append(command.getCommandKey().name());

Expand Down
Loading