Tabnine Logo
Operation.getHeader
Code IndexAdd Tabnine to your IDE (free)

How to use
getHeader
method
in
com.aerospike.client.Operation

Best Java code snippets using com.aerospike.client.Operation.getHeader (Showing top 3 results out of 315)

origin: spring-projects/spring-data-aerospike

@Override
public boolean exists(Serializable id, Class<?> type) {
  Assert.notNull(id, "Id must not be null!");
  Assert.notNull(type, "Type must not be null!");
  try {
    AerospikePersistentEntity<?> entity = mappingContext.getPersistentEntity(type);
    Key key = getKey(id, entity);
    Record record = this.client.operate(null, key, Operation.getHeader());
    return record != null;
  } catch (AerospikeException e) {
    DataAccessException translatedException = exceptionTranslator.translateExceptionIfPossible(e);
    throw translatedException == null ? e : translatedException;
  }
}
origin: aerospike/aerospike-client-java

Record record = client.operate(writePolicy, key, Operation.touch(), Operation.getHeader());
origin: spring-projects/spring-data-aerospike

private void doPersistWithCas(Object document, AerospikePersistentEntity<?> entity) {
  try {
    AerospikeWriteData data = AerospikeWriteData.forWrite();
    converter.write(document, data);
    Key key = data.getKey();
    Bin[] bins = data.getBinsAsArray();
    ConvertingPropertyAccessor accessor = getPropertyAccessor(entity, document);
    WritePolicy policy = getCasAwareWritePolicy(data, entity, accessor);
    Operation[] operations = OperationUtils.operations(bins, Operation::put, Operation.getHeader());
    Record newRecord = client.operate(policy, key, operations);
    accessor.setProperty(entity.getVersionProperty(), newRecord.generation);
  } catch (AerospikeException e) {
    int code = e.getResultCode();
    if (code == ResultCode.KEY_EXISTS_ERROR || code == ResultCode.GENERATION_ERROR) {
      throw new OptimisticLockingFailureException("Save document with version value failed", e);
    }
    DataAccessException translatedException = exceptionTranslator.translateExceptionIfPossible(e);
    throw translatedException == null ? e : translatedException;
  }
}
com.aerospike.clientOperationgetHeader

Javadoc

Create read record header database operation.

Popular methods of Operation

  • add
  • get
  • put
  • touch
  • append
  • prepend
  • <init>

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now