/** * Sets the {@link KubernetesConfig} used by the discovery mechanism for this * WAN publisher. * * @param kubernetesConfig the Kubernetes discovery configuration * @return this config * @throws IllegalArgumentException if kubernetesConfig is null */ public WanPublisherConfig setKubernetesConfig(final KubernetesConfig kubernetesConfig) { this.kubernetesConfig = isNotNull(kubernetesConfig, "kubernetesConfig"); return this; }
/** * Sets the {@link DiscoveryConfig} used by the discovery mechanism for * this WAN publisher. * * @param discoveryConfig configuration to set * @return this config * @throws java.lang.IllegalArgumentException if discoveryProvidersConfig is null */ public WanPublisherConfig setDiscoveryConfig(DiscoveryConfig discoveryConfig) { this.discoveryConfig = isNotNull(discoveryConfig, "discoveryProvidersConfig"); return this; }
/** * Sets {@link com.hazelcast.client.config.ClientNetworkConfig} * * @param networkConfig {@link com.hazelcast.client.config.ClientNetworkConfig} to be set * @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining * @see com.hazelcast.client.config.ClientNetworkConfig */ public ClientConfig setNetworkConfig(ClientNetworkConfig networkConfig) { Preconditions.isNotNull(networkConfig, "networkConfig"); this.networkConfig = networkConfig; return this; }
public ClientConfig setNativeMemoryConfig(NativeMemoryConfig nativeMemoryConfig) { Preconditions.isNotNull(nativeMemoryConfig, "nativeMemoryConfig"); this.nativeMemoryConfig = nativeMemoryConfig; return this; }
/** * Defines the Discovery Provider SPI configuration * * @param discoveryConfig the Discovery Provider SPI configuration * @throws java.lang.IllegalArgumentException if discoveryConfig is null */ public void setDiscoveryConfig(DiscoveryConfig discoveryConfig) { this.discoveryConfig = isNotNull(discoveryConfig, "discoveryConfig"); }
/** * @param awsConfig the AwsConfig join configuration to set * @throws IllegalArgumentException if awsConfig is null */ public JoinConfig setAwsConfig(final AwsConfig awsConfig) { this.awsConfig = isNotNull(awsConfig, "awsConfig"); return this; }
/** * @param eurekaConfig the EurekaConfig join configuration to set * @throws IllegalArgumentException if eurekaConfig is null */ public JoinConfig setEurekaConfig(final EurekaConfig eurekaConfig) { this.eurekaConfig = isNotNull(eurekaConfig, "eurekaConfig"); return this; }
/** * Adds a {@link MemberGroupConfig}. Duplicate elements are not filtered. * * @param memberGroupConfig the MemberGroupConfig to add * @return the updated PartitionGroupConfig * @throws IllegalArgumentException if memberGroupConfig is {@code null} * @see #addMemberGroupConfig(MemberGroupConfig) */ public PartitionGroupConfig addMemberGroupConfig(MemberGroupConfig memberGroupConfig) { memberGroupConfigs.add(isNotNull(memberGroupConfig, "memberGroupConfig")); return this; }
public static <E> E checkInstanceOf(Class<E> type, Object object) { isNotNull(type, "type"); if (!type.isInstance(object)) { throw new IllegalArgumentException(object + " should be instanceof " + type.getName()); } return (E) object; }
@Override public ListenerConfig setImplementation(EventListener implementation) { isNotNull(implementation, "implementation"); this.implementation = toEntryListener(implementation); this.className = null; return this; }
@Override public ListenerConfig setImplementation(EventListener implementation) { isNotNull(implementation, "implementation"); this.implementation = toEntryListener(implementation); this.className = null; return this; }
@Override public InternalCompletableFuture<Void> alterAsync(IFunction<Long, Long> function) { isNotNull(function, "function"); ClientMessage request = AtomicLongAlterCodec.encodeRequest(name, toData(function)); return invokeOnPartitionAsync(request, ALTER_DECODER); }
@Override public String addEntryListener(EntryListener<K, V> listener, final boolean includeValue) { isNotNull(listener, "listener"); EventHandler<ClientMessage> handler = createHandler(listener); return registerListener(createEntryListenerCodec(includeValue), handler); }
@Override public <R> InternalCompletableFuture<R> applyAsync(IFunction<E, R> function) { isNotNull(function, "function"); ClientMessage request = AtomicReferenceApplyCodec.encodeRequest(name, toData(function)); return invokeOnPartitionAsync(request, APPLY_DECODER); }
@Override public <R> InternalCompletableFuture<R> applyAsync(IFunction<E, R> function) { isNotNull(function, "function"); ClientMessage request = AtomicReferenceApplyCodec.encodeRequest(name, toData(function)); return invokeOnPartitionAsync(request, APPLY_DECODER); }
@Override public boolean containsKey(Object key) { ensureQuorumPresent(READ); isNotNull(key, "key"); int partitionId = partitionService.getPartitionId(key); ReplicatedRecordStore store = service.getReplicatedRecordStore(name, false, partitionId); return store != null && store.containsKey(key); }
@Override public String addEntryListener(EntryListener<K, V> listener, K key, final boolean includeValue) { isNotNull(listener, "listener"); final Data keyData = toData(key); EventHandler<ClientMessage> handler = createHandler(listener); return registerListener(createEntryListenerToKeyCodec(includeValue, keyData), handler); }
@Override public <R> InternalCompletableFuture<R> applyAsync(IFunction<E, R> function) { isNotNull(function, "function"); Operation operation = new ApplyOperation(name, toData(function)) .setPartitionId(partitionId); return invokeOnPartition(operation); }
@Override public String addEntryListener(EntryListener<K, V> listener, K key) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); isNotNull(listener, "listener"); final Data keyData = toData(key); EventHandler<ClientMessage> handler = createHandler(listener); return registerListener(createEntryListenerToKeyCodec(keyData), handler); }