diff --git a/server/src/main/java/io/druid/client/BatchServerInventoryView.java b/server/src/main/java/io/druid/client/BatchServerInventoryView.java index a4bcb5c591c2..d868416bf8c6 100644 --- a/server/src/main/java/io/druid/client/BatchServerInventoryView.java +++ b/server/src/main/java/io/druid/client/BatchServerInventoryView.java @@ -25,10 +25,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import com.google.common.collect.FluentIterable; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Interner; -import com.google.common.collect.Interners; import com.google.common.collect.Iterables; import com.google.common.collect.MapMaker; import com.google.common.collect.Sets; @@ -52,7 +48,6 @@ public class BatchServerInventoryView extends ServerInventoryView> implements FilteredServerInventoryView { - private static final Interner DATA_SEGMENT_INTERNER = Interners.newWeakInterner(); private static final EmittingLogger log = new EmittingLogger(BatchServerInventoryView.class); final private ConcurrentMap> zNodes = new MapMaker().makeMap(); @@ -193,17 +188,4 @@ protected void segmentCallbackRemoved(SegmentCallback callback) { segmentPredicates.remove(callback); } - - @Override - protected Set internInventory(Set sample) - { - return ImmutableSet.copyOf(FluentIterable.from(sample).transform(new Function() - { - @Override - public DataSegment apply(DataSegment input) - { - return DATA_SEGMENT_INTERNER.intern(input); - } - })); - } } diff --git a/server/src/main/java/io/druid/client/ServerInventoryView.java b/server/src/main/java/io/druid/client/ServerInventoryView.java index ad7fa2fd1109..9aa32e28d763 100644 --- a/server/src/main/java/io/druid/client/ServerInventoryView.java +++ b/server/src/main/java/io/druid/client/ServerInventoryView.java @@ -19,6 +19,7 @@ package io.druid.client; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Charsets; @@ -100,7 +101,7 @@ public DruidServer deserializeContainer(byte[] bytes) public InventoryType deserializeInventory(byte[] bytes) { try { - return internInventory(jsonMapper.readValue(bytes, typeReference)); + return jsonMapper.readValue(bytes, typeReference); } catch (IOException e) { CharBuffer.wrap(StringUtils.fromUtf8(bytes).toCharArray()); @@ -193,15 +194,6 @@ public void stop() throws IOException } } - /** - * Optionally override to allow interning the inventory - * @param sample The inventory to intern - * @return An interned instance equal to sample - */ - protected InventoryType internInventory(InventoryType sample) { - return sample; - } - public boolean isStarted() { return started.get(); diff --git a/server/src/main/java/io/druid/client/SingleServerInventoryView.java b/server/src/main/java/io/druid/client/SingleServerInventoryView.java index d301bac12d3f..929644e0fadc 100644 --- a/server/src/main/java/io/druid/client/SingleServerInventoryView.java +++ b/server/src/main/java/io/druid/client/SingleServerInventoryView.java @@ -24,8 +24,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import com.google.common.collect.Interner; -import com.google.common.collect.Interners; import com.google.common.collect.MapMaker; import com.google.inject.Inject; import com.metamx.common.Pair; @@ -45,7 +43,6 @@ public class SingleServerInventoryView extends ServerInventoryView implements FilteredServerInventoryView { private static final EmittingLogger log = new EmittingLogger(SingleServerInventoryView.class); - private static final Interner DATA_SEGMENT_INTERNER = Interners.newWeakInterner(); final private ConcurrentMap>> segmentPredicates = new MapMaker() .makeMap(); @@ -167,9 +164,4 @@ public CallbackAction segmentViewInitialized() } } - @Override - protected DataSegment internInventory(DataSegment sample) - { - return DATA_SEGMENT_INTERNER.intern(sample); - } }