Fixes hystrix thread pool size issue
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/cf3f7abe Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/cf3f7abe Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/cf3f7abe Branch: refs/heads/two-dot-o-dev Commit: cf3f7abee29d4bee17313d00fe3abf863260e685 Parents: 7975e4f Author: Todd Nine <[email protected]> Authored: Fri Mar 27 16:08:32 2015 -0600 Committer: Todd Nine <[email protected]> Committed: Fri Mar 27 16:08:32 2015 -0600 ---------------------------------------------------------------------- .../collection/mvcc/stage/write/WriteUniqueVerify.java | 4 ++-- .../impl/shard/count/NodeShardApproximationImpl.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf3f7abe/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java index b984ad8..564d036 100644 --- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java +++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java @@ -218,6 +218,6 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>> */ public static final HystrixCommand.Setter REPLAY_GROUP = HystrixCommand.Setter.withGroupKey( - HystrixCommandGroupKey.Factory.asKey( "user" ) ).andThreadPoolPropertiesDefaults( - HystrixThreadPoolProperties.Setter().withCoreSize( 1000 ) ); + HystrixCommandGroupKey.Factory.asKey( "uniqueVerify" ) ).andThreadPoolPropertiesDefaults( + HystrixThreadPoolProperties.Setter().withCoreSize( 100 ) ); } http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cf3f7abe/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java index a47d528..fceb32c 100644 --- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java +++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java @@ -39,6 +39,7 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard; import com.netflix.astyanax.MutationBatch; import com.netflix.hystrix.HystrixCommand; import com.netflix.hystrix.HystrixCommandGroupKey; +import com.netflix.hystrix.HystrixThreadPoolProperties; import rx.functions.Action0; import rx.schedulers.Schedulers; @@ -75,6 +76,14 @@ public class NodeShardApproximationImpl implements NodeShardApproximation { private final FlushWorker worker; + /** + * Command group used for realtime user commands + */ + public static final HystrixCommand.Setter + COUNT_GROUP = HystrixCommand.Setter.withGroupKey( + HystrixCommandGroupKey.Factory.asKey( "BatchCounterRollup" ) ).andThreadPoolPropertiesDefaults( + HystrixThreadPoolProperties.Setter().withCoreSize( 100 ) ); + /** * Create a time shard approximation with the correct configuration. @@ -229,7 +238,7 @@ public class NodeShardApproximationImpl implements NodeShardApproximation { /** * Execute the command in hystrix to avoid slamming cassandra */ - new HystrixCommand( HystrixCommandGroupKey.Factory.asKey("BatchCounterRollup") ) { + new HystrixCommand( COUNT_GROUP ) { @Override protected Void run() throws Exception {
