diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CacheWeights.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CacheWeights.java new file mode 100644 index 0000000..60552f2 --- /dev/null +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CacheWeights.java @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.jackrabbit.oak.segment; + +import static org.apache.jackrabbit.oak.commons.StringUtils.estimateMemoryUsage; + +import javax.annotation.Nonnull; + +import org.apache.jackrabbit.oak.segment.ReaderCache.CacheKey; + +import com.google.common.cache.Weigher; + +public class CacheWeights { + + public static final int OBJECT_HEADER_SIZE = 12; + + private static final int LIRS_CACHE_OVERHEAD = 168; + + private static final int RECORD_CACHE_OVERHEAD = 32; + + private static final int PRIORITY_CACHE_OVERHEAD = 96; + + private static final int SEGMENT_CACHE_OVERHEAD = 168; + + public static class OneWeigher implements Weigher { + + @Override + public int weigh(Object key, Object value) { + return 1; + } + } + + private static final Weigher NOOP_WEIGHER = new OneWeigher<>(); + + @SuppressWarnings("unchecked") + public static Weigher noopWeigher() { + return (Weigher) NOOP_WEIGHER; + } + + public static class SegmentCacheWeigher implements + Weigher { + @Override + public int weigh(@Nonnull SegmentId id, @Nonnull Segment segment) { + int size = SEGMENT_CACHE_OVERHEAD; + // segmentid weight estimation is included in segment + size += segment.estimateMemoryUsage(); + return size; + } + } + + public static class NodeCacheWeigher implements Weigher { + + @Override + public int weigh(String key, RecordId value) { + int size = PRIORITY_CACHE_OVERHEAD; + size += estimateMemoryUsage(key); + size += value.estimateMemoryUsage(); + return size; + } + } + + public static class StringCacheWeigher implements Weigher { + + @Override + public int weigh(String key, RecordId value) { + int size = RECORD_CACHE_OVERHEAD; + size += estimateMemoryUsage(key); + size += value.estimateMemoryUsage(); + return size; + } + } + + public static class TemplateCacheWeigher implements + Weigher { + + @Override + public int weigh(Template key, RecordId value) { + int size = RECORD_CACHE_OVERHEAD; + size += key.estimateMemoryUsage(); + size += value.estimateMemoryUsage(); + return size; + } + } + + public static class ReaderTemplateCacheWeigher implements + Weigher { + + @Override + public int weigh(CacheKey key, Template value) { + int size = LIRS_CACHE_OVERHEAD; + size += key.estimateMemoryUsage(); + size += value.estimateMemoryUsage(); + return size; + } + } + + public static class ReaderStringCacheWeigher implements + Weigher { + + @Override + public int weigh(CacheKey key, String value) { + int size = LIRS_CACHE_OVERHEAD; + size += key.estimateMemoryUsage(); + size += estimateMemoryUsage(value); + return size; + } + } + +} diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/PropertyTemplate.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/PropertyTemplate.java index 998c59c..da1a10e 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/PropertyTemplate.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/PropertyTemplate.java @@ -18,12 +18,14 @@ */ package org.apache.jackrabbit.oak.segment; -import javax.annotation.Nonnull; - import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; + +import javax.annotation.Nonnull; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Type; +import org.apache.jackrabbit.oak.commons.StringUtils; import com.google.common.collect.ComparisonChain; @@ -104,4 +106,8 @@ public class PropertyTemplate implements Comparable { return name + "(" + type + ")"; } + public int estimateMemoryUsage() { + return OBJECT_HEADER_SIZE + 16 + StringUtils.estimateMemoryUsage(name); + } + } \ No newline at end of file diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/ReaderCache.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/ReaderCache.java index 3dbe4d3..f33e765 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/ReaderCache.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/ReaderCache.java @@ -20,17 +20,18 @@ package org.apache.jackrabbit.oak.segment; import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; import java.util.Arrays; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import com.google.common.base.Function; -import com.google.common.cache.Weigher; import org.apache.jackrabbit.oak.cache.CacheLIRS; import org.apache.jackrabbit.oak.cache.CacheStats; -import org.apache.jackrabbit.oak.cache.EmpiricalWeigher; + +import com.google.common.base.Function; +import com.google.common.cache.Weigher; /** * A cache consisting of a fast and slow component. The fast cache for small items is based @@ -39,12 +40,7 @@ import org.apache.jackrabbit.oak.cache.EmpiricalWeigher; public abstract class ReaderCache { @Nonnull - private final Weigher, T> weigher = new Weigher, T>() { - @Override - public int weigh(CacheKey key, T value) { - return getEntryWeight(value); - } - }; + private final Weigher weigher; @Nonnull private final String name; @@ -59,7 +55,7 @@ public abstract class ReaderCache { * The slower (LIRS) cache. */ @Nonnull - private final CacheLIRS, T> cache; + private final CacheLIRS cache; /** * Create a new string cache. @@ -67,11 +63,14 @@ public abstract class ReaderCache { * @param maxWeight the maximum memory in bytes. * @param averageWeight an estimate for the average weight of the elements in the * cache. See {@link CacheLIRS#setAverageMemory(int)}. + * @param weigher Needed to provide an estimation of the cache weight in memory */ - protected ReaderCache(long maxWeight, int averageWeight, @Nonnull String name) { + protected ReaderCache(long maxWeight, int averageWeight, + @Nonnull String name, @Nonnull Weigher weigher) { this.name = checkNotNull(name); + this.weigher = checkNotNull(weigher); fastCache = new FastCache<>(); - cache = CacheLIRS., T>newBuilder() + cache = CacheLIRS.newBuilder() .module(name) .maximumWeight(maxWeight) .averageWeight(averageWeight) @@ -113,7 +112,7 @@ public abstract class ReaderCache { if (value != null) { return value; } - CacheKey key = new CacheKey<>(hash, msb, lsb, offset); + CacheKey key = new CacheKey(hash, msb, lsb, offset); value = cache.getIfPresent(key); if (value == null) { value = loader.apply(offset); @@ -137,12 +136,6 @@ public abstract class ReaderCache { } /** - * Estimation includes the key's overhead, see {@link EmpiricalWeigher} for - * an example - */ - protected abstract int getEntryWeight(T value); - - /** * Determine whether the entry is small, in which case it can be kept in the fast cache. */ protected abstract boolean isSmall(T value); @@ -192,7 +185,7 @@ public abstract class ReaderCache { } - private static class CacheKey { + static class CacheKey { private final int hash; private final long msb, lsb; private final int offset; @@ -217,7 +210,7 @@ public abstract class ReaderCache { if (!(other instanceof ReaderCache.CacheKey)) { return false; } - CacheKey o = (CacheKey) other; + CacheKey o = (CacheKey) other; return o.hash == hash && o.msb == msb && o.lsb == lsb && o.offset == offset; } @@ -229,6 +222,9 @@ public abstract class ReaderCache { '+' + Integer.toHexString(offset); } + public int estimateMemoryUsage() { + return OBJECT_HEADER_SIZE + 32; + } } private static class FastCacheEntry { diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCache.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCache.java index 60d5fd5..30c62a0 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCache.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCache.java @@ -19,6 +19,8 @@ package org.apache.jackrabbit.oak.segment; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.LinkedHashMap; import java.util.Map; @@ -27,6 +29,7 @@ import javax.annotation.Nonnull; import com.google.common.base.Supplier; import com.google.common.cache.CacheStats; +import com.google.common.cache.Weigher; /** * Partial mapping of keys of type {@code T} to values of type {@link RecordId}. This is @@ -56,9 +59,12 @@ public abstract class RecordCache { */ public abstract long size(); + public abstract long estimateCurrentWeight(); + /** * @return access statistics for this cache */ + @Nonnull public CacheStats getStats() { return new CacheStats(hitCount, missCount, loadCount, 0, 0, evictionCount); } @@ -76,11 +82,28 @@ public abstract class RecordCache { if (size <= 0) { return new Empty<>(); } else { - return new Default<>(size); + return new Default<>(size, CacheWeights. noopWeigher()); } } /** + * @param size size of the cache + * @param weigher Needed to provide an estimation of the cache weight in memory + * @return A factory returning {@code RecordCache} instances of the given {@code size} + * when invoked. + * @see #newRecordCache(int) + */ + @Nonnull + public static Supplier> factory(int size, @Nonnull Weigher weigher) { + if (size <= 0) { + return Empty.emptyFactory(); + } else { + return Default.defaultFactory(size, checkNotNull(weigher)); + } + } + + /** + * @param size size of the cache * @return A factory returning {@code RecordCache} instances of the given {@code size} * when invoked. * @see #newRecordCache(int) @@ -90,7 +113,7 @@ public abstract class RecordCache { if (size <= 0) { return Empty.emptyFactory(); } else { - return Default.defaultFactory(size); + return Default.defaultFactory(size, CacheWeights. noopWeigher()); } } @@ -117,27 +140,42 @@ public abstract class RecordCache { public long size() { return 0; } + + @Override + public long estimateCurrentWeight() { + return -1; + } } private static class Default extends RecordCache { + + @Nonnull private final Map records; - static final Supplier> defaultFactory(final int size) { + @Nonnull + private final Weigher weigher; + + private long weight = -1; + + static final Supplier> defaultFactory(final int size, @Nonnull final Weigher weigher) { return new Supplier>() { @Override public RecordCache get() { - return new Default<>(size); + return new Default<>(size, checkNotNull(weigher)); } }; } - Default(final int size) { + Default(final int size, @Nonnull final Weigher weigher) { + this.weigher = checkNotNull(weigher); records = new LinkedHashMap(size * 4 / 3, 0.75f, true) { @Override protected boolean removeEldestEntry(Map.Entry eldest) { boolean remove = super.size() > size; if (remove) { Default.super.evictionCount++; + weight -= weigher.weigh(eldest.getKey(), + eldest.getValue()); } return remove; } @@ -148,6 +186,9 @@ public abstract class RecordCache { public synchronized void put(@Nonnull T key, @Nonnull RecordId value) { super.loadCount++; records.put(key, value); + if (weigher != null) { + weight += weigher.weigh(key, value); + } } @Override @@ -165,5 +206,10 @@ public abstract class RecordCache { public synchronized long size() { return records.size(); } + + @Override + public long estimateCurrentWeight() { + return weight; + } } } diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCacheStats.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCacheStats.java index aa4914f..d42a4a5 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCacheStats.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordCacheStats.java @@ -47,14 +47,19 @@ public class RecordCacheStats extends AnnotatedStandardMBean implements CacheSta @Nonnull private final Supplier elementCount; + @Nonnull + private final Supplier weight; + private CacheStats lastSnapshot; - public RecordCacheStats( - @Nonnull String name, @Nonnull Supplier stats, @Nonnull Supplier elementCount) { + public RecordCacheStats(@Nonnull String name, + @Nonnull Supplier stats, + @Nonnull Supplier elementCount, @Nonnull Supplier weight) { super(CacheStatsMBean.class); this.name = checkNotNull(name); this.stats = checkNotNull(stats); this.elementCount = checkNotNull(elementCount); + this.weight = checkNotNull(weight); this.lastSnapshot = stats.get(); } @@ -145,7 +150,7 @@ public class RecordCacheStats extends AnnotatedStandardMBean implements CacheSta @Override public long estimateCurrentWeight() { - return -1; + return weight.get(); } @Override diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordId.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordId.java index f4b476a..ad42898 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordId.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/RecordId.java @@ -18,11 +18,9 @@ */ package org.apache.jackrabbit.oak.segment; -import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.Integer.parseInt; -import static org.apache.jackrabbit.oak.segment.Segment.RECORD_ALIGN_BITS; -import static org.apache.jackrabbit.oak.segment.Segment.RECORD_ID_BYTES; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; import java.util.UUID; import java.util.regex.Matcher; @@ -150,4 +148,8 @@ public final class RecordId implements Comparable { } } + public int estimateMemoryUsage() { + return OBJECT_HEADER_SIZE + 16 + segmentId.estimateMemoryUsage(); + } + } diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Segment.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Segment.java index c09d38b..5e75349 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Segment.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Segment.java @@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkPositionIndexes; import static com.google.common.base.Preconditions.checkState; import static java.util.Arrays.fill; import static org.apache.jackrabbit.oak.commons.IOUtils.closeQuietly; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; import static org.apache.jackrabbit.oak.segment.RecordNumbers.EMPTY_RECORD_NUMBERS; import static org.apache.jackrabbit.oak.segment.SegmentId.isDataSegmentId; import static org.apache.jackrabbit.oak.segment.SegmentVersion.LATEST_VERSION; @@ -44,15 +45,17 @@ import java.util.UUID; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import com.google.common.base.Charsets; -import com.google.common.collect.AbstractIterator; import org.apache.commons.io.HexDump; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Type; +import org.apache.jackrabbit.oak.commons.StringUtils; import org.apache.jackrabbit.oak.plugins.memory.PropertyStates; import org.apache.jackrabbit.oak.segment.RecordNumbers.Entry; +import com.google.common.base.Charsets; +import com.google.common.collect.AbstractIterator; + /** * A list of records. *

@@ -714,4 +717,28 @@ public class Segment { } } + /** + * Estimate of how much memory this instance would occupy in the segment + * cache. + */ + public int estimateMemoryUsage() { + int size = OBJECT_HEADER_SIZE + 76; + size += 56; // 7 refs x 8 bytes + + if (id.isDataSegmentId()) { + int recordNumberCount = getRecordNumberCount(); + size += 5 * recordNumberCount; + + int referencedSegmentIdCount = getReferencedSegmentIdCount(); + size += 8 * referencedSegmentIdCount; + + size += StringUtils.estimateMemoryUsage(info); + } + if (!data.isDirect()) { + // seems to overreport by 100+ bytes + size += size(); + } + size += id.estimateMemoryUsage(); + return size; + } } diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentCache.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentCache.java index ea78b2c..f954f35 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentCache.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentCache.java @@ -24,12 +24,14 @@ import java.util.concurrent.ExecutionException; import javax.annotation.Nonnull; +import org.apache.jackrabbit.oak.cache.CacheStats; +import org.apache.jackrabbit.oak.segment.CacheWeights.SegmentCacheWeigher; + import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalNotification; import com.google.common.cache.Weigher; -import org.apache.jackrabbit.oak.cache.CacheStats; /** * A cache for {@link Segment} instances by their {@link SegmentId}. @@ -47,12 +49,7 @@ import org.apache.jackrabbit.oak.cache.CacheStats; public class SegmentCache { public static final int DEFAULT_SEGMENT_CACHE_MB = 256; - private final Weigher weigher = new Weigher() { - @Override - public int weigh(@Nonnull SegmentId id, @Nonnull Segment segment) { - return 224 + segment.size(); - } - }; + private final Weigher weigher = new SegmentCacheWeigher(); private final long maximumWeight; diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentId.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentId.java index 899ee2a..b9affeb 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentId.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentId.java @@ -18,11 +18,14 @@ */ package org.apache.jackrabbit.oak.segment; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; + import java.util.UUID; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; +import org.apache.jackrabbit.oak.commons.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -252,4 +255,11 @@ public class SegmentId implements Comparable { return (int) lsb; } + public int estimateMemoryUsage() { + int size = OBJECT_HEADER_SIZE; + size += 48; // 6 fields x 8, ignoring 'gcInfo' + size += StringUtils.estimateMemoryUsage(gcInfo); + return size; + } + } diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/StringCache.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/StringCache.java index f3868c4..05a89ff 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/StringCache.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/StringCache.java @@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.segment; -import static org.apache.jackrabbit.oak.commons.StringUtils.estimateMemoryUsage; +import org.apache.jackrabbit.oak.segment.CacheWeights.ReaderStringCacheWeigher; public class StringCache extends ReaderCache { /** @@ -33,15 +33,7 @@ public class StringCache extends ReaderCache { * @param maxSize the maximum memory in bytes. */ StringCache(long maxSize) { - super(maxSize, 250, "String Cache"); - } - - @Override - protected int getEntryWeight(String string) { - int size = 168; // overhead for each cache entry - size += 40; // key - size += estimateMemoryUsage(string); // value - return size; + super(maxSize, 250, "String Cache", new ReaderStringCacheWeigher()); } @Override diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java index 2055f28..881841b 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java @@ -21,8 +21,10 @@ package org.apache.jackrabbit.oak.segment; import static com.google.common.base.Preconditions.checkElementIndex; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import static org.apache.jackrabbit.oak.api.Type.STRING; import static org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.MISSING_NODE; import static org.apache.jackrabbit.oak.segment.Segment.RECORD_ID_BYTES; +import static org.apache.jackrabbit.oak.segment.CacheWeights.OBJECT_HEADER_SIZE; import java.util.Arrays; import java.util.Collections; @@ -36,6 +38,7 @@ import com.google.common.base.Objects; import com.google.common.collect.Lists; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.api.Type; +import org.apache.jackrabbit.oak.commons.StringUtils; import org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry; import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry; import org.apache.jackrabbit.oak.spi.state.NodeState; @@ -347,4 +350,29 @@ public class Template { } } + public int estimateMemoryUsage() { + int size = OBJECT_HEADER_SIZE; + size += 48; + size += StringUtils.estimateMemoryUsage(childName); + size += estimateMemoryUsage(mixinTypes); + size += estimateMemoryUsage(primaryType); + for (PropertyTemplate property : properties) { + size += property.estimateMemoryUsage(); + } + return size; + } + + private static int estimateMemoryUsage(PropertyState propertyState) { + if (propertyState == null) { + return 0; + } + int size = OBJECT_HEADER_SIZE; + size += StringUtils.estimateMemoryUsage(propertyState.getName()); + for (int k = 0; k < propertyState.count(); k++) { + String s = propertyState.getValue(STRING, k); + size += StringUtils.estimateMemoryUsage(s); + } + return size; + } + } diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/TemplateCache.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/TemplateCache.java index 8b45545..e3133fe 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/TemplateCache.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/TemplateCache.java @@ -19,10 +19,8 @@ package org.apache.jackrabbit.oak.segment; -import static org.apache.jackrabbit.oak.api.Type.STRING; - import org.apache.jackrabbit.oak.api.PropertyState; -import org.apache.jackrabbit.oak.commons.StringUtils; +import org.apache.jackrabbit.oak.segment.CacheWeights.ReaderTemplateCacheWeigher; public class TemplateCache extends ReaderCache