Class SchemaStore.Cache

java.lang.Object
org.apache.avro.message.SchemaStore.Cache
All Implemented Interfaces:
SchemaStore
Enclosing interface:
SchemaStore

public static class SchemaStore.Cache extends Object implements SchemaStore
A map-based cache of schemas by AVRO-CRC-64 fingerprint.

This class is thread-safe.

  • Constructor Details

    • Cache

      public Cache()
  • Method Details

    • addSchema

      public void addSchema(Schema schema)
      Adds a schema to this cache that can be retrieved using its AVRO-CRC-64 fingerprint.
      Parameters:
      schema - a Schema
    • findByFingerprint

      public Schema findByFingerprint(long fingerprint)
      Description copied from interface: SchemaStore
      Retrieves a fingerprint by its AVRO-CRC-64 fingerprint.
      Specified by:
      findByFingerprint in interface SchemaStore
      Parameters:
      fingerprint - an AVRO-CRC-64 fingerprint long
      Returns:
      a Schema with the given fingerprint, or null