public ObjectObjectPersistentMultiMaplet(final File file, final KeyDescriptor<K> keyExternalizer, final DataExternalizer<V> valueExternalizer, final CollectionFactory<V> collectionFactory) throws IOException { myValueExternalizer = valueExternalizer; myMap = new PersistentHashMap<K, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory)); myCache = new SLRUCache<K, Collection>(CACHE_SIZE, CACHE_SIZE, keyExternalizer) { @NotNull @Override public Collection createValue(K key) { try { final Collection<V> collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new BuildDataCorruptedException(e); } } }; }
public IntIntPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer) throws IOException { myMap = new PersistentHashMap<Integer, TIntHashSet>(file, keyExternalizer, new IntSetExternalizer()); myCache = new SLRUCache<Integer, TIntHashSet>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public TIntHashSet createValue(Integer key) { try { final TIntHashSet collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new BuildDataCorruptedException(e); } } }; }
public IntObjectPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer, final DataExternalizer<V> valueExternalizer, final CollectionFactory<V> collectionFactory) throws IOException { myValueExternalizer = valueExternalizer; myMap = new PersistentHashMap<Integer, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory)); myCache = new SLRUCache<Integer, Collection>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public Collection createValue(Integer key) { try { final Collection<V> collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new BuildDataCorruptedException(e); } } }; }
public ObjectObjectPersistentMultiMaplet(final File file, final KeyDescriptor<K> keyExternalizer, final DataExternalizer<V> valueExternalizer, final CollectionFactory<V> collectionFactory) throws IOException { myValueExternalizer = valueExternalizer; myMap = new PersistentHashMap<K, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory)); myCache = new SLRUCache<K, Collection>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public Collection createValue(K key) { try { final Collection<V> collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new RuntimeException(e); } } }; }
public IntIntPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer) throws IOException { myMap = new PersistentHashMap<Integer, TIntHashSet>(file, keyExternalizer, new IntSetExternalizer()); myCache = new SLRUCache<Integer, TIntHashSet>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public TIntHashSet createValue(Integer key) { try { final TIntHashSet collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new RuntimeException(e); } } }; }
public IntObjectPersistentMultiMaplet(final File file, final KeyDescriptor<Integer> keyExternalizer, final DataExternalizer<V> valueExternalizer, final CollectionFactory<V> collectionFactory) throws IOException { myValueExternalizer = valueExternalizer; myMap = new PersistentHashMap<Integer, Collection<V>>(file, keyExternalizer, new CollectionDataExternalizer<V>(valueExternalizer, collectionFactory)); myCache = new SLRUCache<Integer, Collection>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public Collection createValue(Integer key) { try { final Collection<V> collection = myMap.get(key); return collection == null? NULL_COLLECTION : collection; } catch (IOException e) { throw new RuntimeException(e); } } }; }
@NotNull @Override public KeyDescriptor<ConfigIndexKey> getKeyDescriptor() { return new KeyDescriptor<ConfigIndexKey>() { @Override public int getHashCode(ConfigIndexKey configKey) { return configKey.hashCode(); } @Override public boolean isEqual(ConfigIndexKey val1, ConfigIndexKey val2) { return val1.equals(val2); } @Override public void save(@NotNull DataOutput out, ConfigIndexKey value) throws IOException { out.writeUTF(StringUtil.notNullize(value.getDirectoryName())); out.writeUTF(StringUtil.notNullize(value.getConfigKey())); } @Override public ConfigIndexKey read(@NotNull DataInput in) throws IOException { return new ConfigIndexKey(in.readUTF(), in.readUTF()); } }; }
public ClassFilesIndexStorageBase(final File indexDir, final KeyDescriptor<K> keyDescriptor, final DataExternalizer<V> valueExternalizer) throws IOException { myIndexFile = getIndexFile(indexDir); myKeyDescriptor = keyDescriptor; myValueExternalizer = valueExternalizer; initialize(); }
public ClassFilesIndexStorageWriter(final File indexDir, final KeyDescriptor<K> keyDescriptor, final DataExternalizer<V> valueExternalizer, final Mappings mappings) throws IOException { super(indexDir, keyDescriptor, valueExternalizer); myMappings = mappings; }
public SmallMapSerializer(final File file, final KeyDescriptor<K> keyDescriptor, final DataExternalizer<V> valueExternalizer) { myFile = file; myKeyDescriptor = keyDescriptor; myValueExternalizer = valueExternalizer; myMap = new HashMap<KeyWrapper<K>, V>(); init(); }
ValueContainerMap(@NotNull final File file, @NotNull KeyDescriptor<Key> keyKeyDescriptor, @NotNull DataExternalizer<Value> valueExternalizer, boolean keyIsUniqueForIndexedFile ) throws IOException { super(file, keyKeyDescriptor, new ValueContainerExternalizer<Value>(valueExternalizer)); myValueExternalizer = valueExternalizer; myKeyIsUniqueForIndexedFile = keyIsUniqueForIndexedFile; }
public IntIntPersistentMaplet(final File file, final KeyDescriptor<Integer> k) { try { myMap = new PersistentHashMap<Integer, Integer>(file, k, new DataExternalizer<Integer>() { @Override public void save(DataOutput out, Integer value) throws IOException { out.writeInt(value); } @Override public Integer read(DataInput in) throws IOException { return in.readInt(); } }); myCache = new SLRUCache<Integer, Object>(CACHE_SIZE, CACHE_SIZE) { @NotNull @Override public Object createValue(Integer key) { try { final Integer v1 = myMap.get(key); return v1 == null? NULL_OBJ : v1; } catch (IOException e) { throw new RuntimeException(e); } } }; } catch (IOException e) { throw new RuntimeException(e); } }
public static DataExternalizer<CallingLocation> createDataExternalizer() { final KeyDescriptor<MethodIncompleteSignature> methodIncompleteSignatureKeyDescriptor = MethodIncompleteSignature.createKeyDescriptor(); return new DataExternalizer<CallingLocation>() { @Override public void save(final DataOutput out, final CallingLocation value) throws IOException { methodIncompleteSignatureKeyDescriptor.save(out, value.getMethodIncompleteSignature()); VariableType.KEY_DESCRIPTOR.save(out, value.getVariableType()); } @Override public CallingLocation read(final DataInput in) throws IOException { return new CallingLocation(methodIncompleteSignatureKeyDescriptor.read(in), VariableType.KEY_DESCRIPTOR.read(in)); } }; }
public CachedPersistentHashMap(File file, KeyDescriptor<Key> keyDescriptor, DataExternalizer<Value> valDescriptor, final int cacheSize) throws IOException { super(file, keyDescriptor, valDescriptor); myCache = new SLRUMap<Key,Value>(cacheSize * 2, cacheSize) { protected void onDropFromCache(Key key, Value value) { if (isValueDirty(value)) { try { CachedPersistentHashMap.super.put(key, value); } catch (IOException e) { LOG.info(e); } } } }; }
public MapIndexStorage(@NotNull File storageFile, @NotNull KeyDescriptor<Key> keyDescriptor, @NotNull DataExternalizer<Value> valueExternalizer, final int cacheSize ) throws IOException { this(storageFile, keyDescriptor, valueExternalizer, cacheSize, false); }
public MapIndexStorage(@NotNull File storageFile, @NotNull KeyDescriptor<Key> keyDescriptor, @NotNull DataExternalizer<Value> valueExternalizer, final int cacheSize, boolean highKeySelectivity) throws IOException { myStorageFile = storageFile; myKeyDescriptor = keyDescriptor; myCacheSize = cacheSize; myDataExternalizer = valueExternalizer; myHighKeySelectivity = highKeySelectivity; initMapAndCache(); }
ValueContainerMap(@Nonnull final File file, @Nonnull KeyDescriptor<Key> keyKeyDescriptor, @Nonnull DataExternalizer<Value> valueExternalizer, boolean keyIsUniqueForIndexedFile ) throws IOException { super(file, keyKeyDescriptor, new ValueContainerExternalizer<Value>(valueExternalizer)); myValueExternalizer = valueExternalizer; myKeyIsUniqueForIndexedFile = keyIsUniqueForIndexedFile; }
public <K> void serializeIndexValue(DataOutput out, StubIndexKey<K, ?> stubIndexKey, Map<K, StubIdList> map) throws IOException { MyIndex<K> index = (MyIndex<K>)getAsyncState().myIndices.get(stubIndexKey); KeyDescriptor<K> keyDescriptor = index.getExtension().getKeyDescriptor(); DataInputOutputUtil.writeINT(out, map.size()); for(K key:map.keySet()) { keyDescriptor.save(out, key); StubIdExternalizer.INSTANCE.save(out, map.get(key)); } }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return this.descriptor; }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return new EnumeratorStringDescriptor(); }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return EnumeratorStringDescriptor.INSTANCE; }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return myKeyDescriptor; }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return this.myKeyDescriptor; }
@NotNull @Override public KeyDescriptor<String> getKeyDescriptor() { return keyDescriptor; }