@Override public HystrixObservableCommand.Setter createObservableSetter(FilterInvoker invoker, SofaRequest request) { Method clientMethod = request.getMethod(); if (!OBSERVABLE_SETTER_CACHE.containsKey(clientMethod)) { synchronized (DefaultSetterFactory.class) { if (!OBSERVABLE_SETTER_CACHE.containsKey(clientMethod)) { String groupKey = invoker.getConfig().getInterfaceId(); String commandKey = request.getMethodName(); HystrixObservableCommand.Setter setter = HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); OBSERVABLE_SETTER_CACHE.put(clientMethod, setter); } } } return OBSERVABLE_SETTER_CACHE.get(clientMethod); } }
@Override public HystrixObservableCommand.Setter createObservableSetter(FilterInvoker invoker, SofaRequest request) { Method clientMethod = request.getMethod(); if (!OBSERVABLE_SETTER_CACHE.containsKey(clientMethod)) { synchronized (DefaultSetterFactory.class) { if (!OBSERVABLE_SETTER_CACHE.containsKey(clientMethod)) { String groupKey = invoker.getConfig().getInterfaceId(); String commandKey = request.getMethodName(); HystrixObservableCommand.Setter setter = HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); OBSERVABLE_SETTER_CACHE.put(clientMethod, setter); } } } return OBSERVABLE_SETTER_CACHE.get(clientMethod); } }
.andCommandKey(commandKey);
@Override protected BizkeeperCommand createBizkeeperCommand(Invocation invocation) { HystrixCommandProperties.Setter setter = HystrixCommandProperties.Setter() .withRequestCacheEnabled(true) .withRequestLogEnabled(false); setCommonProperties(invocation, setter); BizkeeperCommand command = new ConsumerBizkeeperCommand(groupname, invocation, HystrixObservableCommand.Setter .withGroupKey(CommandKey.toHystrixCommandGroupKey(groupname, invocation)) .andCommandKey(CommandKey.toHystrixCommandKey(groupname, invocation)) .andCommandPropertiesDefaults(setter)); return command; } }
@Override protected BizkeeperCommand createBizkeeperCommand(Invocation invocation) { HystrixCommandProperties.Setter setter = HystrixCommandProperties.Setter() .withRequestCacheEnabled(false) .withRequestLogEnabled(false); setCommonProperties(invocation, setter); BizkeeperCommand command = new ProviderBizkeeperCommand(groupname, invocation, HystrixObservableCommand.Setter .withGroupKey(CommandKey.toHystrixCommandGroupKey(groupname, invocation)) .andCommandKey(CommandKey.toHystrixCommandKey(groupname, invocation)) .andCommandPropertiesDefaults(setter)); return command; } }
@Override protected BizkeeperCommand createBizkeeperCommand(Invocation invocation) { HystrixCommandProperties.Setter setter = HystrixCommandProperties.Setter() .withRequestCacheEnabled(false) .withRequestLogEnabled(false); setCommonProperties(invocation, setter); BizkeeperCommand command = new ProviderBizkeeperCommand(groupname, invocation, HystrixObservableCommand.Setter .withGroupKey(CommandKey.toHystrixCommandGroupKey(groupname, invocation)) .andCommandKey(CommandKey.toHystrixCommandKey(groupname, invocation)) .andCommandPropertiesDefaults(setter)); return command; } }
protected TenacityObservableCommand(TenacityPropertyKey tenacityPropertyKey) { super(HystrixObservableCommand.Setter.withGroupKey(TenacityCommand.tenacityGroupKey()) .andCommandKey(tenacityPropertyKey)); }
protected TenacityObservableCommand(TenacityPropertyKey tenacityPropertyKey) { super(HystrixObservableCommand.Setter.withGroupKey(TenacityCommand.tenacityGroupKey()) .andCommandKey(tenacityPropertyKey)); }
@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
public HystrixObservableCommand.Setter buildObservableCommandSetter() { HystrixObservableCommand.Setter setter = HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); try { setter.andCommandPropertiesDefaults(HystrixPropertiesManager.initializeCommandProperties(commandProperties)); } catch (IllegalArgumentException e) { throw new HystrixPropertyException("Failed to set Command properties. " + getInfo(), e); } return setter; }
public HystrixBeanFaultTolerance(HystrixCommandKey commandKey, HystrixCommandGroupKey groupKey) { observableSettings = Setter.withGroupKey(groupKey) .andCommandKey(commandKey) .andCommandPropertiesDefaults( HystrixCommandProperties.Setter().withExecutionIsolationStrategy(ExecutionIsolationStrategy.SEMAPHORE)); commandSettings = com.netflix.hystrix.HystrixCommand.Setter.withGroupKey(groupKey) .andCommandKey(commandKey) .andCommandPropertiesDefaults( HystrixCommandProperties.Setter().withExecutionIsolationStrategy(ExecutionIsolationStrategy.THREAD)); }
@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
@Override public HystrixObservableCommand.Setter create(final RequestArguments request) { return withGroupKey(createGroupKey(request)) .andCommandKey(createCommandKey(request)); }
@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
.andCommandKey(commandKey) .andCommandPropertiesDefaults(propertiesSetter);
@Override protected BizkeeperCommand createBizkeeperCommand(Invocation invocation) { HystrixCommandProperties.Setter setter = HystrixCommandProperties.Setter() .withRequestCacheEnabled(true) .withRequestLogEnabled(false); setCommonProperties(invocation, setter); BizkeeperCommand command = new ConsumerBizkeeperCommand(groupname, invocation, HystrixObservableCommand.Setter .withGroupKey(CommandKey.toHystrixCommandGroupKey(groupname, invocation)) .andCommandKey(CommandKey.toHystrixCommandKey(groupname, invocation)) .andCommandPropertiesDefaults(setter)); return command; } }
@Override protected BizkeeperCommand createBizkeeperCommand(Invocation invocation) { HystrixCommandProperties.Setter setter = HystrixCommandProperties.Setter() .withRequestCacheEnabled(false) .withRequestLogEnabled(false); setCommonProperties(invocation, setter); BizkeeperCommand command = new ProviderBizkeeperCommand(groupname, invocation, HystrixObservableCommand.Setter .withGroupKey(CommandKey.toHystrixCommandGroupKey(groupname, invocation)) .andCommandKey(CommandKey.toHystrixCommandKey(groupname, invocation)) .andCommandPropertiesDefaults(setter)); return command; } }
public HystrixObservableCommand.Setter buildObservableCommandSetter() { HystrixObservableCommand.Setter setter = HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); try { setter.andCommandPropertiesDefaults(HystrixPropertiesManager.initializeCommandProperties(commandProperties)); } catch (IllegalArgumentException e) { throw new HystrixPropertyException("Failed to set Command properties. " + getInfo(), e); } return setter; }
protected AsynchronousObservableCommand() { super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("GROUP")) .andCommandKey(HystrixCommandKey.Factory.asKey("AsyncObservable")) .andCommandPropertiesDefaults(new HystrixCommandProperties.Setter().withExecutionIsolationSemaphoreMaxConcurrentRequests(1000)) ); }
protected SynchronousObservableCommand() { super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("GROUP")) .andCommandKey(HystrixCommandKey.Factory.asKey("SyncObservable")) .andCommandPropertiesDefaults(new HystrixCommandProperties.Setter().withExecutionIsolationSemaphoreMaxConcurrentRequests(1000)) ); }