public class SimpleMetadataStore extends ObjectSE implements ConcurrentMetadataStore
ConcurrentMap
SE を使用する MetadataStore
の単純な実装。提供された ConcurrentMap
SE がメモリ内インスタンスである場合、メタデータはアプリケーションの再起動後も保持されない場合があります。コンストラクターと説明 |
---|
SimpleMetadataStore() インメモリ ConcurrentHashMap SE を使用して SimpleMetadataStore をインスタンス化します。 |
SimpleMetadataStore(ConcurrentMapSE<StringSE, StringSE> metadata) 提供されている ConcurrentMap SE を使用して SimpleMetadataStore をインスタンス化します。 |
修飾子と型 | メソッドと説明 |
---|---|
StringSE | get(StringSE key) この MetadataStore から指定されたキーの値を読み取ります。 |
void | put(StringSE key, StringSE value) キーと値のペアをこの MetadataStore に書き込みます。 |
StringSE | putIfAbsent(StringSE key, StringSE value) キーをストアに原子的に挿入します。 |
StringSE | remove(StringSE key) この MetadataStore から指定されたキーの値を削除します。 |
boolean | replace(StringSE key, StringSE oldValue, StringSE newValue) 古い値が oldValue 引数と一致する場合、ストア内のキーの値をアトミックに置き換えます。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public SimpleMetadataStore()
ConcurrentHashMap
SE を使用して SimpleMetadataStore
をインスタンス化します。public SimpleMetadataStore(ConcurrentMapSE<StringSE,StringSE> metadata)
ConcurrentMap
SE を使用して SimpleMetadataStore
をインスタンス化します。実装は、Redis や Hazelcast などのプロジェクトによって提供される分散マップの場合があります。metadata
- メタデータの ConcurrentMap
SE インスタンス。public void put(StringSE key, StringSE value)
MetadataStore
MetadataStore
の put
key
- キー。value
- 値。public StringSE get(StringSE key)
MetadataStore
MetadataStore
の get
key
- キー。public StringSE remove(StringSE key)
MetadataStore
MetadataStore
の remove
key
- キー。public StringSE putIfAbsent(StringSE key, StringSE value)
ConcurrentMetadataStore
ConcurrentMetadataStore
の putIfAbsent
key
- キー。value
- 値。public boolean replace(StringSE key, StringSE oldValue, StringSE newValue)
ConcurrentMetadataStore
ConcurrentMetadataStore
の replace
key
- キー。oldValue
- 古い値。newValue
- 新しい値。