@SerializableByConvention private class ObjectToData implements IFunction<Object, Data> { @Override public Data apply(Object input) { SerializationService ss = mapStoreContext.getSerializationService(); return ss.toData(input, partitioningStrategy); } } }
@SerializableByConvention private static class TrueFilter implements IFunction<EventRegistration, Boolean> { @Override public Boolean apply(EventRegistration eventRegistration) { return TRUE; } } }
/** * {@link com.hazelcast.config.EvictionPolicy#RANDOM} policy based {@link EvictionPolicyComparator}. */ @SerializableByConvention public class RandomEvictionPolicyComparator extends EvictionPolicyComparator { @Override @SuppressWarnings("ComparatorMethodParameterNotUsed") public int compare(EvictableEntryView e1, EvictableEntryView e2) { return 0; } }
@SerializableByConvention private static class EmptyPartitioningStrategy implements PartitioningStrategy { public Object getPartitionKey(Object key) { return null; } }
/** * {@link com.hazelcast.config.EvictionPolicy#RANDOM} policy based {@link EvictionPolicyComparator}. */ @SerializableByConvention public class RandomEvictionPolicyComparator extends EvictionPolicyComparator { @Override @SuppressWarnings("ComparatorMethodParameterNotUsed") public int compare(EvictableEntryView e1, EvictableEntryView e2) { return 0; } }
/** * Filters out listeners other than invalidation related ones. */ @SerializableByConvention private static class InvalidationAcceptorFilter implements IFunction<EventRegistration, Boolean> { @Override public Boolean apply(EventRegistration eventRegistration) { EventFilter filter = eventRegistration.getFilter(); return filter instanceof EventListenerFilter && filter.eval(INVALIDATION.getType()); } }
@SerializableByConvention private class ObjectToData implements IFunction<Object, Data> { @Override public Data apply(Object input) { SerializationService ss = mapStoreContext.getSerializationService(); return ss.toData(input, partitioningStrategy); } } }
/** * This service event is fired to inform services about a change in a member's attributes collection */ @SerializableByConvention(PUBLIC_API) public class MemberAttributeServiceEvent extends MemberAttributeEvent { public MemberAttributeServiceEvent() { } public MemberAttributeServiceEvent(Cluster cluster, MemberImpl member, MemberAttributeOperationType operationType, String key, Object value) { super(cluster, member, operationType, key, value); } }
@SerializableByConvention private class RegisterMapListenerFunction implements IFunction<String, String> { @Override public String apply(String name) { return registerLocalIMapListener(name); } } }
/** * Filters out listeners other than invalidation related ones. */ @SerializableByConvention private static class InvalidationAcceptorFilter implements IFunction<EventRegistration, Boolean> { @Override public Boolean apply(EventRegistration eventRegistration) { EventFilter filter = eventRegistration.getFilter(); return filter instanceof EventListenerFilter && filter.eval(INVALIDATION.getType()); } }
/** * This service event is fired to inform services about a change in a member's attributes collection */ @SerializableByConvention(PUBLIC_API) public class MemberAttributeServiceEvent extends MemberAttributeEvent { public MemberAttributeServiceEvent() { } public MemberAttributeServiceEvent(Cluster cluster, MemberImpl member, MemberAttributeOperationType operationType, String key, Object value) { super(cluster, member, operationType, key, value); } }
@SerializableByConvention private class RegisterMapListenerFunction implements IFunction<String, String> { @Override public String apply(String name) { return registerLocalIMapListener(name); } } }
@SerializableByConvention private static class TrueFilter implements IFunction<EventRegistration, Boolean> { @Override public Boolean apply(EventRegistration eventRegistration) { return TRUE; } } }
@SerializableByConvention private static class EmptyPartitioningStrategy implements PartitioningStrategy { public Object getPartitionKey(Object key) { return null; } }
@SerializableByConvention private static class DataToEntry implements IFunction<Data, Entry<Integer, Data>> { private final IPartitionService partitionService; public DataToEntry(IPartitionService partitionService) { this.partitionService = partitionService; } @Override public Entry<Integer, Data> apply(Data input) { // Null-pointer here, in case of null key loaded by MapLoader checkNotNull(input, "Key loaded by a MapLoader cannot be null."); Integer partition = partitionService.getPartitionId(input); return new MapEntrySimple<Integer, Data>(partition, input); } }
@SerializableByConvention private static class ProjectionAdapter<K, V, T> extends Projection<InternalEventJournalMapEvent, T> { private final Projection<? super EventJournalMapEvent<K, V>, ? extends T> projection; ProjectionAdapter(Projection<? super EventJournalMapEvent<K, V>, ? extends T> projection) { this.projection = projection; } @Override @SuppressWarnings("unchecked") @SuppressFBWarnings("BC_UNCONFIRMED_CAST") public T transform(InternalEventJournalMapEvent e) { return projection.transform((DeserializingEventJournalMapEvent<K, V>) e); } } }
@SerializableByConvention private static class ProjectionAdapter<K, V, T> extends Projection<InternalEventJournalCacheEvent, T> { private final Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection; ProjectionAdapter(Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection) { this.projection = projection; } @Override @SuppressWarnings("unchecked") @SuppressFBWarnings("BC_UNCONFIRMED_CAST") public T transform(InternalEventJournalCacheEvent input) { return projection.transform((DeserializingEventJournalCacheEvent<K, V>) input); } } }
@SerializableByConvention private static class ProjectionAdapter<K, V, T> extends Projection<InternalEventJournalMapEvent, T> { private final Projection<? super EventJournalMapEvent<K, V>, ? extends T> projection; ProjectionAdapter(Projection<? super EventJournalMapEvent<K, V>, ? extends T> projection) { this.projection = projection; } @Override @SuppressWarnings("unchecked") @SuppressFBWarnings("BC_UNCONFIRMED_CAST") public T transform(InternalEventJournalMapEvent e) { return projection.transform((DeserializingEventJournalMapEvent<K, V>) e); } } }
@SerializableByConvention private static class ProjectionAdapter<K, V, T> extends Projection<InternalEventJournalCacheEvent, T> { private final Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection; ProjectionAdapter(Projection<? super EventJournalCacheEvent<K, V>, ? extends T> projection) { this.projection = projection; } @Override @SuppressWarnings("unchecked") @SuppressFBWarnings("BC_UNCONFIRMED_CAST") public T transform(InternalEventJournalCacheEvent input) { return projection.transform((DeserializingEventJournalCacheEvent<K, V>) input); } } }
/** * A {@link PartitioningStrategy} that checks if the key implements {@link PartitionAware}. * If so, the {@link PartitionAware#getPartitionKey()} is called. Otherwise null is returned. */ @SerializableByConvention public class DefaultPartitioningStrategy implements PartitioningStrategy { @Override public Object getPartitionKey(Object key) { if (key instanceof PartitionAware) { return ((PartitionAware) key).getPartitionKey(); } return null; } }