Class AbstractAvroStoreClient<K,​V>

    • Field Detail

      • needSchemaReader

        protected final boolean needSchemaReader
      • multiGetRequestSerializer

        protected RecordSerializer<java.nio.ByteBuffer> multiGetRequestSerializer
      • computeRequestClientKeySerializer

        protected RecordSerializer<java.nio.ByteBuffer> computeRequestClientKeySerializer
    • Constructor Detail

      • AbstractAvroStoreClient

        protected AbstractAvroStoreClient​(TransportClient transportClient,
                                          boolean needSchemaReader,
                                          ClientConfig clientConfig)
    • Method Detail

      • getDefaultDeserializationExecutor

        public static java.util.concurrent.Executor getDefaultDeserializationExecutor()
      • getStoreName

        public java.lang.String getStoreName()
      • getClientConfig

        protected final ClientConfig getClientConfig()
      • getSchemaReader

        protected SchemaReader getSchemaReader()
      • getComputeRequestPath

        protected java.lang.String getComputeRequestPath()
      • setAsyncStoreInitSleepIntervalMs

        public void setAsyncStoreInitSleepIntervalMs​(long intervalMs)
      • getKeySerializerForRequest

        protected RecordSerializer<K> getKeySerializerForRequest()
        This function will try to initialize the store client at most once in a blocking fashion, and if the init fails, one async thread will be kicked off to init the store client periodically until the init succeeds.
      • getKeySerializerWithoutRetry

        protected RecordSerializer<K> getKeySerializerWithoutRetry()
      • init

        protected void init()
        During the initialization, we do the cluster discovery at first to find the real end point this client need to talk to, before initializing the serializer. So if sub-implementation needs to have its own serializer, please override the createKeySerializer method.
      • createKeySerializer

        protected RecordSerializer<K> createKeySerializer()
        Clients using different protocols for deserialized data (e.g VSON, Proto, etc) can override this method to serialize the respective POJO to Avro bytes
        A serializer for key objects to Avro bytes
      • getRaw

        public java.util.concurrent.CompletableFuture<byte[]> getRaw​(java.lang.String requestPath,
                                                                     java.util.Optional<ClientStats> stats,
                                                                     long preRequestTimeInNS)
        Specified by:
        getRaw in class InternalAvroStoreClient<K,​V>
      • tryToDeserializeWithVerboseLogging

        public static <T,​K> T tryToDeserializeWithVerboseLogging​(RecordDeserializer<T> dataDeserializer,
                                                                       java.nio.ByteBuffer data,
                                                                       int writerSchemaId,
                                                                       K key,
                                                                       RecordSerializer<K> keySerializer,
                                                                       SchemaReader schemaReader,
                                                                       org.apache.logging.log4j.Logger LOGGER)
      • isProjectionFieldValidationEnabled

        public boolean isProjectionFieldValidationEnabled()
      • close

        public void close()
        The behavior of READ apis will be non-deterministic after `close` function is called.
      • getReaderSchema

        protected java.util.Optional<org.apache.avro.Schema> getReaderSchema()
      • getStoreClientForSchemaReader

        protected abstract AbstractAvroStoreClient<K,​V> getStoreClientForSchemaReader()
        To avoid cycle dependency, we need to initialize another store client for schema reader.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • getKeySchema

        public org.apache.avro.Schema getKeySchema()
        Description copied from interface: AvroGenericStoreClient
        Get key schema.
      • getLatestValueSchema

        public org.apache.avro.Schema getLatestValueSchema()
        Description copied from interface: AvroGenericStoreClient
        Get the latest value schema known in current store client. This function doesn't guarantee it will return the latest schema if you add a new value schema when current store client is running.
      • handleCallbackForEmptyKeySet

        protected static boolean handleCallbackForEmptyKeySet​(java.util.Collection<?> keys,
                                                              StreamingCallback callback)