Interface NativeAccess


public interface NativeAccess
Provides access to native functionality needed by Elastisearch.
  • Method Details

    • instance

      static NativeAccess instance()
      Get the one and only instance of NativeAccess which is specific to the running platform and JVM.
    • definitelyRunningAsRoot

      boolean definitelyRunningAsRoot()
      Determine whether this JVM is running as the root user.
      Returns:
      true if running as root, or false if unsure
    • getProcessLimits

      ProcessLimits getProcessLimits()
      Return limits for the current process.
    • tryLockMemory

      void tryLockMemory()
      Attempt to lock this process's virtual memory address space into physical RAM.
    • isMemoryLocked

      boolean isMemoryLocked()
      Return whether locking memory was successful, or false otherwise.
    • tryInstallExecSandbox

      void tryInstallExecSandbox()
      Attempts to install a system call filter to block process execution.
    • getExecSandboxState

      NativeAccess.ExecSandboxState getExecSandboxState()
      Return whether installing the exec system call filters was successful, and to what degree.
    • systemd

      Systemd systemd()
    • getZstd

      Zstd getZstd()
      Returns an accessor to zstd compression functions.
      Returns:
      an object used to compress and decompress bytes using zstd
    • allocatedSizeInBytes

      OptionalLong allocatedSizeInBytes(Path path)
      Retrieves the actual number of bytes of disk storage used to store a specified file.
      Parameters:
      path - the path to the file
      Returns:
      an OptionalLong that contains the number of allocated bytes on disk for the file, or empty if the size is invalid
    • tryPreallocate

      void tryPreallocate(Path file, long size)
    • getWindowsFunctions

      default WindowsFunctions getWindowsFunctions()
      Returns an accessor for native functions only available on Windows, or null if not on Windows.
    • getVectorSimilarityFunctions

      Optional<VectorSimilarityFunctions> getVectorSimilarityFunctions()
    • newBuffer

      CloseableByteBuffer newBuffer(int len)
      Creates a new CloseableByteBuffer. The buffer must be used within the same thread that it is created.
      Parameters:
      len - the number of bytes the buffer should allocate
      Returns:
      the buffer