Package com.hazelcast.nio.serialization

Examples of com.hazelcast.nio.serialization.Data


                throw new IllegalArgumentException("Not an appropriate eviction policy [" + evictionPolicy + ']');
        }
    }

    private void saveIndex(Record record) {
        Data dataKey = record.getKey();
        final IndexService indexService = mapContainer.getIndexService();
        if (indexService.hasIndex()) {
            SerializationService ss = mapService.getSerializationService();
            QueryableEntry queryableEntry = new QueryEntry(ss, dataKey, dataKey, record.getValue());
            indexService.saveEntryIndex(queryableEntry);
View Full Code Here


    }

    public void read(PortableReader reader) throws IOException {
        super.read(reader);
        index = reader.readInt("i");
        value = new Data();
        value.readData(reader.getRawDataInput());
    }
View Full Code Here

        key.writeData(out);
    }

    public void read(PortableReader reader) throws IOException {
        ObjectDataInput in = reader.getRawDataInput();
        key = new Data();
        key.readData(in);
    }
View Full Code Here

                MapEntrySet entrySet = new MapEntrySet();
                for (Data dataKey : keys.keySet()) {
                    Object key = keys.get(dataKey);
                    Object value = values.get(key);
                    if (value != null) {
                        Data dataValue = mapService.toData(value);
                        entrySet.add(dataKey, dataValue);
                    }
                }

                PutAllOperation operation = new PutAllOperation(name, entrySet, true);
View Full Code Here

        retain = reader.readBoolean("r");
        final ObjectDataInput in = reader.getRawDataInput();
        final int size = in.readInt();
        valueSet = new HashSet<Data>(size);
        for (int i = 0; i<size; i++){
            final Data value = new Data();
            value.readData(in);
            valueSet.add(value);
        }
    }
View Full Code Here

            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

            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.
View Full Code Here

    }

    @Override
    public void readData(ObjectDataInput in) throws IOException {
        super.readData(in);
        key = new Data();
        key.readData(in);
        value = new Data();
        value.readData(in);
    }
View Full Code Here

    public void writePortable(PortableWriter writer) throws IOException {
        writer.writeInt("s",entrySet.size());
        final ObjectDataOutput out = writer.getRawDataOutput();
        for (Map.Entry<Data, Data> entry: entrySet){
            Data key = entry.getKey();
            Data value = entry.getValue();
            key.writeData(out);
            value.writeData(out);
        }
    }
View Full Code Here

    public void readPortable(PortableReader reader) throws IOException {
        int size = reader.readInt("s");
        final ObjectDataInput in = reader.getRawDataInput();
        entrySet = new HashSet<Map.Entry>(size);
        for (int i=0; i<size; i++){
            Data key = new Data();
            Data value = new Data();
            key.readData(in);
            value.readData(in);
            entrySet.add(new AbstractMap.SimpleEntry(key,value));
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.nio.serialization.Data

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.