use of com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore in project hazelcast by hazelcast.
the class IsEmptyOperation method run.
@Override
public void run() throws Exception {
ReplicatedMapService service = getService();
Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(name);
for (ReplicatedRecordStore store : stores) {
if (!store.isEmpty()) {
response = false;
return;
}
}
response = true;
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore in project hazelcast by hazelcast.
the class ReplicationOperation method fetchReplicatedMapRecords.
private void fetchReplicatedMapRecords(PartitionContainer container) {
int storeCount = container.getStores().size();
data = createHashMap(storeCount);
versions = createHashMap(storeCount);
for (Map.Entry<String, ReplicatedRecordStore> entry : container.getStores().entrySet()) {
String name = entry.getKey();
ReplicatedRecordStore store = entry.getValue();
Set<RecordMigrationInfo> recordSet = createHashSet(store.size());
Iterator<ReplicatedRecord> iterator = store.recordIterator();
while (iterator.hasNext()) {
ReplicatedRecord record = iterator.next();
Data dataKey = serializationService.toData(record.getKeyInternal());
Data dataValue = serializationService.toData(record.getValueInternal());
RecordMigrationInfo migrationInfo = new RecordMigrationInfo();
migrationInfo.setKey(dataKey);
migrationInfo.setValue(dataValue);
migrationInfo.setTtl(record.getTtlMillis());
migrationInfo.setHits(record.getHits());
migrationInfo.setCreationTime(record.getCreationTime());
migrationInfo.setLastAccessTime(record.getLastAccessTime());
migrationInfo.setLastUpdateTime(record.getUpdateTime());
recordSet.add(migrationInfo);
}
data.put(name, recordSet);
versions.put(name, store.getVersion());
}
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore in project hazelcast by hazelcast.
the class ValuesOperation method run.
@Override
public void run() throws Exception {
ReplicatedMapService service = getService();
Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(name);
Collection<ReplicatedRecord> values = new ArrayList<>();
for (ReplicatedRecordStore store : stores) {
values.addAll(store.values(false));
}
Collection<Data> dataValues = new ArrayList<>(values.size());
SerializationService serializationService = getNodeEngine().getSerializationService();
for (ReplicatedRecord value : values) {
dataValues.add(serializationService.toData(value.getValue()));
}
response = new DataCollection(dataValues);
}
Aggregations