Search in sources :

Example 1 with ReaderGroupUpdateSerializer

use of io.pravega.client.stream.impl.ReaderGroupState.ReaderGroupUpdateSerializer in project pravega by pravega.

the class SerializationTest method testReaderGroupUpdates.

@Test
public void testReaderGroupUpdates() throws Exception {
    ReaderGroupUpdateSerializer serializer = new ReaderGroupUpdateSerializer();
    verify(serializer, new AddReader(createString()));
    verify(serializer, new RemoveReader(createString(), createSegmentToLongMap()));
    verify(serializer, new ReleaseSegment(createString(), createSegment(), r.nextLong()));
    verify(serializer, new AcquireSegment(createString(), createSegment()));
    verify(serializer, new UpdateDistanceToTail(createString(), r.nextLong(), createSegmentRangeMap()));
    verify(serializer, new SegmentCompleted(createString(), createSegmentWithRange(), createMap(this::createSegmentWithRange, this::createLongList)));
    verify(serializer, new CheckpointReader(createString(), createString(), createSegmentToLongMap()));
    verify(serializer, new CreateCheckpoint(createString()));
    verify(serializer, new ClearCheckpointsBefore(createString()));
    verify(serializer, new UpdatingConfig(r.nextBoolean()));
}
Also used : ReleaseSegment(io.pravega.client.stream.impl.ReaderGroupState.ReleaseSegment) ReaderGroupUpdateSerializer(io.pravega.client.stream.impl.ReaderGroupState.ReaderGroupUpdateSerializer) AcquireSegment(io.pravega.client.stream.impl.ReaderGroupState.AcquireSegment) UpdateDistanceToTail(io.pravega.client.stream.impl.ReaderGroupState.UpdateDistanceToTail) CreateCheckpoint(io.pravega.client.stream.impl.ReaderGroupState.CreateCheckpoint) CheckpointReader(io.pravega.client.stream.impl.ReaderGroupState.CheckpointReader) ClearCheckpointsBefore(io.pravega.client.stream.impl.ReaderGroupState.ClearCheckpointsBefore) RemoveReader(io.pravega.client.stream.impl.ReaderGroupState.RemoveReader) AddReader(io.pravega.client.stream.impl.ReaderGroupState.AddReader) UpdatingConfig(io.pravega.client.stream.impl.ReaderGroupState.UpdatingConfig) SegmentCompleted(io.pravega.client.stream.impl.ReaderGroupState.SegmentCompleted) Test(org.junit.Test)

Aggregations

AcquireSegment (io.pravega.client.stream.impl.ReaderGroupState.AcquireSegment)1 AddReader (io.pravega.client.stream.impl.ReaderGroupState.AddReader)1 CheckpointReader (io.pravega.client.stream.impl.ReaderGroupState.CheckpointReader)1 ClearCheckpointsBefore (io.pravega.client.stream.impl.ReaderGroupState.ClearCheckpointsBefore)1 CreateCheckpoint (io.pravega.client.stream.impl.ReaderGroupState.CreateCheckpoint)1 ReaderGroupUpdateSerializer (io.pravega.client.stream.impl.ReaderGroupState.ReaderGroupUpdateSerializer)1 ReleaseSegment (io.pravega.client.stream.impl.ReaderGroupState.ReleaseSegment)1 RemoveReader (io.pravega.client.stream.impl.ReaderGroupState.RemoveReader)1 SegmentCompleted (io.pravega.client.stream.impl.ReaderGroupState.SegmentCompleted)1 UpdateDistanceToTail (io.pravega.client.stream.impl.ReaderGroupState.UpdateDistanceToTail)1 UpdatingConfig (io.pravega.client.stream.impl.ReaderGroupState.UpdatingConfig)1 Test (org.junit.Test)1