private Text getPropertyMetadataColumnQualifierText( Property property, Metadata.Entry metadataItem) { final String propertyName = property.getName(); final String propertyKey = property.getKey(); final String visibilityString = property.getVisibility().getVisibilityString(); final String metadataKey = metadataItem.getKey(); //noinspection StringBufferReplaceableByString - for speed we use StringBuilder StringBuilder keyBuilder = new StringBuilder( propertyName.length() + propertyKey.length() + visibilityString.length() + metadataKey.length()); keyBuilder.append(getNameSubstitutionStrategy().deflate(propertyName)); keyBuilder.append(getNameSubstitutionStrategy().deflate(propertyKey)); keyBuilder.append(visibilityString); keyBuilder.append(getNameSubstitutionStrategy().deflate(metadataKey)); String key = keyBuilder.toString(); Text r = propertyMetadataColumnQualifierTextCache.peek(key); if (r == null) { r = KeyHelper.getColumnQualifierFromPropertyMetadataColumnQualifier( propertyName, propertyKey, visibilityString, metadataKey, getNameSubstitutionStrategy()); propertyMetadataColumnQualifierTextCache.put(key, r); } return r; }
@Override public void clear() { cache.clear(); }
@Override public void put(K key, V value) { cache.put(key, value); }
@Override public V get(K key) { return cache.peek(key); }