forked from hazelcast/hazelcast
/
RecordStore.java
145 lines (87 loc) · 3.67 KB
/
RecordStore.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
* Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.map;
import com.hazelcast.core.EntryView;
import com.hazelcast.map.merge.MapMergePolicy;
import com.hazelcast.map.record.Record;
import com.hazelcast.nio.serialization.Data;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
public interface RecordStore {
String getName();
Object remove(Data dataKey);
boolean remove(Data dataKey, Object testValue);
Object get(Data dataKey);
MapEntrySet getAll(Set<Data> keySet);
boolean containsKey(Data dataKey);
Object put(Data dataKey, Object dataValue, long ttl);
void put(Map.Entry<Data, Object> entry);
Record putBackup(Data key, Object value);
Record putBackup(Data key, Object value, long ttl, boolean shouldSchedule);
Object replace(Data dataKey, Object value);
boolean replace(Data dataKey, Object oldValue, Object newValue);
boolean set(Data dataKey, Object value, long ttl);
void putTransient(Data dataKey, Object value, long ttl);
void putFromLoad(Data dataKey, Object value, long ttl);
boolean tryPut(Data dataKey, Object value, long ttl);
Object putIfAbsent(Data dataKey, Object value, long ttl);
boolean merge(Data dataKey, EntryView mergingEntryView, MapMergePolicy mergePolicy);
Record getRecord(Data key);
Record putRecord(Data key, Record record);
void deleteRecord(Data key);
Map<Data, Record> getReadonlyRecordMap();
/**
* Returns read only records map by waiting map store load.
* If an operation needs to wait a data source to load like querying
* in {@link com.hazelcast.core.IMap#keySet(com.hazelcast.query.Predicate)},
* this method can be used to return a read-only view of key-value pairs.
*
* @return read only record map.
*/
Map<Data, Record> getReadonlyRecordMapByWaitingMapStoreLoad();
Set<Data> keySet();
int size();
boolean lock(Data key, String caller, long threadId, long ttl);
boolean txnLock(Data key, String caller, long threadId, long ttl);
boolean extendLock(Data key, String caller, long threadId, long ttl);
boolean unlock(Data key, String caller, long threadId);
boolean isLocked(Data key);
boolean isLockedBy(Data key, String caller, long threadId);
boolean canAcquireLock(Data key, String caller, long threadId);
String getLockOwnerInfo(Data key);
boolean containsValue(Object testValue);
Object delete(Data dataKey);
Object evict(Data key);
Collection<Object> valuesObject();
Collection<Data> valuesData();
MapContainer getMapContainer();
Set<Map.Entry<Data, Object>> entrySetObject();
Set<Map.Entry<Data, Data>> entrySetData();
Map.Entry<Data, Object> getMapEntry(Data dataKey);
Map.Entry<Data, Object> getMapEntryForBackup(Data dataKey);
void flush();
void clearPartition();
void reset();
boolean forceUnlock(Data dataKey);
long getHeapCost();
SizeEstimator getSizeEstimator();
boolean isLoaded();
void checkIfLoaded();
void setLoaded(boolean loaded);
void clear();
boolean isEmpty();
}