Class CapturePoint<TYPE>

java.lang.Object
io.nosqlbench.virtdata.core.templates.CapturePoint<TYPE>

public class CapturePoint<TYPE> extends Object
A capture point is a named variable which should be extracted from a payload or result type using a native driver API. The result is meant to be provided to the NoSQLBench runtime during cycle execution, and stored in a scoped context of variables which can be re-used within other operations.

Format


select [username as u1] from users where userid={userid};
In the example above, the span [username as u1] is recognized as a capture point. The name of the variable to be captured is username. It is to be captured under a different variable name u1. If the name is the same in both cases, i.e. the variable is named in the result as it should be known after extraction, then you can elide the as u1 clause as in this example:

select [username] from users where userid={userid};
During op mapping, any capture points are condensed down to the native driver vernacular by removing the square brackets from the op template. Thus, the result of parsing the above would yield a form compatible with a native driver. For example, converting to prepared statement form would yield:

select username from users where userid=:userid
For details on the {userid} form, see BindPoint
  • Constructor Details

  • Method Details

    • getSourceName

      public String getSourceName()
    • getAsName

      public String getAsName()
    • getAsCast

      public Class<TYPE> getAsCast()
    • of

      public static CapturePoint of(String cast, String sourceName, String asName)
    • of

      public static CapturePoint of(Class<?> cast, String sourceName, String asName)
    • of

      public static CapturePoint of(String anchorName, String asName)
      Create a CapturePoint with the specified anchorName, and an optional aliasName. If aliasName is null, then the anchorName is used as the alias.
      Parameters:
      anchorName - The name of the capture variable in the native form
      asName - The name of the captured value as seen by consumers
      Returns:
      A new CapturePoint
    • of

      public static CapturePoint of(String anchorName)
      Create a CapturePoint with the specified anchorName, and the same aliasName.
      Parameters:
      anchorName - The name of the capture variable in the native form and as seen by consumers.
      Returns:
      A new CapturePoint
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • valueOf

      public TYPE valueOf(Object v)