パッケージ org.springframework.util
クラス ConcurrentReferenceHashMap.Segment
java.lang.ObjectSE
java.util.concurrent.locks.ReentrantLockSE
org.springframework.util.ConcurrentReferenceHashMap.Segment
- 実装済みのインターフェース一覧:
SerializableSE,LockSE
- 含まれているクラス:
- ConcurrentReferenceHashMap<K,
V>
同時パフォーマンスを向上させるためにマップを分割するために使用される単一のセグメント。
- 関連事項:
コンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明voidclear()このセグメントからすべてのアイテムをクリアします。<T> TdoTask(int hash, ObjectSE key, ConcurrentReferenceHashMap<K, V>.org.springframework.util.ConcurrentReferenceHashMap.Task<T> task) このセグメントに更新操作を適用します。final intgetCount()このセグメントの参照の総数を返します。getReference(ObjectSE key, int hash, ConcurrentReferenceHashMap.Restructure restructure) final intgetSize()現在の参照配列のサイズを返します。protected final voidrestructureIfNecessary(boolean allowResize) 必要に応じて、基になるデータ構造を再構築します。クラス java.util.concurrent.locks.ReentrantLockSE から継承されたメソッド
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreadsSE, getWaitQueueLengthSE, hasQueuedThreadSE, hasQueuedThreads, hasWaitersSE, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLockSE, unlock
コンストラクターの詳細
Segment
public Segment(int initialSize, int resizeThreshold)
方法の詳細
getReference
@Nullable public ConcurrentReferenceHashMap.Reference<K,V> getReference(@Nullable ObjectSE key, int hash, ConcurrentReferenceHashMap.Restructure restructure) doTask
@Nullable public <T> T doTask(int hash, @Nullable ObjectSE key, ConcurrentReferenceHashMap<K, V>.org.springframework.util.ConcurrentReferenceHashMap.Task<T> task) このセグメントに更新操作を適用します。セグメントは更新中にロックされます。- パラメーター:
hash- キーのハッシュkey- キーtask- 更新操作- 戻り値:
- 操作の結果
clear
public void clear()このセグメントからすべてのアイテムをクリアします。restructureIfNecessary
protected final void restructureIfNecessary(boolean allowResize) 必要に応じて、基になるデータ構造を再構築します。このメソッドは、参照テーブルのサイズを増やすだけでなく、ガベージコレクションされたすべての参照を削除できます。- パラメーター:
allowResize- サイズ変更が許可されている場合
getSize
public final int getSize()現在の参照配列のサイズを返します。getCount
public final int getCount()このセグメントの参照の総数を返します。