All Superinterfaces:
AutoCloseable, ImmutableTrace, Trace

public interface ClientTrace extends Trace, AutoCloseable
Trace for client side implementations. Compared to other trace implementations it has a different way of creating children. Instead of enriching a child trace within a given scope, the child is returned for the caller to enrich.

The reason for this is that keeping this scope synchronized between client and server is difficult and requires us to keep state in a complex way (because the full trace tree is not necessarily sent at once from server to client).

  • Method Details

    • name

      String name()
      Get the name of the ClientTrace. It should be unique among its siblings.
      Returns:
      the name of the trace
    • newChild

      default Trace newChild(String name, ThrowingConsumer<Trace,IOException> enrichChildCallback) throws IOException
      Implementation which by default throws an exception.
      Specified by:
      newChild in interface Trace
      Parameters:
      name - the name of the child
      enrichChildCallback - consumer that gets the new child trace as input
      Returns:
      nothing
      Throws:
      IOException
    • newChild

      ClientTrace newChild(String name)
      See Trace.newChild(String, ThrowingConsumer), but returns the new child trace.

      Note: clients using this method must take care to save() the returned traces manually.

      Parameters:
      name - the name of the child trace
      Returns:
      the newly created child
    • close

      default void close() throws Exception
      Default implementation which calls save().
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception - if the close failed
    • save

      void save() throws Exception
      Save this child trace in the backing storage.
      Throws:
      Exception - if the save failed
    • profile

      void profile(PluginRunProfile profile)
      Set the PluginRunProfile at the end of an extraction. This variable will be set the extraction plugin framework when processing a trace has finished.
      Parameters:
      profile - the profile to set
    • profile

      Returns the PluginRunProfile returned by the plugin. This variable will be set the extraction plugin framework when processing a trace has finished.
      Returns:
      the set profile, empty if no profile was not returned by the plugin