Examples of RecordStore


Examples of com.hazelcast.map.RecordStore

    public GetAllOperation() {
    }

    public void run() {
        int partitionId = getPartitionId();
        RecordStore recordStore = mapService.getRecordStore(partitionId, name);
        Set<Data> partitionKeySet = new HashSet<Data>();
        for (Data key : keys) {
            if (partitionId == getNodeEngine().getPartitionService().getPartitionId(key)) {
                partitionKeySet.add(key);
            }
        }
        entrySet = recordStore.getAll(partitionKeySet);
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    @Override
    public void run() throws Exception {
        MapService mapService = getService();
        MapContainer mapContainer = mapService.getMapContainer(name);
        RecordStore rs = mapService.getPartitionContainer(getPartitionId()).getRecordStore(name);
        Map<Data, Record> records = rs.getReadonlyRecordMap();
        IndexService indexService = mapContainer.getIndexService();
        SerializationService ss = getNodeEngine().getSerializationService();
        Index index = indexService.addOrGetIndex(attributeName, ordered);
        for (Record record : records.values()) {
            Data key = record.getKey();
View Full Code Here

Examples of com.hazelcast.map.RecordStore

            this.wrapperComparator = wrapperComparator;
        }

        public Collection<QueryableEntry> call() throws Exception {
            final PartitionContainer container = mapService.getPartitionContainer(partition);
            final RecordStore recordStore = container.getRecordStore(name);
            LinkedList<QueryableEntry> partitionResult = new LinkedList<QueryableEntry>();
            for (Record record : recordStore.getReadonlyRecordMapByWaitingMapStoreLoad().values()) {
                Data key = record.getKey();
                Object value;
                if (record instanceof CachedDataRecord) {
                    CachedDataRecord cachedDataRecord = (CachedDataRecord) record;
                    value = cachedDataRecord.getCachedValue();
View Full Code Here

Examples of com.hazelcast.map.RecordStore

        super(name);
        this.mapKeySet = new MapKeySet(keys);
    }

    public void run() {
        final RecordStore recordStore = mapService.getRecordStore(getPartitionId(), name);

        final Set<Data> keys = mapKeySet.getKeySet();
        if (keys.isEmpty()) {
            shouldBackup = false;
        }

        for (Data key : keys) {
            if (!recordStore.isLocked(key)) {
                recordStore.evict(key);
            }
        }
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    public PartitionWideEntryBackupOperation() {
    }

    public void run() {
        Map.Entry entry;
        RecordStore recordStore = mapService.getRecordStore(getPartitionId(), name);
        Map<Data, Record> records = recordStore.getReadonlyRecordMap();
        for (Map.Entry<Data, Record> recordEntry : records.entrySet()) {
            Data dataKey = recordEntry.getKey();
            Record record = recordEntry.getValue();
            Object objectKey = mapService.toObject(record.getKey());
            Object valueBeforeProcess = mapService.toObject(record.getValue());
            if (getPredicate() != null) {
                QueryEntry queryEntry = new QueryEntry(getNodeEngine().getSerializationService(), dataKey, objectKey, valueBeforeProcess);
                if (!getPredicate().apply(queryEntry)) {
                    continue;
                }
            }
            entry = new AbstractMap.SimpleEntry(objectKey, valueBeforeProcess);
            entryProcessor.processBackup(entry);
            if (entry.getValue() == null){
                recordStore.remove(dataKey);
            } else {
                recordStore.putBackup(dataKey, entry.getValue());
            }
        }
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    public MapValuesOperation() {
    }

    public void run() {
        RecordStore recordStore = mapService.getRecordStore(getPartitionId(), name);
        values = recordStore.valuesData();
        if (mapContainer.getMapConfig().isStatisticsEnabled()) {
            ((MapService) getService()).getLocalMapStatsImpl(name).incrementOtherOperations();
        }
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    }

    public void run() {
        MapService mapService = getService();
        int partitionId = getPartitionId();
        RecordStore recordStore = mapService.getRecordStore(partitionId, name);
        Record record = recordStore.getRecord(dataKey);
        if (record != null) {
            updateSizeEstimator(-calculateRecordSize(record));
            recordStore.deleteRecord(dataKey);
        }
        if (unlockKey) {
            recordStore.forceUnlock(dataKey);
        }
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    public MapReplicationOperation(MapService mapService, PartitionContainer container, int partitionId, int replicaIndex) {
        this.setPartitionId(partitionId).setReplicaIndex(replicaIndex);
        data = new HashMap<String, Set<RecordReplicationInfo>>(container.getMaps().size());
        for (Entry<String, RecordStore> entry : container.getMaps().entrySet()) {
            RecordStore recordStore = entry.getValue();
            MapContainer mapContainer = recordStore.getMapContainer();
            final MapConfig mapConfig = mapContainer.getMapConfig();
            if (mapConfig.getTotalBackupCount() < replicaIndex) {
                continue;
            }

            String name = entry.getKey();
            // now prepare data to migrate records
            Set<RecordReplicationInfo> recordSet = new HashSet<RecordReplicationInfo>();
            for (Entry<Data, Record> recordEntry : recordStore.getReadonlyRecordMap().entrySet()) {
                Data key = recordEntry.getKey();
                Record record = recordEntry.getValue();
                RecordReplicationInfo recordReplicationInfo;
                recordReplicationInfo = mapService.createRecordReplicationInfo(mapContainer, record);
                recordSet.add(recordReplicationInfo);
View Full Code Here

Examples of com.hazelcast.map.RecordStore

        MapService mapService = getService();
        if (data != null) {
            for (Entry<String, Set<RecordReplicationInfo>> dataEntry : data.entrySet()) {
                Set<RecordReplicationInfo> recordReplicationInfos = dataEntry.getValue();
                final String mapName = dataEntry.getKey();
                RecordStore recordStore = mapService.getRecordStore(getPartitionId(), mapName);
                for (RecordReplicationInfo recordReplicationInfo : recordReplicationInfos) {
                    Data key = recordReplicationInfo.getKey();
                    Record newRecord = mapService.createRecord(mapName, key, recordReplicationInfo.getValue(), -1, false);
                    mapService.applyRecordInfo(newRecord, mapName, recordReplicationInfo);
                    // put record.
                    final Record existingRecord = recordStore.putRecord(key, newRecord);
                    // size estimator calculations.
                    final SizeEstimator sizeEstimator = recordStore.getSizeEstimator();
                    updateSizeEstimator(-calculateRecordSize(existingRecord, sizeEstimator), sizeEstimator);
                    updateSizeEstimator(calculateRecordSize(newRecord, sizeEstimator), sizeEstimator);
                }
                recordStore.setLoaded(true);
            }
        }
    }
View Full Code Here

Examples of com.hazelcast.map.RecordStore

    public MapKeySetOperation() {
    }

    public void run() {
        MapService mapService = (MapService) getService();
        RecordStore recordStore = mapService.getRecordStore(getPartitionId(), name);
        keySet = recordStore.keySet();
        if (mapContainer.getMapConfig().isStatisticsEnabled()) {
            ((MapService) getService()).getLocalMapStatsImpl(name).incrementOtherOperations();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.