public NearCachePreloaderConfig setStoreIntervalSeconds(int storeIntervalSeconds) { this.storeIntervalSeconds = checkPositive(storeIntervalSeconds, "storeIntervalSeconds must be a positive number!"); return this; }
/** * Sets the timeout in Milliseconds before declaring a failed ping * This cannot be more than the interval value. Should always be smaller. * * @param timeoutMilliseconds the timeout for each ping in millis * @return this {@link IcmpFailureDetectorConfig} instance */ public IcmpFailureDetectorConfig setTimeoutMilliseconds(int timeoutMilliseconds) { checkPositive(timeoutMilliseconds, "Timeout must be a positive value"); this.timeoutMilliseconds = timeoutMilliseconds; return this; }
/** * Sets validation timeout for hot-restart process, includes validating * cluster members expected to join and partition table on all cluster. * * @param validationTimeoutSeconds validation timeout in seconds * @return HotRestartPersistenceConfig */ public HotRestartPersistenceConfig setValidationTimeoutSeconds(int validationTimeoutSeconds) { checkPositive(validationTimeoutSeconds, "Validation timeout should be positive!"); this.validationTimeoutSeconds = validationTimeoutSeconds; return this; }
/** * Sets the capacity of the ringbuffer. * * @param capacity the capacity * @return the updated Config * @throws java.lang.IllegalArgumentException if capacity smaller than 1 * @see #getCapacity() */ public RingbufferConfig setCapacity(int capacity) { this.capacity = checkPositive(capacity, "capacity can't be smaller than 1"); return this; }
/** * Sets the number of executor threads per member for the executor. * * @param poolSize the number of executor threads per member for the executor * @return this executor config instance */ public ScheduledExecutorConfig setPoolSize(int poolSize) { this.poolSize = checkPositive(poolSize, "Pool size should be greater than 0"); return this; }
/** * Sets the batch size which will be used to determine number of events to be sent in a batch to {@code QueryCache} * * @param batchSize the batch size * @return this {@code QueryCacheConfig} instance */ public QueryCacheConfig setBatchSize(int batchSize) { this.batchSize = checkPositive(batchSize, "batchSize"); return this; }
/** * Sets the ring buffer capacity of the executor task. * * @param capacity Ring Buffer capacity of the executor task * @return this executor config instance */ public DurableExecutorConfig setCapacity(int capacity) { this.capacity = checkPositive(capacity, "Capacity should be greater than 0"); return this; }
public AccumulatorConsumerOperation(Queue<Accumulator> accumulators, int maxProcessableAccumulatorCount) { checkPositive(maxProcessableAccumulatorCount, "maxProcessableAccumulatorCount"); this.accumulators = accumulators; this.maxProcessableAccumulatorCount = maxProcessableAccumulatorCount; }
public AbstractCallIdSequence(int maxConcurrentInvocations) { checkPositive(maxConcurrentInvocations, "maxConcurrentInvocations should be a positive number. maxConcurrentInvocations=" + maxConcurrentInvocations); this.maxConcurrentInvocations = maxConcurrentInvocations; }
/** * Sets the number of Hot Restart store instances to create for one Hazelcast instance. */ public HotRestartPersistenceConfig setParallelism(int parallelism) { checkPositive(parallelism, "Palallelism must be a positive integer"); this.parallelism = parallelism; return this; }
/** * Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation. * <p> * Must be a positive number. Set to {@code 1} to disable batching. The default value is {@value #DEFAULT_BATCH_SIZE}. * * @param batchSize the batch size * @return this {@code MergePolicyConfig} instance */ public MergePolicyConfig setBatchSize(int batchSize) { this.batchSize = checkPositive(batchSize, "batchSize must be a positive number!"); return this; }
/** * Sets the number of threads each cluster member will use to execute Jet * jobs. This refers only to threads executing <em>cooperative</em> * processors; each <em>blocking</em> processor is assigned its own thread. */ @Nonnull public InstanceConfig setCooperativeThreadCount(int size) { checkPositive(size, "cooperativeThreadCount should be a positive number"); this.cooperativeThreadCount = size; return this; }
SlidingWindowDef(long windowSize, long slideBy) { checkPositive(windowSize, "windowSize must be positive"); checkPositive(slideBy, "slideBy must be positive"); checkTrue(windowSize % slideBy == 0, "windowSize must be integer multiple of slideBy, mod(" + windowSize + ", " + slideBy + ") != 0"); this.windowSize = windowSize; this.slideBy = slideBy; }
@Override public void init(Properties properties) { securityProvider = properties.getProperty(PROPERTY_SECURITY_PROVIDER); cipherAlgorithm = properties.getProperty(PROPERTY_CIPHER_ALGORITHM, DEFAULT_CIPHER_ALGORITHM); secretKeyFactoryAlgorithm = properties.getProperty(PROPERTY_SECRET_KEY_FACTORY_ALGORITHM, DEFAULT_SECRET_KEY_FACTORY_ALGORITHM); secretKeyAlgorithm = properties.getProperty(PROPERTY_SECRET_KEY_ALGORITHM, DEFAULT_CIPHER_ALGORITHM); keyLengthBits = Integer.parseInt(properties.getProperty(PROPERTY_KEY_LENGTH_BITS, "128")); saltLengthBytes = Integer.parseInt(properties.getProperty(PROPERTY_SALT_LENGTH_BYTES, "8")); checkPositive(keyLengthBits, "Key length has to be positive number"); checkPositive(saltLengthBytes, "Salt length has to be positive number"); }
SlidingWindowPolicy(long frameSize, long frameOffset, long framesPerWindow) { checkPositive(frameSize, "frameLength must be positive"); checkNotNegative(frameOffset, "frameOffset must not be negative"); checkTrue(frameOffset < frameSize, "frameOffset must be less than frameSize, offset=" + frameOffset + ", size=" + frameSize); checkPositive(framesPerWindow, "framesPerWindow must be positive"); this.frameSize = frameSize; this.frameOffset = frameOffset; this.windowSize = frameSize * framesPerWindow; }
@Override public void lock(long leaseTime, TimeUnit timeUnit) { checkPositive(leaseTime, "leaseTime should be positive"); lockSupport.lock(getNodeEngine(), key, timeUnit.toMillis(leaseTime)); }
public Invalidation(String dataStructureName, String sourceUuid, UUID partitionUuid, long sequence) { this.dataStructureName = checkNotNull(dataStructureName, "dataStructureName cannot be null"); // sourceUuid can be null. this.sourceUuid = sourceUuid; this.partitionUuid = checkNotNull(partitionUuid, "partitionUuid cannot be null"); this.sequence = checkPositive(sequence, "sequence should be positive"); }
@Override public E get(long sequence) { checkPositive(sequence, "sequence"); int index = findIndex(sequence); E e = buffer[index]; if (e != null && e.getSequence() != sequence) { return null; } return e; }
@Override public void lock(long leaseTime, TimeUnit timeUnit) { checkPositive(leaseTime, "leaseTime should be positive"); ClientMessage request = LockLockCodec.encodeRequest(name, getTimeInMillis(leaseTime, timeUnit), ThreadUtil.getThreadId(), referenceIdGenerator.getNextReferenceId()); invokeOnPartition(request, Long.MAX_VALUE); }
@Override public void lock(K key, long leaseTime, TimeUnit timeUnit) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkPositive(leaseTime, "leaseTime should be positive"); final Data keyData = toData(key); ClientMessage request = MultiMapLockCodec .encodeRequest(name, keyData, ThreadUtil.getThreadId(), getTimeInMillis(leaseTime, timeUnit), lockReferenceIdGenerator.getNextReferenceId()); invoke(request, keyData); }