/** * Enables / disables throwing {@link IndeterminateOperationStateException} for this invocation. * Can be used only for partition invocations * @see IndeterminateOperationStateException * * @return the InvocationBuilder */ public InvocationBuilder setFailOnIndeterminateOperationState(boolean failOnIndeterminateOperationState) { checkFalse((failOnIndeterminateOperationState && partitionId == GENERIC_PARTITION_ID), "failOnIndeterminateOperationState can be used with only partition invocations"); this.failOnIndeterminateOperationState = failOnIndeterminateOperationState; return this; }
/** * Enables / disables throwing {@link IndeterminateOperationStateException} for this invocation. * Can be used only for partition invocations * @see IndeterminateOperationStateException * * @return the InvocationBuilder */ public InvocationBuilder setFailOnIndeterminateOperationState(boolean failOnIndeterminateOperationState) { checkFalse((failOnIndeterminateOperationState && partitionId == GENERIC_PARTITION_ID), "failOnIndeterminateOperationState can be used with only partition invocations"); this.failOnIndeterminateOperationState = failOnIndeterminateOperationState; return this; }
public MultiAttributeProjection(String... attributePath) { if (attributePath == null || attributePath.length == 0) { throw new IllegalArgumentException("You need to specify at least one attributePath"); } for (String path : attributePath) { checkHasText(path, "attributePath must not be null or empty"); checkFalse(path.contains("[any]"), "attributePath must not contain [any] operators"); } this.attributePaths = attributePath; }
public MultiAttributeProjection(String... attributePath) { if (attributePath == null || attributePath.length == 0) { throw new IllegalArgumentException("You need to specify at least one attributePath"); } for (String path : attributePath) { checkHasText(path, "attributePath must not be null or empty"); checkFalse(path.contains("[any]"), "attributePath must not contain [any] operators"); } this.attributePaths = attributePath; }
public PutFromLoadAllOperation(String name, List<Data> keyValueSequence) { super(name); checkFalse(isEmpty(keyValueSequence), "key-value sequence cannot be empty or null"); this.keyValueSequence = keyValueSequence; }
@Override public void init(Properties properties) { super.init(properties); passwordFile = properties.getProperty(PROPERTY_PASSWORD_FILE); passwordUserProperties = Boolean.parseBoolean(properties.getProperty(PROPERTY_PASSWORD_USER_PROPERTIES, "true")); passwordNetworkInterface = properties.getProperty(PROPERTY_PASSWORD_NETWORK_INTERFACE); checkFalse(passwordFile == null && passwordNetworkInterface == null && !passwordUserProperties, "At least one of the properties used to generate encryption password has to be configured"); }
public SingleAttributeProjection(String attributePath) { checkHasText(attributePath, "attributePath must not be null or empty"); checkFalse(attributePath.contains("[any]"), "attributePath must not contain [any] operators"); this.attributePath = attributePath; }
@Override public void init(Properties properties) { super.init(properties); passwordFile = properties.getProperty(PROPERTY_PASSWORD_FILE); passwordUserProperties = Boolean.parseBoolean(properties.getProperty(PROPERTY_PASSWORD_USER_PROPERTIES, "true")); passwordNetworkInterface = properties.getProperty(PROPERTY_PASSWORD_NETWORK_INTERFACE); checkFalse(passwordFile == null && passwordNetworkInterface == null && !passwordUserProperties, "At least one of the properties used to generate encryption password has to be configured"); }
/** * Sets memory format of values of entries in {@code QueryCache}. * <p> * Default value is binary. * * @param inMemoryFormat the memory format * @return this {@code QueryCacheConfig} instance */ public QueryCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat) { checkNotNull(inMemoryFormat, "inMemoryFormat cannot be null"); checkFalse(inMemoryFormat == InMemoryFormat.NATIVE, "InMemoryFormat." + inMemoryFormat + " is not supported."); this.inMemoryFormat = inMemoryFormat; return this; }
public PutFromLoadAllOperation(String name, List<Data> keyValueSequence) { super(name); checkFalse(isEmpty(keyValueSequence), "key-value sequence cannot be empty or null"); this.keyValueSequence = keyValueSequence; }
public SingleAttributeProjection(String attributePath) { checkHasText(attributePath, "attributePath must not be null or empty"); checkFalse(attributePath.contains("[any]"), "attributePath must not contain [any] operators"); this.attributePath = attributePath; }
/** * Sets memory format of values of entries in {@code QueryCache}. * <p> * Default value is binary. * * @param inMemoryFormat the memory format * @return this {@code QueryCacheConfig} instance */ public QueryCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat) { checkNotNull(inMemoryFormat, "inMemoryFormat cannot be null"); checkFalse(inMemoryFormat == InMemoryFormat.NATIVE, "InMemoryFormat." + inMemoryFormat + " is not supported."); this.inMemoryFormat = inMemoryFormat; return this; }
public ClientConfig addQueryCacheConfig(String mapName, QueryCacheConfig queryCacheConfig) { Map<String, Map<String, QueryCacheConfig>> queryCacheConfigsPerMap = getQueryCacheConfigs(); String queryCacheName = queryCacheConfig.getName(); Map<String, QueryCacheConfig> queryCacheConfigs = queryCacheConfigsPerMap.get(mapName); if (queryCacheConfigs != null) { checkFalse(queryCacheConfigs.containsKey(queryCacheName), "A query cache already exists with name = [" + queryCacheName + ']'); } else { queryCacheConfigs = new ConcurrentHashMap<String, QueryCacheConfig>(); queryCacheConfigsPerMap.put(mapName, queryCacheConfigs); } queryCacheConfigs.put(queryCacheName, queryCacheConfig); return this; }
public ClientConfig addQueryCacheConfig(String mapName, QueryCacheConfig queryCacheConfig) { Map<String, Map<String, QueryCacheConfig>> queryCacheConfigsPerMap = getQueryCacheConfigs(); String queryCacheName = queryCacheConfig.getName(); Map<String, QueryCacheConfig> queryCacheConfigs = queryCacheConfigsPerMap.get(mapName); if (queryCacheConfigs != null) { checkFalse(queryCacheConfigs.containsKey(queryCacheName), "A query cache already exists with name = [" + queryCacheName + ']'); } else { queryCacheConfigs = new ConcurrentHashMap<String, QueryCacheConfig>(); queryCacheConfigsPerMap.put(mapName, queryCacheConfigs); } queryCacheConfigs.put(queryCacheName, queryCacheConfig); return this; }
@Override public int drainTo(Collection<? super E> objects, int i) { checkNotNull(objects, "Collection is null"); checkFalse(this.equals(objects), "Can not drain to same Queue"); final NodeEngine nodeEngine = getNodeEngine(); Collection<Data> dataList = drainInternal(i); for (Data data : dataList) { E e = nodeEngine.toObject(data); objects.add(e); } return dataList.size(); }
@Override public int drainTo(Collection<? super E> objects, int i) { checkNotNull(objects, "Collection is null"); checkFalse(this.equals(objects), "Can not drain to same Queue"); final NodeEngine nodeEngine = getNodeEngine(); Collection<Data> dataList = drainInternal(i); for (Data data : dataList) { E e = nodeEngine.toObject(data); objects.add(e); } return dataList.size(); }
@Override public ICompletableFuture<Long> addAllAsync(Collection<? extends E> collection, OverflowPolicy overflowPolicy) { checkNotNull(collection, "collection can't be null"); checkNotNull(overflowPolicy, "overflowPolicy can't be null"); checkFalse(collection.isEmpty(), "collection can't be empty"); checkTrue(collection.size() <= MAX_BATCH_SIZE, "collection can't be larger than " + MAX_BATCH_SIZE); Operation op = new AddAllOperation(name, toDataArray(collection), overflowPolicy) .setPartitionId(partitionId); OperationService operationService = getOperationService(); return operationService.createInvocationBuilder(null, op, partitionId) .setCallTimeout(Long.MAX_VALUE) .invoke(); }
@Override public ICompletableFuture<Long> addAllAsync(Collection<? extends E> collection, OverflowPolicy overflowPolicy) { checkNotNull(collection, "collection can't be null"); checkNotNull(overflowPolicy, "overflowPolicy can't be null"); checkFalse(collection.isEmpty(), "collection can't be empty"); checkTrue(collection.size() <= MAX_BATCH_SIZE, "collection can't be larger than " + MAX_BATCH_SIZE); Operation op = new AddAllOperation(name, toDataArray(collection), overflowPolicy) .setPartitionId(partitionId); OperationService operationService = getOperationService(); return operationService.createInvocationBuilder(null, op, partitionId) .setCallTimeout(Long.MAX_VALUE) .invoke(); }
@Override public ICompletableFuture<Long> addAllAsync(Collection<? extends E> collection, OverflowPolicy overflowPolicy) { checkNotNull(collection, "collection can't be null"); checkNotNull(overflowPolicy, "overflowPolicy can't be null"); checkFalse(collection.isEmpty(), "collection can't be empty"); checkTrue(collection.size() <= MAX_BATCH_SIZE, "collection can't be larger than " + MAX_BATCH_SIZE); Collection<Data> dataCollection = objectToDataCollection(collection, getSerializationService()); ClientMessage request = RingbufferAddAllCodec.encodeRequest(name, dataCollection, overflowPolicy.getId()); try { ClientInvocationFuture invocationFuture = new ClientInvocation(getClient(), request, getName(), partitionId).invoke(); return new ClientDelegatingFuture<Long>(invocationFuture, getSerializationService(), ADD_ALL_ASYNC_RESPONSE_DECODER); } catch (Exception e) { throw rethrow(e); } }
@Override public ICompletableFuture<Long> addAllAsync(Collection<? extends E> collection, OverflowPolicy overflowPolicy) { checkNotNull(collection, "collection can't be null"); checkNotNull(overflowPolicy, "overflowPolicy can't be null"); checkFalse(collection.isEmpty(), "collection can't be empty"); checkTrue(collection.size() <= MAX_BATCH_SIZE, "collection can't be larger than " + MAX_BATCH_SIZE); Collection<Data> dataCollection = objectToDataCollection(collection, getSerializationService()); ClientMessage request = RingbufferAddAllCodec.encodeRequest(name, dataCollection, overflowPolicy.getId()); try { ClientInvocationFuture invocationFuture = new ClientInvocation(getClient(), request, getName(), partitionId).invoke(); return new ClientDelegatingFuture<Long>(invocationFuture, getSerializationService(), ADD_ALL_ASYNC_RESPONSE_DECODER); } catch (Exception e) { throw rethrow(e); } }