@Override public IdentifiedDataSerializable create(int typeId) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; return factory != null ? factory.createNew(typeId) : null; } return null; }
@Override public IdentifiedDataSerializable create(int typeId) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; return factory != null ? factory.createNew(typeId) : null; } return null; }
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public void regenerateUuid(int partitionId) { uuids.put(partitionId, uuidConstructor.createNew(partitionId)); }
public void regenerateUuid(int partitionId) { uuids.put(partitionId, uuidConstructor.createNew(partitionId)); }
public static <K, V> V getOrPutIfAbsent(ConcurrentMap<K, V> map, K key, ConstructorFunction<K, V> func) { V value = map.get(key); if (value == null) { value = func.createNew(key); V current = map.putIfAbsent(key, value); value = current == null ? value : current; } return value; }
public static <K, V> V getOrPutIfAbsent(ConcurrentMap<K, V> map, K key, ConstructorFunction<K, V> func) { V value = map.get(key); if (value == null) { value = func.createNew(key); V current = map.putIfAbsent(key, value); value = current == null ? value : current; } return value; }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param mapListener a {@link com.hazelcast.map.listener.MapListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, MapListener mapListener) { final ConstructorFunction<MapListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(mapListener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param listener a {@link EntryListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) { final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(listener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param mapListener a {@link com.hazelcast.map.listener.MapListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, MapListener mapListener) { final ConstructorFunction<MapListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(mapListener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param listener a {@link EntryListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) { final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(listener); }
static ListenerAdapter[] createQueryCacheListenerAdapters(MapListener mapListener) { ListenerAdapter[] mapListenerAdapters = MapListenerAdaptors.createListenerAdapters(mapListener); ListenerAdapter eventLostAdapter = EVENT_LOST_LISTENER_ADAPTER.createNew(mapListener); ListenerAdapter[] adapters = new ListenerAdapter[mapListenerAdapters.length + 1]; System.arraycopy(mapListenerAdapters, 0, adapters, 0, mapListenerAdapters.length); adapters[mapListenerAdapters.length] = eventLostAdapter; return adapters; }
static ListenerAdapter[] createQueryCacheListenerAdapters(MapListener mapListener) { ListenerAdapter[] mapListenerAdapters = MapListenerAdaptors.createListenerAdapters(mapListener); ListenerAdapter eventLostAdapter = EVENT_LOST_LISTENER_ADAPTER.createNew(mapListener); ListenerAdapter[] adapters = new ListenerAdapter[mapListenerAdapters.length + 1]; System.arraycopy(mapListenerAdapters, 0, adapters, 0, mapListenerAdapters.length); adapters[mapListenerAdapters.length] = eventLostAdapter; return adapters; }
private <T> T createMapService() { ConstructorFunction<NodeEngine, MapService> constructor = getDefaultMapServiceConstructor(); NodeEngineImpl nodeEngine = node.getNodeEngine(); return (T) constructor.createNew(nodeEngine); }
private <T> T createMapService() { ConstructorFunction<NodeEngine, MapService> constructor = getDefaultMapServiceConstructor(); NodeEngineImpl nodeEngine = node.getNodeEngine(); return (T) constructor.createNew(nodeEngine); }
public LockStoreImpl createNew(ObjectNamespace namespace) { final ConstructorFunction<ObjectNamespace, LockStoreInfo> ctor = lockService.getConstructor(namespace.getServiceName()); if (ctor != null) { LockStoreInfo info = ctor.createNew(namespace); if (info != null) { int backupCount = info.getBackupCount(); int asyncBackupCount = info.getAsyncBackupCount(); EntryTaskScheduler<Data, Integer> entryTaskScheduler = createScheduler(namespace); return new LockStoreImpl(lockService, namespace, entryTaskScheduler, backupCount, asyncBackupCount); } } throw new IllegalArgumentException("No LockStore constructor is registered!"); } };
protected AbstractRecordStore(MapContainer mapContainer, int partitionId) { this.name = mapContainer.getName(); this.mapContainer = mapContainer; this.partitionId = partitionId; this.mapServiceContext = mapContainer.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.serializationService = nodeEngine.getSerializationService(); this.inMemoryFormat = mapContainer.getMapConfig().getInMemoryFormat(); this.recordFactory = mapContainer.getRecordFactoryConstructor().createNew(null); this.valueComparator = mapServiceContext.getValueComparatorOf(inMemoryFormat); this.mapStoreContext = mapContainer.getMapStoreContext(); this.mapDataStore = mapStoreContext.getMapStoreManager().getMapDataStore(name, partitionId); this.lockStore = createLockStore(); Collection<RecordStoreMutationObserver<Record>> mutationObservers = mapServiceContext .createRecordStoreMutationObservers(getName(), partitionId); this.mutationObserver = new CompositeRecordStoreMutationObserver<Record>(mutationObservers); }