Package com.hazelcast.cache.impl.record

Examples of com.hazelcast.cache.impl.record.CacheRecord


        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);
                assertEquals("Foo", value2);
            }
        });
View Full Code Here


        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);
                assertEquals("Foo", value2);
            }
        });
View Full Code Here

        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);
                assertEquals("Foo", value2);
            }
        });
View Full Code Here

        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);
                if (hz1.getCluster().getLocalMember().equals(partition.getOwner())) {
                    assertEquals("Foo1", value1);
                    assertEquals("Foo2", value2);
View Full Code Here

        service.destroy();
    }

    @Test
    public void testCacheRecord_withBinaryInMemoryData() {
        CacheRecord cacheRecord = createRecord(InMemoryFormat.BINARY);

        Data cacheRecordData = service.toData(cacheRecord);
        service.toObject(cacheRecordData);
    }
View Full Code Here

        service.toObject(cacheRecordData);
    }

    @Test
    public void testCacheRecord_withObjectInMemoryData() {
        CacheRecord cacheRecord = createRecord(InMemoryFormat.OBJECT);

        Data cacheRecordData = service.toData(cacheRecord);
        service.toObject(cacheRecordData);
    }
View Full Code Here

            return null;
        }
        if (obj instanceof Data) {
            return (Data) obj;
        } else if (obj instanceof CacheRecord) {
            CacheRecord record = (CacheRecord) obj;
            Object value = record.getValue();
            return toHeapData(value);
        } else {
            return serializationService.toData(obj);
        }
    }
View Full Code Here

        out.writeBoolean(cacheRecords != null);
        if (cacheRecords != null) {
            out.writeInt(cacheRecords.size());
            for (Map.Entry<Data, CacheRecord> entry : cacheRecords.entrySet()) {
                final Data key = entry.getKey();
                final CacheRecord record = entry.getValue();
                out.writeData(key);
                out.writeObject(record);
            }
        }
    }
View Full Code Here

        if (recordNotNull) {
            int size = in.readInt();
            cacheRecords = new HashMap<Data, CacheRecord>(size);
            for (int i = 0; i < size; i++) {
                final Data key = in.readData();
                final CacheRecord record = in.readObject();
                cacheRecords.put(key, record);
            }
        }
    }
View Full Code Here

            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

TOP

Related Classes of com.hazelcast.cache.impl.record.CacheRecord

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.