use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class MigrationListenerAdapterTest method test_migrationEvent_deserialization.
@Test
public void test_migrationEvent_deserialization() throws IOException {
final ObjectDataInput input = mock(ObjectDataInput.class);
when(input.readInt()).thenReturn(0);
when(input.readObject()).thenReturn(null);
when(input.readObject()).thenReturn(null);
when(input.readByte()).thenReturn((byte) 0);
final MigrationEvent event = new MigrationEvent();
event.readData(input);
assertEquals(0, event.getPartitionId());
assertNull(event.getOldOwner());
assertNull(event.getNewOwner());
assertEquals(STARTED, event.getStatus());
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class AccumulatorInfo method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
mapName = reader.readUTF("mn");
cacheName = reader.readUTF("cn");
batchSize = reader.readInt("bas");
bufferSize = reader.readInt("bus");
delaySeconds = reader.readLong("ds");
includeValue = reader.readBoolean("iv");
publishable = reader.readBoolean("ps");
coalesce = reader.readBoolean("co");
populate = reader.readBoolean("po");
ObjectDataInput input = reader.getRawDataInput();
predicate = input.readObject();
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class ReplicatedMapEntries method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
int size = reader.readInt("size");
keys = new ArrayList<Data>(size);
values = new ArrayList<Data>(size);
ObjectDataInput in = reader.getRawDataInput();
for (int i = 0; i < size; i++) {
keys.add(in.readData());
values.add(in.readData());
}
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class ReplicatedMapKeys method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
int size = reader.readInt("size");
ObjectDataInput in = reader.getRawDataInput();
keys = new ArrayList<Data>(size);
for (int i = 0; i < size; i++) {
keys.add(in.readData());
}
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class ReplicatedMapValueCollection method readPortable.
@Override
public void readPortable(PortableReader reader) throws IOException {
int size = reader.readInt("size");
ObjectDataInput in = reader.getRawDataInput();
values = new ArrayList(size);
for (int i = 0; i < size; i++) {
values.add(in.readData());
}
}
Aggregations