パッケージ org.springframework.util
クラス ConcurrentReferenceHashMap.Segment
java.lang.ObjectSE
java.util.concurrent.locks.ReentrantLockSE
org.springframework.util.ConcurrentReferenceHashMap.Segment
- 実装されたすべてのインターフェース:
SerializableSE
,LockSE
- 含まれているクラス:
- ConcurrentReferenceHashMap<K,
V>
同時パフォーマンスを向上させるためにマップを分割するために使用される単一のセグメント。
- 関連事項:
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明void
clear()
このセグメントからすべてのアイテムをクリアします。<T> T
doTask
(int hash, ObjectSE key, ConcurrentReferenceHashMap<K, V>.org.springframework.util.ConcurrentReferenceHashMap.Task<T> task) このセグメントに更新操作を適用します。final int
getCount()
このセグメントの参照の総数を返します。getReference
(ObjectSE key, int hash, ConcurrentReferenceHashMap.Restructure restructure) final int
getSize()
現在の参照配列のサイズを返します。protected final void
restructureIfNecessary
(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()このセグメントの参照の総数を返します。