Package glide.internal
Class GlideCoreClient
- java.lang.Object
-
- glide.internal.GlideCoreClient
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class GlideCoreClient extends java.lang.Object implements java.lang.AutoCloseableGLIDE core client transport. Provides direct native access to glide-core with all routing and performance optimizations.This class wraps an existing native client handle created by ConnectionManager. It does NOT create connections - that responsibility belongs to ConnectionManager.
-
-
Field Summary
Fields Modifier and Type Field Description static byte[][]EMPTY_2D_BYTE_ARRAYEmpty 2D byte array constant for reuse in various contexts (script params, subPattern, etc.)
-
Constructor Summary
Constructors Constructor Description GlideCoreClient(long existingHandle, int maxInflight)Constructor that wraps an existing native client handle (for BaseClient integration).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the client and cleanup all resourcesjava.util.concurrent.CompletableFuture<java.lang.Object>executeBatchAsync(byte[] batchRequestBytes, boolean expectUtf8Response)Execute batch asynchronously using raw protobuf bytes (for compatibility with CommandManager)java.util.concurrent.CompletableFuture<java.lang.Object>executeBinaryCommandAsync(byte[] requestBytes)Execute binary command asynchronously using raw protobuf bytes (for compatibility with CommandManager)java.util.concurrent.CompletableFuture<java.lang.Object>executeClusterScanAsync(java.lang.String cursorId, java.lang.String matchPattern, long count, java.lang.String objectType, boolean expectUtf8Response)Execute cluster scan asynchronously with proper cursor lifecycle managementjava.util.concurrent.CompletableFuture<java.lang.Object>executeCommandAsync(byte[] requestBytes)Execute command asynchronously using raw protobuf bytes (for compatibility with CommandManager)java.util.concurrent.CompletableFuture<java.lang.Object>executeScriptAsync(java.lang.String hash, byte[][] keys, byte[][] args, boolean hasRoute, int routeType, java.lang.String routeParam, boolean expectUtf8Response)Execute script via native invoke_script pathjava.lang.StringgetClientInfo()Get client information for debugging and monitoring.intgetMaxInflightRequests()longgetNativeHandle()intgetPendingOperations()Get the number of pending async operations.booleanisConnected()Check if client is connected.booleanisHealthy()Health check to detect if client is working properlyjava.util.concurrent.CompletableFuture<java.lang.String>refreshIamToken()Refresh IAM token (for compatibility with CommandManager)static voidregisterClient(long handle, BaseClient client)static voidunregisterClient(long handle)java.util.concurrent.CompletableFuture<java.lang.String>updateConnectionPassword(java.lang.String password, boolean immediateAuth)Update connection password (for compatibility with CommandManager)
-
-
-
Method Detail
-
registerClient
public static void registerClient(long handle, BaseClient client)
-
unregisterClient
public static void unregisterClient(long handle)
-
getNativeHandle
public long getNativeHandle()
-
getMaxInflightRequests
public int getMaxInflightRequests()
-
executeBinaryCommandAsync
public java.util.concurrent.CompletableFuture<java.lang.Object> executeBinaryCommandAsync(byte[] requestBytes)
Execute binary command asynchronously using raw protobuf bytes (for compatibility with CommandManager)
-
executeCommandAsync
public java.util.concurrent.CompletableFuture<java.lang.Object> executeCommandAsync(byte[] requestBytes)
Execute command asynchronously using raw protobuf bytes (for compatibility with CommandManager)
-
executeBatchAsync
public java.util.concurrent.CompletableFuture<java.lang.Object> executeBatchAsync(byte[] batchRequestBytes, boolean expectUtf8Response)Execute batch asynchronously using raw protobuf bytes (for compatibility with CommandManager)
-
executeClusterScanAsync
public java.util.concurrent.CompletableFuture<java.lang.Object> executeClusterScanAsync(java.lang.String cursorId, java.lang.String matchPattern, long count, java.lang.String objectType, boolean expectUtf8Response)Execute cluster scan asynchronously with proper cursor lifecycle management
-
updateConnectionPassword
public java.util.concurrent.CompletableFuture<java.lang.String> updateConnectionPassword(java.lang.String password, boolean immediateAuth)Update connection password (for compatibility with CommandManager)
-
refreshIamToken
public java.util.concurrent.CompletableFuture<java.lang.String> refreshIamToken()
Refresh IAM token (for compatibility with CommandManager)
-
executeScriptAsync
public java.util.concurrent.CompletableFuture<java.lang.Object> executeScriptAsync(java.lang.String hash, byte[][] keys, byte[][] args, boolean hasRoute, int routeType, java.lang.String routeParam, boolean expectUtf8Response)Execute script via native invoke_script path
-
isConnected
public boolean isConnected()
Check if client is connected.
-
getClientInfo
public java.lang.String getClientInfo()
Get client information for debugging and monitoring.
-
getPendingOperations
public int getPendingOperations()
Get the number of pending async operations.
-
isHealthy
public boolean isHealthy()
Health check to detect if client is working properly
-
close
public void close()
Close the client and cleanup all resources- Specified by:
closein interfacejava.lang.AutoCloseable
-
-