Package com.hazelcast.map.record

Examples of com.hazelcast.map.record.Record


        int partitionId = getPartitionId();
        recordStore = mapService.getRecordStore(partitionId, name);
        for (int i = 0; i < entries.size(); i++) {
            final RecordInfo recordInfo = recordInfos.get(i);
            final Map.Entry<Data,Data> entry = entries.get(i);
            final Record record = recordStore.putBackup(entry.getKey(), entry.getValue(), -1, false);
            mapService.applyRecordInfo(record, name, recordInfo);
        }
    }
View Full Code Here


        if (eventType == null)
            eventType = dataOldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
        mapService.publishEvent(getCallerAddress(), name, eventType, dataKey, dataOldValue, dataValue);
        invalidateNearCaches();
        if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
            Record record = recordStore.getRecord(dataKey);
            final SimpleEntryView entryView = mapService.createSimpleEntryView(dataKey,mapService.toData(dataValue),record);
            mapService.publishWanReplicationUpdate(name, entryView);
        }
    }
View Full Code Here

    public boolean shouldBackup() {
        return true;
    }

    public Operation getBackupOperation() {
        Record record = recordStore.getRecord(dataKey);
        RecordInfo replicationInfo = mapService.createRecordInfo(mapContainer, record);
        return new PutBackupOperation(name, dataKey, dataValue, replicationInfo);
    }
View Full Code Here

    public Record putBackup(Data key, Object value) {
        return putBackup(key, value, DEFAULT_TTL, true);
    }

    public Record putBackup(Data key, Object value, long ttl, boolean shouldSchedule) {
        Record record = records.get(key);
        if (record == null) {
            record = mapService.createRecord(name, key, value, ttl, shouldSchedule);
            records.put(key, record);
            updateSizeEstimator(calculateRecordSize(record));
        } else {
View Full Code Here

        }
        return record;
    }

    public void deleteRecord(Data key) {
        Record record = records.remove(key);
        if (record != null) {
            record.invalidate();
        }
    }
View Full Code Here

                return;

            case OFFHEAP:
                Iterator<Record> iter = records.values().iterator();
                while (iter.hasNext()) {
                    Record record = iter.next();
                    if (excludeRecords == null || !excludeRecords.containsKey(record.getKey())) {
                        record.invalidate();
                        iter.remove();
                    }
                }
                return;
View Full Code Here

        return temp.entrySet();
    }

    public Map.Entry<Data, Object> getMapEntry(Data dataKey) {
        checkIfLoaded();
        Record record = records.get(dataKey);
        if (record == null) {
            record = getRecordInternal(dataKey, true);
        } else {
            accessRecord(record);
        }
        final Object data = record != null ? record.getValue() : null;
        return new AbstractMap.SimpleImmutableEntry<Data, Object>(dataKey, data);
    }
View Full Code Here

    }


    public Map.Entry<Data, Object> getMapEntryForBackup(Data dataKey) {
        checkIfLoaded();
        Record record = records.get(dataKey);
        if (record == null) {
            record = getRecordInternal(dataKey, false);
        } else {
            accessRecord(record);
        }
        final Object data = record != null ? record.getValue() : null;
        return new AbstractMap.SimpleImmutableEntry<Data, Object>(dataKey, data);
    }
View Full Code Here

        final Object data = record != null ? record.getValue() : null;
        return new AbstractMap.SimpleImmutableEntry<Data, Object>(dataKey, data);
    }

    private Record getRecordInternal(Data dataKey, boolean enableIndex) {
        Record record = null;
        if (mapContainer.getStore() != null) {
            final Object value = mapContainer.getStore().load(mapService.toObject(dataKey));
            if (value != null) {
                record = mapService.createRecord(name, dataKey, value, DEFAULT_TTL);
                records.put(dataKey, record);
View Full Code Here

        resetSizeEstimator();
        final Collection<Data> lockedKeys = lockStore != null ? lockStore.getLockedKeys() : Collections.<Data>emptySet();
        final Map<Data, Record> lockedRecords = new HashMap<Data, Record>(lockedKeys.size());
        // Locked records should not be removed!
        for (Data key : lockedKeys) {
            Record record = records.get(key);
            if (record != null) {
                lockedRecords.put(key, record);
                updateSizeEstimator(calculateRecordSize(record));
            }
        }
View Full Code Here

TOP

Related Classes of com.hazelcast.map.record.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.