Class VirtData

java.lang.Object
io.nosqlbench.virtdata.core.bindings.VirtData

public class VirtData extends Object
  • Constructor Details

    • VirtData

      public VirtData()
  • Method Details

    • getTemplate

      public static BindingsTemplate getTemplate(Map<String,Object> config, String... namesAndSpecs)
      Create a bindings template from the pair-wise names and specifiers. Each even-numbered (starting with zero) argument is a binding name, and each odd-numbered (starting with one) argument is a binding spec.
      Parameters:
      namesAndSpecs - names and specs in "name", "spec", ... form
      Returns:
      A bindings template that can be used to resolve a bindings instance
    • getTemplate

      public static BindingsTemplate getTemplate(String... namesAndSpecs)
    • getTemplate

      public static BindingsTemplate getTemplate(Map<String,Object> config, List<BindPoint> bindPoints)
      Create a bindings template from a provided list of BindPoints, ensuring that the syntax of the bindings specs is parsable first.
      Parameters:
      bindPoints - A list of BindPoints
      Returns:
      A BindingsTemplate
    • getOptionalMapper

      public static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Map<String,?> config)
      Instantiate an optional data mapping function if possible.
      Type Parameters:
      T - The parameterized return type of the function
      Parameters:
      flowSpec - The VirtData specifier for the mapping function
      config - A map of configuration objects
      Returns:
      An optional function which will be empty if the function could not be resolved.
    • getOptionalMapper

      public static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec)
    • getMapperDiagnostics

      public static ResolverDiagnostics getMapperDiagnostics(String flowSpec)
    • getMapperDiagnostics

      public static ResolverDiagnostics getMapperDiagnostics(String flowSpec, Map<String,Object> config)
    • getOptionalMapper

      public static <T> Optional<DataMapper<T>> getOptionalMapper(String flowSpec, Class<? extends T> clazz)
      Instantiate an optional data mapping function if possible, with type awareness. This version of getOptionalMapper(String) will use the additional type information in the clazz parameter to automatically parameterize the flow specifier. If the flow specifier does contain an output type qualifier already, then a check is made to ensure that the output type qualifier is assignable to the specified class in the clazz parameter. This ensures that type parameter awareness at compile time is honored and verified when this call is made.
      Type Parameters:
      T - The parameterized return type of the function.
      Parameters:
      flowSpec - The VirtData specifier for the mapping function
      clazz - The explicit class which must be of type T or assignable to type T
      Returns:
      An optional function which will be empty if the function could not be resolved.
    • getOptionalMapper

      public static <T> Optional<DataMapper<T>> getOptionalMapper(String originalflowSpec, Class<?> clazz, Map<String,Object> config)
    • getFunction

      public static <T> T getFunction(String flowSpec, Class<? extends T> functionType)
    • getFunction

      public static <T> T getFunction(String flowSpec, Class<? extends T> functionType, Map<String,Object> config)
    • getOptionalFunction

      public static <T> Optional<T> getOptionalFunction(String flowSpec, Class<? extends T> functionType)
    • getOptionalFunction

      public static <T> Optional<T> getOptionalFunction(String flowSpec, Class<? extends T> functionType, Map<String,Object> config)
    • getMapper

      public static <T> DataMapper<T> getMapper(String flowSpec, Map<String,Object> config)
      Instantiate a data mapping function, or throw an exception.
      Type Parameters:
      T - The parameterized return type of the function
      Parameters:
      flowSpec - The VirtData specifier for the mapping function
      config - A map of configuration objects
      Returns:
      A data mapping function
      Throws:
      RuntimeException - if the function could not be resolved
    • getMapper

      public static <T> DataMapper<T> getMapper(String flowSpec)
    • getMapper

      public static <T> DataMapper<T> getMapper(String flowSpec, Class<? extends T> clazz, Map<String,Object> config)
      Instantiate a data mapping function of the specified type, or throw an error.
      Type Parameters:
      T - The parameterized class of the data mapping return type
      Parameters:
      flowSpec - The VirtData flow specifier for the function to be returned
      clazz - The class of the data mapping function return type
      config - A map of configuration objects
      Returns:
      A new data mapping function.
      Throws:
      RuntimeException - if the function could not be resolved
    • getMapper

      public static <T> DataMapper<T> getMapper(String flowSpec, Class<? extends T> clazz)