Class CallerContext.Builder

java.lang.Object
org.apache.hadoop.ipc.CallerContext.Builder
Enclosing class:
CallerContext

public static final class CallerContext.Builder extends Object
The caller context builder.
  • Field Details

  • Constructor Details

  • Method Details

    • setSignature

      public CallerContext.Builder setSignature(byte[] signature)
    • getContext

      public String getContext()
      Get the context. For example, the context is "key1:value1,key2:value2".
      Returns:
      the valid context or null.
    • getSignature

      public byte[] getSignature()
      Get the signature.
      Returns:
      the signature.
    • append

      public CallerContext.Builder append(String field)
      Append new field to the context.
      Parameters:
      field - one of fields to append.
      Returns:
      the builder.
    • append

      public CallerContext.Builder append(String key, String value)
      Append new field which contains key and value to the context.
      Parameters:
      key - the key of field.
      value - the value of field.
      Returns:
      the builder.
    • appendIfAbsent

      public CallerContext.Builder appendIfAbsent(String key, String value)
      Append new field which contains key and value to the context if the key("key:") is absent.
      Parameters:
      key - the key of field.
      value - the value of field.
      Returns:
      the builder.
    • build

      public CallerContext build()