Class MetadataAdapter

java.lang.Object
org.apache.arrow.flight.grpc.MetadataAdapter
All Implemented Interfaces:
CallHeaders

public class MetadataAdapter extends Object implements CallHeaders
A mutable adapter between the gRPC Metadata object and the Flight headers interface.

This allows us to present the headers (metadata) from gRPC without copying to/from our own object.

  • Constructor Details

    • MetadataAdapter

      public MetadataAdapter(io.grpc.Metadata metadata)
  • Method Details

    • get

      public String get(String key)
      Description copied from interface: CallHeaders
      Get the value of a metadata key. If multiple values are present, then get the last one.
      Specified by:
      get in interface CallHeaders
    • getByte

      public byte[] getByte(String key)
      Description copied from interface: CallHeaders
      Get the value of a metadata key. If multiple values are present, then get the last one.
      Specified by:
      getByte in interface CallHeaders
    • getAll

      public Iterable<String> getAll(String key)
      Description copied from interface: CallHeaders
      Get all values present for the given metadata key.
      Specified by:
      getAll in interface CallHeaders
    • getAllByte

      public Iterable<byte[]> getAllByte(String key)
      Description copied from interface: CallHeaders
      Get all values present for the given metadata key.
      Specified by:
      getAllByte in interface CallHeaders
    • insert

      public void insert(String key, String value)
      Description copied from interface: CallHeaders
      Insert a metadata pair with the given value.

      Duplicate metadata are permitted.

      Specified by:
      insert in interface CallHeaders
    • insert

      public void insert(String key, byte[] value)
      Description copied from interface: CallHeaders
      Insert a metadata pair with the given value.

      Duplicate metadata are permitted.

      Specified by:
      insert in interface CallHeaders
    • keys

      public Set<String> keys()
      Description copied from interface: CallHeaders
      Get a set of all the metadata keys.
      Specified by:
      keys in interface CallHeaders
    • containsKey

      public boolean containsKey(String key)
      Description copied from interface: CallHeaders
      Check whether the given metadata key is present.
      Specified by:
      containsKey in interface CallHeaders
    • toString

      public String toString()
      Overrides:
      toString in class Object