Class JournalHashMap<K,V,C>
- java.lang.Object
-
- org.apache.activemq.artemis.core.journal.collections.JournalHashMap<K,V,C>
-
-
Constructor Summary
Constructors Constructor Description JournalHashMap(long collectionId, MapStorageManager journal, LongSupplier idGenerator, org.apache.activemq.artemis.core.persistence.Persister<JournalHashMap.MapRecord<K,V>> persister, byte recordType, Supplier<IOCompletion> completionSupplier, LongFunction<C> contextProvider, IOCriticalErrorListener ioExceptionListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<K,V>>entrySet()Not implemented yet, you may use entrySetCoySet<Map.Entry<K,V>>entrySetCopy()voidforEach(BiConsumer<? super K,? super V> action)Vget(Object key)longgetCollectionId()CgetContext()booleanisEmpty()Set<K>keySet()Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)voidreload(JournalHashMap.MapRecord<K,V> reloadValue)This is to be called from a single thread during reload, no need to be synchronizedVremove(Object key)Vremove(Object key, long transactionID)This method will remove the element from the HashMap immediately however the record is still part of a transaction.JournalHashMap<K,V,C>setContext(C context)intsize()Collection<V>values()Not implemented yet, you may use valuesCopy.Collection<V>valuesCopy()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
JournalHashMap
public JournalHashMap(long collectionId, MapStorageManager journal, LongSupplier idGenerator, org.apache.activemq.artemis.core.persistence.Persister<JournalHashMap.MapRecord<K,V>> persister, byte recordType, Supplier<IOCompletion> completionSupplier, LongFunction<C> contextProvider, IOCriticalErrorListener ioExceptionListener)
-
-
Method Detail
-
getCollectionId
public long getCollectionId()
-
getContext
public C getContext()
-
setContext
public JournalHashMap<K,V,C> setContext(C context)
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>
-
reload
public void reload(JournalHashMap.MapRecord<K,V> reloadValue)
This is to be called from a single thread during reload, no need to be synchronized
-
remove
public V remove(Object key, long transactionID)
This method will remove the element from the HashMap immediately however the record is still part of a transaction. This is not playing with rollbacks. So a rollback on the transaction wouldn't place the elements back. This is intended to make sure the operation would be atomic in case of a failure, while an appendRollback is not expected.
-
values
public Collection<V> values()
Not implemented yet, you may use valuesCopy.
-
valuesCopy
public Collection<V> valuesCopy()
-
-