congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GridUnsafeMemory.compare
Code IndexAdd Tabnine to your IDE (free)

How to use
compare
method
in
org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory

Best Java code snippets using org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory.compare (Showing top 7 results out of 315)

origin: apache/ignite

/**
 * Compares memory.
 *
 * @param ptr Pointer.
 * @param bytes Bytes to compare.
 * @return {@code True} if equals.
 */
public static boolean compare(long ptr, byte[] bytes) {
  return compare(ptr, bytes, 0, bytes.length);
}
origin: apache/ignite

  /**
   * Checks if keys are equal.
   *
   * @param ptr Pointer.
   * @param keyBytes Key bytes to compare.
   * @param mem Memory.
   * @return {@code True} if equal.
   */
  static boolean keyEquals(long ptr, byte[] keyBytes, GridUnsafeMemory mem) {
    long len = readKeyLength(ptr, mem);
    return len == keyBytes.length && GridUnsafeMemory.compare(ptr + HEADER_SIZE, keyBytes);
  }
}
origin: apache/ignite

/**
 * @param s String.
 * @throws Exception If failed.
 */
public void checkCompare(String s) throws Exception {
  byte[] bytes = s.getBytes();
  int size = bytes.length + 8;
  GridUnsafeMemory mem = new GridUnsafeMemory(size);
  for (int i = 0; i < 8; i++) {
    long addr = mem.allocate(size);
    long ptr = addr + i;
    try {
      mem.writeBytes(ptr, bytes);
      assert mem.compare(ptr, bytes);
      byte[] read = mem.readBytes(ptr, bytes.length);
      assert Arrays.equals(bytes, read);
    }
    finally {
      mem.release(addr, size);
    }
  }
}
origin: apache/ignite

if (c2.offheap())
  return GridUnsafeMemory.compare(c1.curFieldPos + c1.ptr + off, c2.curFieldPos + c2.ptr + off, len);
origin: org.apache.ignite/ignite-core

/**
 * Compares memory.
 *
 * @param ptr Pointer.
 * @param bytes Bytes to compare.
 * @return {@code True} if equals.
 */
public static boolean compare(long ptr, byte[] bytes) {
  return compare(ptr, bytes, 0, bytes.length);
}
origin: org.apache.ignite/ignite-core

  /**
   * Checks if keys are equal.
   *
   * @param ptr Pointer.
   * @param keyBytes Key bytes to compare.
   * @param mem Memory.
   * @return {@code True} if equal.
   */
  static boolean keyEquals(long ptr, byte[] keyBytes, GridUnsafeMemory mem) {
    long len = readKeyLength(ptr, mem);
    return len == keyBytes.length && GridUnsafeMemory.compare(ptr + HEADER_SIZE, keyBytes);
  }
}
origin: org.apache.ignite/ignite-core

if (c2.offheap())
  return GridUnsafeMemory.compare(c1.curFieldPos + c1.ptr + off, c2.curFieldPos + c2.ptr + off, len);
org.apache.ignite.internal.util.offheap.unsafeGridUnsafeMemorycompare

Popular methods of GridUnsafeMemory

  • allocate
    Allocates memory of given size in bytes.
  • <init>
  • readByte
  • readBytes
  • release
    Releases memory at the given address.
  • writeByte
  • allocatedSize
  • casLong
  • readInt
  • readLong
  • readShort
  • writeBytes
    Writes part of byte array into memory location.
  • readShort,
  • writeBytes,
  • writeInt,
  • writeLong,
  • writeShort,
  • copyMemory,
  • readDouble,
  • readFloat,
  • readLongVolatile

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JFrame (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim 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