Class GlideCoreClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class GlideCoreClient
    extends java.lang.Object
    implements java.lang.AutoCloseable
    GLIDE 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_ARRAY
      Empty 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
      void close()
      Close the client and cleanup all resources
      java.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 management
      java.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 path
      java.lang.String getClientInfo()
      Get client information for debugging and monitoring.
      int getMaxInflightRequests()  
      long getNativeHandle()  
      int getPendingOperations()
      Get the number of pending async operations.
      boolean isConnected()
      Check if client is connected.
      boolean isHealthy()
      Health check to detect if client is working properly
      java.util.concurrent.CompletableFuture<java.lang.String> refreshIamToken()
      Refresh IAM token (for compatibility with CommandManager)
      static void registerClient​(long handle, BaseClient client)  
      static void unregisterClient​(long handle)  
      java.util.concurrent.CompletableFuture<java.lang.String> updateConnectionPassword​(java.lang.String password, boolean immediateAuth)
      Update connection password (for compatibility with CommandManager)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY_2D_BYTE_ARRAY

        public static final byte[][] EMPTY_2D_BYTE_ARRAY
        Empty 2D byte array constant for reuse in various contexts (script params, subPattern, etc.)
    • Constructor Detail

      • GlideCoreClient

        public GlideCoreClient​(long existingHandle,
                               int maxInflight)
        Constructor that wraps an existing native client handle (for BaseClient integration). This is the ONLY constructor - GlideCoreClient does not create connections.
    • 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:
        close in interface java.lang.AutoCloseable