Class CapturePoint

java.lang.Object
io.nosqlbench.virtdata.core.templates.CapturePoint

public class CapturePoint
extends java.lang.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 type 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 Summary

    Constructors 
    Constructor Description
    CapturePoint​(java.lang.String name, java.lang.String asName)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    java.lang.String getName()  
    int hashCode()  
    static CapturePoint of​(java.lang.String anchorName)
    Create a CapturePoint with the specified anchorName, and the same aliasName.
    static CapturePoint of​(java.lang.String anchorName, java.lang.String aliasName)
    Create a CapturePoint with the specified anchorName, and an optional aliasName.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CapturePoint

      public CapturePoint​(java.lang.String name, java.lang.String asName)
  • Method Details

    • getName

      public java.lang.String getName()
    • of

      public static CapturePoint of​(java.lang.String anchorName, java.lang.String aliasName)
      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
      aliasName - The name of the captured value as seen by consumers
      Returns:
      A new CapturePoint
    • of

      public static CapturePoint of​(java.lang.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 java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object