use of com.hazelcast.client.impl.proxy.ClientListProxy in project hazelcast by hazelcast.
the class ReadIListP method createTraverser.
@SuppressWarnings("rawtypes")
private Traverser<Data> createTraverser(HazelcastInstance instance, String name) {
IList<Data> list = instance.getList(name);
int size = list.size();
if (list instanceof ClientListProxy) {
ClientListProxy proxy = (ClientListProxy) list;
return createTraverser(size, proxy::dataSubList);
} else if (list instanceof ListProxyImpl) {
ListProxyImpl proxy = (ListProxyImpl) list;
return createTraverser(size, proxy::dataSubList);
} else {
throw new RuntimeException("Unexpected list class: " + list.getClass().getName());
}
}
use of com.hazelcast.client.impl.proxy.ClientListProxy in project hazelcast by hazelcast.
the class JobSerializerTest method when_serializerIsRegisteredWithTheHook_then_itIsAvailableForTheJob.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void when_serializerIsRegisteredWithTheHook_then_itIsAvailableForTheJob() {
String listName = "list-3";
Pipeline pipeline = Pipeline.create();
pipeline.readFrom(TestSources.items("Mustang")).map(name -> Animal.newBuilder().setName(name).build()).writeTo(Sinks.list(listName));
client().getJet().newJob(pipeline, new JobConfig()).join();
// Protocol Buffer types implement Serializable, to make sure hook registered serializer is used we check the
// type id
ClientListProxy<Animal> proxy = ((ClientListProxy) client().getList(listName));
assertThat(proxy.dataSubList(0, 1).get(0).getType()).isEqualTo(ANIMAL_TYPE_ID);
}
Aggregations