Class RumbleRuntimeConfiguration

java.lang.Object
org.rumbledb.config.RumbleRuntimeConfiguration
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable

public class RumbleRuntimeConfiguration extends Object implements Serializable, com.esotericsoftware.kryo.KryoSerializable
See Also:
  • Constructor Details

    • RumbleRuntimeConfiguration

      public RumbleRuntimeConfiguration()
    • RumbleRuntimeConfiguration

      public RumbleRuntimeConfiguration(String[] args)
  • Method Details

    • getDefaultConfiguration

      public static RumbleRuntimeConfiguration getDefaultConfiguration()
    • getPort

      public int getPort()
      Returns the port number when used in server mode.
      Returns:
      the port number.
    • getHost

      public String getHost()
      Returns the host name when used in server mode.
      Returns:
      the host name.
    • getAllowedURIPrefixes

      public List<String> getAllowedURIPrefixes()
      Returns the allowed URI prefixes for read/write (with I/O functions to read data)
      Returns:
      the allowed URI prefixes.
    • setAllowedURIPrefixes

      public void setAllowedURIPrefixes(List<String> newValue)
      Sets the allowed URI prefixes for read/write (with I/O functions to read data)
      Parameters:
      newValue - the allowed URI prefixes.
    • getOutputFormat

      public String getOutputFormat()
      Returns the output format for writing the output of the query to the output path.
      Returns:
      the output format.
    • setOutputFormat

      public void setOutputFormat(String newValue)
      Sets the output format for writing the output of the query to the output path.
      Parameters:
      newValue - the output format.
    • getInputFormat

      public String getInputFormat()
      Returns the input format for reading from standard input.
      Returns:
      the input format.
    • setInputFormat

      public void setInputFormat(String newValue)
      Sets the input format for reading from standard input.
      Parameters:
      newValue - the input format.
    • getNumberOfOutputPartitions

      public int getNumberOfOutputPartitions()
      Returns the number of output partitions to write to the output path.
      Returns:
      the number of output partitions.
    • setNumberOfOutputPartitions

      public RumbleRuntimeConfiguration setNumberOfOutputPartitions(int newValue)
      Sets the number of output partitions to write to the output path.
      Parameters:
      newValue - the number of output partitions.
    • getOutputFormatOptions

      public Map<String,String> getOutputFormatOptions()
      Returns the serialization options to write to the output path.
      Returns:
      the serialization options.
    • setOutputFormatOption

      public RumbleRuntimeConfiguration setOutputFormatOption(String key, String value)
      Sets a serialization option to write to the output path.
      Parameters:
      key - the serialization option key.
      value - the serialization option value.
    • isCheckReturnTypeOfBuiltinFunctions

      public boolean isCheckReturnTypeOfBuiltinFunctions()
      Returns whether the return type of built-in functions is checked.
      Returns:
      whether the return type of built-in functions is checked.
    • setCheckReturnTypeOfBuiltinFunctions

      public RumbleRuntimeConfiguration setCheckReturnTypeOfBuiltinFunctions(boolean checkReturnTypeOfBuiltinFunctions)
      Set whether the return type of built-in functions is checked.
      Parameters:
      checkReturnTypeOfBuiltinFunctions - whether the return type of built-in functions is checked.
    • init

      public void init()
    • getOverwrite

      public boolean getOverwrite()
      Returns whether the output path should be overwritten.
      Returns:
      whether the output path should be overwritten.
    • getShowErrorInfo

      public boolean getShowErrorInfo()
      Returns whether verbose error info should be shown in case an error is returned.
      Returns:
      whether verbose error info should be shown in case an error is returned.
    • setShowErrorInfo

      public void setShowErrorInfo(boolean value)
      Returns whether verbose error info should be shown in case an error is returned.
      Parameters:
      value - whether verbose error info should be shown in case an error is returned.
    • getLaxJSONNullValidation

      public boolean getLaxJSONNullValidation()
      Returns whether it is fine to consider JSON null values in an object as absent for validation against an optional key.
      Returns:
      whether it is fine to consider JSON null values in an object as absent for validation against an optional key.
    • setLaxJSONNullValidation

      public void setLaxJSONNullValidation(boolean value)
      Sets whether it is fine to consider JSON null values in an object as absent for validation against an optional key.
      Parameters:
      value - whether it is fine to consider JSON null values in an object as absent for validation against an optional key.
    • getLogPath

      public String getLogPath()
      Returns the log path.
      Returns:
      the log path.
    • getQueryPath

      public String getQueryPath()
      Returns the path from which the JSONiq or XQuery query is to be read.
      Returns:
      the query path.
    • getOutputPath

      public String getOutputPath()
      Returns the path to which the output path should be written.
      Returns:
      the output path.
    • getQuery

      public String getQuery()
      Returns the query that was passed from the command line.
      Returns:
      the query.
    • getShellFilter

      public String getShellFilter()
      Returns the current shell filter for post-processing output (e.g. JSON beautifier)
      Returns:
      the shell filter.
    • getNativeSQLPredicates

      public boolean getNativeSQLPredicates()
      Returns whether native SQL predicates are enabled.
      Returns:
      whether native SQL predicates are enabled.
    • getDataFrameExecutionModeDetection

      public boolean getDataFrameExecutionModeDetection()
      Returns whether DataFrame execution mode detection is activated for higher-order functions. If disabled, higher-order functions will be executed locally.
      Returns:
      whether DataFrame execution mode detection is activated for higher-order functions.
    • setLogPath

      public void setLogPath(String path)
      Sets the log path.
      Parameters:
      path - the log path.
    • setQueryPath

      public void setQueryPath(String path)
      Sets the path from which the JSONiq or XQuery query is to be read.
      Parameters:
      path - the query path.
    • setOutputPath

      public void setOutputPath(String path)
      Sets the path to which the output path should be written.
      Parameters:
      path - the output path.
    • setShellFilter

      public void setShellFilter(String shell)
      Sets the current shell filter for post-processing output (e.g. JSON beautifier)
      Parameters:
      shell - the shell filter.
    • setNativeSQLPredicates

      public void setNativeSQLPredicates(boolean value)
      Sets whether native SQL predicates are enabled.
      Parameters:
      value - whether native SQL predicates are enabled.
    • setDataFrameExecutionModeDetection

      public void setDataFrameExecutionModeDetection(boolean value)
      Sets whether DataFrame execution mode detection is activated for higher-order functions. If disabled, higher-order functions will be executed locally.
      Parameters:
      value - whether DataFrame execution mode detection is activated for higher-order functions.
    • getResultSizeCap

      public int getResultSizeCap()
      Gets the configured number of Items that should be collected in case of a forced materialization. This applies in particular to a local use of the ItemIterator.
      Returns:
      the current number of Items to collect.
    • setResultSizeCap

      public RumbleRuntimeConfiguration setResultSizeCap(int i)
      Sets the number of Items that should be collected in case of a forced materialization. This applies in particular to a local use of the ItemIterator.
      Parameters:
      i - the maximum number of Items to collect.
    • getExternalVariablesReadFromDataFrames

      public List<Name> getExternalVariablesReadFromDataFrames()
      Returns the names of external variables read from DataFrames.
      Returns:
      the names of external variables read from DataFrames.
    • getExternalVariablesReadFromListsOfItems

      public List<Name> getExternalVariablesReadFromListsOfItems()
      Returns the names of external variables read from lists of items.
      Returns:
      the names of external variables read from lists of items.
    • getExternalVariableValue

      public List<Item> getExternalVariableValue(Name name)
      Returns the list of items associated with a specified variable.
      Parameters:
      name - the variable name (without dollar).
      Returns:
      the list of items associated with the specified variable.
    • getUnparsedExternalVariableValue

      public String getUnparsedExternalVariableValue(Name name)
    • getExternalVariableValueReadFromFile

      public String getExternalVariableValueReadFromFile(Name name)
    • getExternalVariableValueReadFromDataFrame

      public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> getExternalVariableValueReadFromDataFrame(Name name)
    • setExternalVariableValue

      public RumbleRuntimeConfiguration setExternalVariableValue(Name name, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataFrame)
    • setExternalVariableValue

      public RumbleRuntimeConfiguration setExternalVariableValue(String variableName, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataFrame)
    • setExternalVariableValue

      public RumbleRuntimeConfiguration setExternalVariableValue(Name name, List<Item> items)
    • setExternalVariableValue

      public RumbleRuntimeConfiguration setExternalVariableValue(String variableName, List<Item> items)
    • resetExternalVariableValue

      public RumbleRuntimeConfiguration resetExternalVariableValue(Name name)
    • resetExternalVariableValue

      public RumbleRuntimeConfiguration resetExternalVariableValue(String variableNameString)
    • readFromStandardInput

      public boolean readFromStandardInput(Name variableName)
    • getInputFormat

      public String getInputFormat(Name variableName)
    • isShell

      public boolean isShell()
    • isServer

      public boolean isServer()
    • setPrintIteratorTree

      public void setPrintIteratorTree(boolean value)
      Sets whether verbose information on query plans should be displayed.
      Parameters:
      value - true if verbose information on query plans should be displayed, false otherwise.
    • isPrintIteratorTree

      public boolean isPrintIteratorTree()
      Returns whether verbose information on query plans should be displayed.
      Returns:
      true if verbose information on query plans should be displayed, false otherwise.
    • doStaticAnalysis

      public boolean doStaticAnalysis()
      Returns whether static analysis is enabled.
      Returns:
      true if static analysis is enabled, false otherwise.
    • printInferredTypes

      public boolean printInferredTypes()
      Returns whether verbose information inferred types should be shown.
      Returns:
      true if verbose information inferred types should be shown, false otherwise.
    • dateWithTimezone

      public boolean dateWithTimezone()
      Returns whether dates with time zones should be supported. If supported, RumbleDB will not be able to use DataFrames for data containing dates.
      Returns:
      true if dates with time zones should be supported, false otherwise.
    • setDateWithTimezone

      public void setDateWithTimezone(boolean b)
      Sets whether dates with time zones should be supported. If supported, RumbleDB will not be able to use DataFrames for data containing dates.
      Parameters:
      b - true if dates with time zones should be supported, false otherwise.
    • parallelExecution

      public boolean parallelExecution()
      Returns whether parallel execution (RDD, DataFrames) is enabled.
      Returns:
      true if parallel execution is enabled, false otherwise.
    • setParallelExecution

      public void setParallelExecution(boolean b)
      Sets whether parallel execution (RDD, DataFrames) is enabled.
      Parameters:
      b - true if parallel execution is enabled, false otherwise.
    • dataFrameExecution

      public boolean dataFrameExecution()
      Returns whether DataFrame execution is enabled.
      Returns:
      true if DataFrame execution is enabled, false otherwise.
    • setDataFrameExecution

      public void setDataFrameExecution(boolean b)
      Sets whether DataFrame execution is enabled.
      Parameters:
      b - true if DataFrame execution is enabled, false otherwise.
    • nativeExecution

      public boolean nativeExecution()
      Returns whether advanced native execution for nested FLWOR queries is enabled.
      Returns:
      true if advanced native execution for nested FLWOR queries is enabled, false otherwise.
    • setNativeExecution

      public void setNativeExecution(boolean b)
      Sets whether advanced native execution for nested FLWOR queries is enabled.
      Parameters:
      b - true if advanced native execution for nested FLWOR queries is enabled, false otherwise.
    • functionInlining

      public boolean functionInlining()
      Returns whether function inlining is enabled.
      Returns:
      true if function inlining is enabled, false otherwise.
    • setFunctionInlining

      public void setFunctionInlining(boolean b)
      Sets whether function inlining is enabled.
      Parameters:
      b - true if function inlining is enabled, false otherwise.
    • applyUpdates

      public boolean applyUpdates()
      Returns whether the returned Pending Update List should be applied when executed on the command line.
      Returns:
      true if the Pending Update List should be applied, false otherwise.
    • setApplyUpdates

      public void setApplyUpdates(boolean b)
      Sets whether the returned Pending Update List should be applied when executed on the command line.
      Parameters:
      b - true if the Pending Update List should be applied, false otherwise.
    • optimizeGeneralComparisonToValueComparison

      public boolean optimizeGeneralComparisonToValueComparison()
      Returns whether general comparisons may be rewritten using value comparisons.
      Returns:
      true if general comparisons may be rewritten using value comparisons, false otherwise.
    • setOptimizeGeneralComparisonToValueComparison

      public void setOptimizeGeneralComparisonToValueComparison(boolean b)
      Sets whether general comparisons may be rewritten using value comparisons.
      Parameters:
      b - true if general comparisons may be rewritten using value comparisons, false otherwise.
    • getQueryLanguage

      public String getQueryLanguage()
      Returns the version of the query language in use.
      Returns:
      the version of the query language in use.
    • setQueryLanguage

      public void setQueryLanguage(String version)
      Sets the version of the query language to use. Possible values: jsoniq10, jsoniq31, xquery30, xquery31.
      Parameters:
      version - the version of the query language to use.
    • getStaticBaseUri

      public String getStaticBaseUri()
      Returns the static base URI against which relative URIs are resolved when reading or writing data.
      Returns:
      the static base URI against which relative URIs are resolved.
    • setStaticBaseUri

      public void setStaticBaseUri(String value)
      Sets the static base URI against which relative URIs are resolved when reading or writing data.
      Parameters:
      value - the static base URI against which relative URIs are resolved.
    • optimizeSteps

      public boolean optimizeSteps()
      Returns whether XPath steps should be optimized.
      Returns:
      true if XPath steps should be optimized, false otherwise.
    • setOptimizeSteps

      public void setOptimizeSteps(boolean value)
      Sets whether XPath steps should be optimized.
      Parameters:
      value - true if XPath steps should be optimized, false otherwise.
    • optimizeStepExperimental

      public boolean optimizeStepExperimental()
      Returns whether XPath steps should be optimized including experimental algorithms.
      Returns:
      true if XPath steps should be optimized including experimental algorithms, false otherwise.
    • setOptimizeStepsExperimental

      public void setOptimizeStepsExperimental(boolean value)
      Sets whether XPath steps should be optimized including experimental algorithms.
      Parameters:
      value - true if XPath steps should be optimized including experimental algorithms, false otherwise.
    • optimizeParentPointers

      public boolean optimizeParentPointers()
      Returns whether parent pointers can be optimized away in XPath expressions.
      Returns:
      true if parent pointers can be optimized away in XPath expressions, false otherwise.
    • setOptimizeParentPointers

      public void setOptimizeParentPointers(boolean value)
      Sets whether parent pointers can be optimized away in XPath expressions.
      Parameters:
      value - true if parent pointers can be optimized away in XPath expressions, false otherwise.
    • isLocal

      public boolean isLocal()
      Returns whether the underlying Spark instance is local or not.
      Returns:
      true if the underlying Spark instance is local, false otherwise.
    • toString

      public String toString()
      Returns high-level aspects of the current configuration as a string.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the current configuration.
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • getSerializer

      public Serializer getSerializer()
      Returns the serializer in use according to the output format specified.
      Returns:
      the serializer in use according to the output format specified.