All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aerospike.client.policy.BatchPolicy Maven / Gradle / Ivy

Go to download

Aerospike Java client interface to Aerospike database server. Uses Bouncy Castle crypto library for RIPEMD-160 hashing.

There is a newer version: 9.0.2
Show newest version
/*
 * Copyright 2012-2024 Aerospike, Inc.
 *
 * Portions may be licensed to Aerospike, Inc. under one or more contributor
 * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.aerospike.client.policy;

/**
 * Batch parent policy.
 */
public final class BatchPolicy extends Policy {
	/**
	 * This field is ignored and deprecated. Sync batch node commands are now always issued using
	 * virtual threads in parallel. Async batch node commands always ignored this field. This field
	 * only exists to maintain api compatibility when switching between aerospike-client-jdk21 and
	 * aerospike-client-jdk8 packages.
	 */
	@Deprecated
	public int maxConcurrentThreads = 1;

	/**
	 * Allow batch to be processed immediately in the server's receiving thread for in-memory
	 * namespaces. If false, the batch will always be processed in separate service threads.
	 * 

* For batch transactions with smaller sized records (<= 1K per record), inline * processing will be significantly faster on in-memory namespaces. *

* Inline processing can introduce the possibility of unfairness because the server * can process the entire batch before moving onto the next command. *

* Default: true */ public boolean allowInline = true; /** * Allow batch to be processed immediately in the server's receiving thread for SSD * namespaces. If false, the batch will always be processed in separate service threads. * Server versions < 6.0 ignore this field. *

* Inline processing can introduce the possibility of unfairness because the server * can process the entire batch before moving onto the next command. *

* Default: false */ public boolean allowInlineSSD = false; /** * Should all batch keys be attempted regardless of errors. This field is used on both * the client and server. The client handles node specific errors and the server handles * key specific errors. *

* If true, every batch key is attempted regardless of previous key specific errors. * Node specific errors such as timeouts stop keys to that node, but keys directed at * other nodes will continue to be processed. *

* If false, the server will stop the batch to its node on most key specific errors. * The exceptions are {@link com.aerospike.client.ResultCode#KEY_NOT_FOUND_ERROR} and * {@link com.aerospike.client.ResultCode#FILTERED_OUT} which never stop the batch. *

* Server versions < 6.0 do not support this field and treat this value as false * for key specific errors. *

* Default: true */ public boolean respondAllKeys = true; /** * This method is deprecated and will eventually be removed. * The set name is now always sent for every distinct namespace/set in the batch. *

* Send set name field to server for every key in the batch for batch index protocol. * This is necessary for batch writes and batch reads when authentication is enabled and * security roles are defined on a per set basis. *

* Default: false */ @Deprecated public boolean sendSetName; /** * Copy batch policy from another batch policy. */ public BatchPolicy(BatchPolicy other) { super(other); this.maxConcurrentThreads = other.maxConcurrentThreads; this.allowInline = other.allowInline; this.allowInlineSSD = other.allowInlineSSD; this.respondAllKeys = other.respondAllKeys; this.sendSetName = other.sendSetName; } /** * Copy batch policy from another policy. */ public BatchPolicy(Policy other) { super(other); } /** * Default constructor. */ public BatchPolicy() { } /** * Default batch read policy. */ public static BatchPolicy ReadDefault() { return new BatchPolicy(); } /** * Default batch write policy. */ public static BatchPolicy WriteDefault() { BatchPolicy policy = new BatchPolicy(); policy.maxRetries = 0; return policy; } // Include setters to facilitate Spring's ConfigurationProperties. public void setMaxConcurrentThreads(int maxConcurrentThreads) { this.maxConcurrentThreads = maxConcurrentThreads; } public void setAllowInline(boolean allowInline) { this.allowInline = allowInline; } public void setAllowInlineSSD(boolean allowInlineSSD) { this.allowInlineSSD = allowInlineSSD; } public void setRespondAllKeys(boolean respondAllKeys) { this.respondAllKeys = respondAllKeys; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy