use of com.hazelcast.multimap.impl.MultiMapValue in project hazelcast by hazelcast.
the class RemoveBackupOperation method run.
@Override
public void run() throws Exception {
MultiMapValue multiMapValue = getMultiMapValueOrNull();
response = false;
if (multiMapValue == null) {
return;
}
Collection<MultiMapRecord> coll = multiMapValue.getCollection(false);
Iterator<MultiMapRecord> iter = coll.iterator();
while (iter.hasNext()) {
if (iter.next().getRecordId() == recordId) {
iter.remove();
response = true;
if (coll.isEmpty()) {
delete();
}
break;
}
}
}
use of com.hazelcast.multimap.impl.MultiMapValue in project hazelcast by hazelcast.
the class RemoveOperation method run.
@Override
public void run() throws Exception {
response = false;
MultiMapValue multiMapValue = getMultiMapValueOrNull();
if (multiMapValue == null) {
return;
}
Collection<MultiMapRecord> coll = multiMapValue.getCollection(false);
MultiMapRecord record = new MultiMapRecord(isBinary() ? value : toObject(value));
Iterator<MultiMapRecord> iter = coll.iterator();
while (iter.hasNext()) {
MultiMapRecord r = iter.next();
if (r.equals(record)) {
iter.remove();
recordId = r.getRecordId();
response = true;
if (coll.isEmpty()) {
delete();
}
break;
}
}
}
use of com.hazelcast.multimap.impl.MultiMapValue in project hazelcast by hazelcast.
the class CountOperation method run.
@Override
public void run() throws Exception {
MultiMapContainer container = getOrCreateContainer();
((MultiMapService) getService()).getLocalMultiMapStatsImpl(name).incrementOtherOperations();
MultiMapValue multiMapValue = container.getMultiMapValueOrNull(dataKey);
response = multiMapValue == null ? 0 : multiMapValue.getCollection(false).size();
}
use of com.hazelcast.multimap.impl.MultiMapValue in project hazelcast by hazelcast.
the class GetAllOperation method run.
@Override
public void run() throws Exception {
MultiMapContainer container = getOrCreateContainer();
MultiMapValue multiMapValue = container.getMultiMapValueOrNull(dataKey);
Collection coll = null;
if (multiMapValue != null) {
multiMapValue.incrementHit();
coll = multiMapValue.getCollection(executedLocally());
}
response = new MultiMapResponse(coll, getValueCollectionType(container));
}
Aggregations