Examples of ICacheRecordStore


Examples of com.hazelcast.cache.impl.ICacheRecordStore

        cache.invoke(1, new SimpleEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();

        final ICacheRecordStore recordStore1 = cacheServiceHz1.getOrCreateCache("/hz/" + cacheName, partitionId);
        final ICacheRecordStore recordStore2 = cacheServiceHz2.getOrCreateCache("/hz/" + cacheName, partitionId);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                CacheRecord record1 = recordStore1.getRecord(key);
                CacheRecord record2 = recordStore2.getRecord(key);

                Object value1 = serializationService.toObject(record1.getValue());
                Object value2 = serializationService.toObject(record2.getValue());

                assertEquals("Foo", value1);
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

        cache.invoke(1, new SimpleBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();

        final ICacheRecordStore recordStore1 = cacheServiceHz1.getOrCreateCache("/hz/" + cacheName, partitionId);
        final ICacheRecordStore recordStore2 = cacheServiceHz2.getOrCreateCache("/hz/" + cacheName, partitionId);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                CacheRecord record1 = recordStore1.getRecord(key);
                CacheRecord record2 = recordStore2.getRecord(key);

                Object value1 = serializationService.toObject(record1.getValue());
                Object value2 = serializationService.toObject(record2.getValue());

                assertEquals("Foo", value1);
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

        cache.invoke(1, new NullBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();

        final ICacheRecordStore recordStore1 = cacheServiceHz1.getOrCreateCache("/hz/" + cacheName, partitionId);
        final ICacheRecordStore recordStore2 = cacheServiceHz2.getOrCreateCache("/hz/" + cacheName, partitionId);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                CacheRecord record1 = recordStore1.getRecord(key);
                CacheRecord record2 = recordStore2.getRecord(key);

                Object value1 = serializationService.toObject(record1.getValue());
                Object value2 = serializationService.toObject(record2.getValue());

                assertEquals("Foo", value1);
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

        cache.invoke(1, new CustomBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();

        final ICacheRecordStore recordStore1 = cacheServiceHz1.getOrCreateCache("/hz/" + cacheName, partitionId);
        final ICacheRecordStore recordStore2 = cacheServiceHz2.getOrCreateCache("/hz/" + cacheName, partitionId);

        assertTrueEventually(new AssertTask() {
            @Override
            public void run()
                    throws Exception {
                CacheRecord record1 = recordStore1.getRecord(key);
                CacheRecord record2 = recordStore2.getRecord(key);

                Object value1 = serializationService.toObject(record1.getValue());
                Object value2 = serializationService.toObject(record2.getValue());

                Partition partition = hz1.getPartitionService().getPartition(1);
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

    @Override
    public void run()
            throws Exception {
        CacheService service = getService();
        ICacheRecordStore cache = service.getCacheRecordStore(name, getPartitionId());
        response = cache != null ? cache.size() : 0;
    }
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

    @Override
    public void run()
            throws Exception {
        CacheService service = getService();
        ICacheRecordStore cache = service.getOrCreateCache(name, getPartitionId());
        cache.setRecord(key, cacheRecord);
        response = Boolean.TRUE;
    }
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

    public CacheReplicationOperation(CachePartitionSegment segment, int replicaIndex) {
        data = new HashMap<String, Map<Data, CacheRecord>>();

        Iterator<ICacheRecordStore> iter = segment.cacheIterator();
        while (iter.hasNext()) {
            ICacheRecordStore cacheRecordStore = iter.next();
            CacheConfig cacheConfig = cacheRecordStore.getConfig();
            if (cacheConfig.getAsyncBackupCount() + cacheConfig.getBackupCount() >= replicaIndex) {
                data.put(cacheRecordStore.getName(), cacheRecordStore.getReadOnlyRecords());
            }
        }

        configs = new ArrayList<CacheConfig>(segment.getCacheConfigs());
    }
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

    @Override
    public void run()
            throws Exception {
        CacheService service = getService();
        for (Map.Entry<String, Map<Data, CacheRecord>> entry : data.entrySet()) {
            ICacheRecordStore cache = service.getOrCreateCache(entry.getKey(), getPartitionId());
            Map<Data, CacheRecord> map = entry.getValue();

            Iterator<Map.Entry<Data, CacheRecord>> iter = map.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry<Data, CacheRecord> next = iter.next();
                Data key = next.getKey();
                CacheRecord record = next.getValue();
                iter.remove();
                cache.setRecord(key, record);
            }
        }
        data.clear();
    }
View Full Code Here

Examples of com.hazelcast.cache.impl.ICacheRecordStore

    public CacheGetAllOperation() {
    }

    public void run() {
        CacheService service = getService();
        ICacheRecordStore cache = service.getOrCreateCache(name, getPartitionId());

        int partitionId = getPartitionId();
        Set<Data> partitionKeySet = new HashSet<Data>();
        for (Data key : keys) {
            if (partitionId == getNodeEngine().getPartitionService().getPartitionId(key)) {
                partitionKeySet.add(key);
            }
        }
        response = cache.getAll(partitionKeySet, expiryPolicy);
    }
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.