Package com.hazelcast.nio.serialization

Examples of com.hazelcast.nio.serialization.Data


        return new OffHeapRecord(storage, key, v, statisticsEnabled);
    }

    @Override
    public void setValue(Record<Data> record, Object value) {
        final Data v;
        if (value instanceof Data) {
            v = (Data) value;
        } else {
            v = serializationService.toData(value, partitionStrategy);
        }
View Full Code Here


        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();
                    if (value == null) {
View Full Code Here

        return InMemoryFormat.BINARY;
    }

    @Override
    public Record<Data> newRecord(Data key, Object value) {
        Data v = serializationService.toData(value, partitionStrategy);
        if (optimizeQuery) {
            return new CachedDataRecord(key, v, statisticsEnabled);
        }
        return new DataRecord(key, v, statisticsEnabled);
    }
View Full Code Here

        return new DataRecord(key, v, statisticsEnabled);
    }

    @Override
    public void setValue(Record<Data> record, Object value) {
        final Data v;
        if (value instanceof Data) {
            v = (Data) value;
        } else {
            v = serializationService.toData(value, partitionStrategy);
        }
View Full Code Here

    public void readData(ObjectDataInput in) throws IOException {
        int size = in.readInt();
        values = new ArrayList<Data>(size);
        for (int i = 0; i < size; i++) {
            Data data = new Data();
            data.readData(in);
            values.add(data);
        }
    }
View Full Code Here

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

    }

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

        out.writeLong(ttl);
    }

    protected void readInternal(ObjectDataInput in) throws IOException {
        name = in.readUTF();
        dataKey = new Data();
        dataKey.readData(in);
        threadId = in.readLong();
        dataValue = IOUtil.readNullableData(in);
        ttl = in.readLong();
    }
View Full Code Here

    public boolean hasNext() {
        return iterator.hasNext();
    }

    public E next() {
        Data item = iterator.next();
        if (binary) {
            return (E) item;
        }
        return (E) serializationService.toObject(item);
    }
View Full Code Here

        offer(e, -1, TimeUnit.MILLISECONDS);
    }

    public boolean offer(E e, long timeout, TimeUnit timeUnit) throws InterruptedException {
        final NodeEngine nodeEngine = getNodeEngine();
        final Data data = nodeEngine.toData(e);
        return offerInternal(data, timeUnit.toMillis(timeout));
    }
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.