Search in sources :

Example 1 with ObjectDataOutput

use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.

the class AccumulatorInfo method writePortable.

@Override
public void writePortable(PortableWriter writer) throws IOException {
    writer.writeUTF("mn", mapName);
    writer.writeUTF("cn", cacheName);
    writer.writeInt("bas", batchSize);
    writer.writeInt("bus", bufferSize);
    writer.writeLong("ds", delaySeconds);
    writer.writeBoolean("iv", includeValue);
    writer.writeBoolean("ps", publishable);
    writer.writeBoolean("co", coalesce);
    writer.writeBoolean("po", populate);
    ObjectDataOutput output = writer.getRawDataOutput();
    output.writeObject(predicate);
}
Also used : ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput)

Example 2 with ObjectDataOutput

use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.

the class ReplicatedMapPortableEntryEvent method writePortable.

public void writePortable(PortableWriter writer) throws IOException {
    writer.writeInt("e", eventType.getType());
    writer.writeUTF("u", uuid);
    final ObjectDataOutput out = writer.getRawDataOutput();
    out.writeData(key);
    out.writeData(value);
    out.writeData(oldValue);
    out.writeInt(numberOfAffectedEntries);
}
Also used : ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput)

Example 3 with ObjectDataOutput

use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.

the class ReplicatedMapValueCollection method writePortable.

@Override
public void writePortable(PortableWriter writer) throws IOException {
    writer.writeInt("size", values.size());
    ObjectDataOutput out = writer.getRawDataOutput();
    for (Data value : values) {
        out.writeData(value);
    }
}
Also used : ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput) Data(com.hazelcast.nio.serialization.Data)

Example 4 with ObjectDataOutput

use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.

the class PortablePartitionLostEvent method writePortable.

@Override
public void writePortable(PortableWriter writer) throws IOException {
    writer.writeInt("p", partitionId);
    writer.writeInt("l", lostBackupCount);
    final ObjectDataOutput out = writer.getRawDataOutput();
    out.writeObject(source);
}
Also used : ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput)

Example 5 with ObjectDataOutput

use of com.hazelcast.nio.ObjectDataOutput in project hazelcast by hazelcast.

the class ClientPartitionLostListenerTest method test_portableMapPartitionLostEvent_serialization.

@Test
public void test_portableMapPartitionLostEvent_serialization() throws IOException {
    final Address source = new Address();
    final PortablePartitionLostEvent event = new PortablePartitionLostEvent(1, 2, source);
    final PortableWriter writer = mock(PortableWriter.class);
    final ObjectDataOutput output = mock(ObjectDataOutput.class);
    when(writer.getRawDataOutput()).thenReturn(output);
    event.writePortable(writer);
    verify(writer).writeInt("p", 1);
    verify(writer).writeInt("l", 2);
    verify(output).writeObject(source);
}
Also used : PortablePartitionLostEvent(com.hazelcast.spi.impl.PortablePartitionLostEvent) ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput) Address(com.hazelcast.nio.Address) HazelcastTestSupport.getAddress(com.hazelcast.test.HazelcastTestSupport.getAddress) PortableWriter(com.hazelcast.nio.serialization.PortableWriter) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

ObjectDataOutput (com.hazelcast.nio.ObjectDataOutput)44 Test (org.junit.Test)15 ObjectDataInput (com.hazelcast.nio.ObjectDataInput)12 QuickTest (com.hazelcast.test.annotation.QuickTest)12 GlobalSerializerConfig (com.hazelcast.config.GlobalSerializerConfig)7 SerializationConfig (com.hazelcast.config.SerializationConfig)6 StreamSerializer (com.hazelcast.nio.serialization.StreamSerializer)6 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 Data (com.hazelcast.internal.serialization.Data)3 SerializationService (com.hazelcast.internal.serialization.SerializationService)3 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)3 HeapData (com.hazelcast.internal.serialization.impl.HeapData)3 Data (com.hazelcast.nio.serialization.Data)3 SerializationService (com.hazelcast.spi.serialization.SerializationService)3 SerializerConfig (com.hazelcast.config.SerializerConfig)2 DataWriter (com.hazelcast.internal.nio.DataWriter)2 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)2 DataSerializable (com.hazelcast.nio.serialization.DataSerializable)2