org.apache.avro.message

## 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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.avro.message.SchemaStore

      `SchemaStore.Cache`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Cache()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSchema(Schema schema)` Adds a schema to this cache that can be retrieved using its AVRO-CRC-64 fingerprint.
    `Schema` | `findByFingerprint(long fingerprint)` Retrieves a fingerprint by its AVRO-CRC-64 fingerprint.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Cache

          public Cache()

  - ### Method Detail

    - #### 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

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.