public PinnableSegment<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new EhcacheSegment<>(tableSource, storageEngine, tableSize, evictionAdvisor, evictionListener); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } }
public PinnableSegment<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new EhcacheSegment<>(tableSource, storageEngine, tableSize, evictionAdvisor, evictionListener); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } }
public void destroy() { removedSlots = 0; size = 0; freeTable(hashTablePage); for (Iterator<PendingPage> it = pendingTableFrees.values(); it.hasNext(); freeTable(it.next().tablePage)); hashTablePage = null; hashtable = DESTROYED_TABLE; storageEngine.destroy(); }
public void destroy() { removedSlots = 0; size = 0; freeTable(hashTablePage); for (Iterator<PendingPage> it = pendingTableFrees.values(); it.hasNext(); freeTable(it.next().tablePage)); hashTablePage = null; hashtable = DESTROYED_TABLE; storageEngine.destroy(); }
/** * Creates a new {@code ReadWriteLockedOffHeapHashMap} for use in a * segmented map. * * @return a new {@code ReadWriteLockedOffHeapHashMap} */ @Override public ReadWriteLockedOffHeapHashMap<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new ReadWriteLockedOffHeapHashMap<>(tableSource, tableAllocationsSteal, storageEngine, tableSize); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code WriteLockedOffHeapHashMap} for use in a * segmented map. * * @return a new {@code WriteLockedOffHeapHashMap} */ @Override public WriteLockedOffHeapHashMap<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new WriteLockedOffHeapHashMap<>(tableSource, storageEngine, tableSize); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code WriteLockedOffHeapHashMap} for use in a * segmented map. * * @return a new {@code WriteLockedOffHeapHashMap} */ @Override public WriteLockedOffHeapHashMap<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new WriteLockedOffHeapHashMap<>(tableSource, storageEngine, tableSize); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code ReadWriteLockedOffHeapHashMap} for use in a * segmented map. * * @return a new {@code ReadWriteLockedOffHeapHashMap} */ @Override public ReadWriteLockedOffHeapHashMap<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { return new ReadWriteLockedOffHeapHashMap<>(tableSource, tableAllocationsSteal, storageEngine, tableSize); } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code ReadWriteLockedOffHeapClockCache} for use in a * segmented cache. * * @return a new {@code ReadWriteLockedOffHeapClockCache} */ @Override public ReadWriteLockedOffHeapClockCache<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { if (evictionListener == null) { return new ReadWriteLockedOffHeapClockCache<>(tableSource, storageEngine, tableSize); } else { return new EvictionListeningReadWriteLockedOffHeapClockCache<>(evictionListener, tableSource, storageEngine, tableSize); } } catch (RuntimeException e) { storageEngine.destroy(); throw e; } }
/** * Creates a new {@code WriteLockedOffHeapClockCache} for use in a * segmented cache. * * @return a new {@code WriteLockedOffHeapClockCache} */ @Override public WriteLockedOffHeapClockCache<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { if (evictionListener == null) { return new WriteLockedOffHeapClockCache<>(tableSource, storageEngine, tableSize); } else { return new EvictionListeningWriteLockedOffHeapClockCache<>(evictionListener, tableSource, storageEngine, tableSize); } } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code WriteLockedOffHeapClockCache} for use in a * segmented cache. * * @return a new {@code WriteLockedOffHeapClockCache} */ @Override public WriteLockedOffHeapClockCache<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { if (evictionListener == null) { return new WriteLockedOffHeapClockCache<>(tableSource, storageEngine, tableSize); } else { return new EvictionListeningWriteLockedOffHeapClockCache<>(evictionListener, tableSource, storageEngine, tableSize); } } catch (RuntimeException e) { storageEngine.destroy(); throw e; } } }
/** * Creates a new {@code ReadWriteLockedOffHeapClockCache} for use in a * segmented cache. * * @return a new {@code ReadWriteLockedOffHeapClockCache} */ @Override public ReadWriteLockedOffHeapClockCache<K, V> newInstance() { StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance(); try { if (evictionListener == null) { return new ReadWriteLockedOffHeapClockCache<>(tableSource, storageEngine, tableSize); } else { return new EvictionListeningReadWriteLockedOffHeapClockCache<>(evictionListener, tableSource, storageEngine, tableSize); } } catch (RuntimeException e) { storageEngine.destroy(); throw e; } }