Class Sandbox.Builder

java.lang.Object
com.darkcollective.relix.embed.Sandbox.Builder
Enclosing class:
Sandbox

public static final class Sandbox.Builder extends Object
Assembles a closed sandbox.
Since:
1.0
  • Method Details

    • declarations

      public Sandbox.Builder declarations(String relixText)
      Sets the .relix text installed when a session is built: the external declarations users may reach, and any fixed data.
      Parameters:
      relixText - the declarations; must not be null
      Returns:
      this builder, for chaining
      Since:
      1.0
    • baseDirectory

      public Sandbox.Builder baseDirectory(Path directory)
      Sets the directory relative paths in the declarations resolve against.
      Parameters:
      directory - the directory; must not be null
      Returns:
      this builder, for chaining
      Since:
      1.0
    • maxInputChars

      public Sandbox.Builder maxInputChars(int chars)
      Limits the length of the text one call may pass.
      Parameters:
      chars - the most characters; must be at least 1
      Returns:
      this builder, for chaining
      Since:
      1.0
    • maxOutputRows

      public Sandbox.Builder maxOutputRows(int rows)
      Limits the rows one query returns. A longer result is cut, and the cut is reported.
      Parameters:
      rows - the most rows; must be at least 1
      Returns:
      this builder, for chaining
      Since:
      1.0
    • maxMaterializedRows

      public Sandbox.Builder maxMaterializedRows(int rows)
      Limits the rows one blocking operator may buffer; see Relix.Builder.maxMaterializedRows(int).
      Parameters:
      rows - the most rows; must be at least 1
      Returns:
      this builder, for chaining
      Since:
      1.0
    • maxFixpointRounds

      public Sandbox.Builder maxFixpointRounds(int rounds)
      Limits the rounds one recursion may run; see Relix.Builder.maxFixpointRounds(int).
      Parameters:
      rounds - the most rounds; must be at least 1
      Returns:
      this builder, for chaining
      Since:
      1.0
    • maxProcessedRows

      public Sandbox.Builder maxProcessedRows(long rows)
      Limits the work one execution may do, counted as rows passed from one operator to the next; see Relix.Builder.maxProcessedRows(long).
      Parameters:
      rows - the most rows processed; must be at least 1
      Returns:
      this builder, for chaining
      Since:
      1.0
    • timeout

      public Sandbox.Builder timeout(Duration timeout)
      Limits how long one execution may run; see Relix.Builder.timeout(Duration).
      Parameters:
      timeout - the longest one execution may run; must be positive
      Returns:
      this builder, for chaining
      Since:
      1.0
    • build

      public Sandbox build()
      Builds the sandbox.
      Returns:
      a closed sandbox
      Since:
      1.0