fix injection problems with server select strategies

This commit is contained in:
fjy 2014-05-07 10:13:05 -07:00
parent dcab7efa1b
commit e7da1bb9ce
3 changed files with 13 additions and 10 deletions

View File

@ -1,8 +1,9 @@
package io.druid.client.selector; package io.druid.client.selector;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.api.client.util.Maps; import com.google.api.client.util.Maps;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.inject.Inject;
import java.util.Comparator; import java.util.Comparator;
import java.util.Map; import java.util.Map;
@ -13,10 +14,10 @@ public class CustomTierSelectorStrategy extends AbstractTierSelectorStrategy
{ {
private final Comparator<Integer> comparator; private final Comparator<Integer> comparator;
@Inject @JsonCreator
public CustomTierSelectorStrategy( public CustomTierSelectorStrategy(
ServerSelectorStrategy serverSelectorStrategy, @JacksonInject ServerSelectorStrategy serverSelectorStrategy,
CustomTierSelectorStrategyConfig config @JacksonInject CustomTierSelectorStrategyConfig config
) )
{ {
super(serverSelectorStrategy); super(serverSelectorStrategy);

View File

@ -19,8 +19,9 @@
package io.druid.client.selector; package io.druid.client.selector;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.inject.Inject;
import java.util.Comparator; import java.util.Comparator;
@ -37,8 +38,8 @@ public class HighestPriorityTierSelectorStrategy extends AbstractTierSelectorStr
} }
}; };
@Inject @JsonCreator
public HighestPriorityTierSelectorStrategy(ServerSelectorStrategy serverSelectorStrategy) public HighestPriorityTierSelectorStrategy(@JacksonInject ServerSelectorStrategy serverSelectorStrategy)
{ {
super(serverSelectorStrategy); super(serverSelectorStrategy);
} }

View File

@ -19,8 +19,9 @@
package io.druid.client.selector; package io.druid.client.selector;
import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.inject.Inject;
import java.util.Comparator; import java.util.Comparator;
@ -37,8 +38,8 @@ public class LowestPriorityTierSelectorStrategy extends AbstractTierSelectorStra
} }
}; };
@Inject @JsonCreator
public LowestPriorityTierSelectorStrategy(ServerSelectorStrategy serverSelectorStrategy) public LowestPriorityTierSelectorStrategy(@JacksonInject ServerSelectorStrategy serverSelectorStrategy)
{ {
super(serverSelectorStrategy); super(serverSelectorStrategy);
} }