public interface NativeAccess
Provides access to native functionality needed by Elastisearch.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether this JVM is running as the root user.Return limits for the current process.default WindowsFunctions
Returns an accessor for native functions only available on Windows, ornull
if not on Windows.getZstd()
Returns an accessor to zstd compression functions.static NativeAccess
instance()
Get the one and only instance ofNativeAccess
which is specific to the running platform and JVM.boolean
Return whether locking memory was successful, or false otherwise.newBuffer
(int len) Creates a newCloseableByteBuffer
.systemd()
void
Attempt to lock this process's virtual memory address space into physical RAM.
-
Method Details
-
instance
Get the one and only instance ofNativeAccess
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. -
systemd
Systemd systemd() -
getZstd
Zstd getZstd()Returns an accessor to zstd compression functions.- Returns:
- an object used to compress and decompress bytes using zstd
-
getWindowsFunctions
Returns an accessor for native functions only available on Windows, ornull
if not on Windows. -
getVectorSimilarityFunctions
Optional<VectorSimilarityFunctions> getVectorSimilarityFunctions() -
newBuffer
Creates a newCloseableByteBuffer
. 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
-