Interface OpDispenser<OPTYPE extends CycleOp<?>>

Type Parameters:
OPTYPE - The parameter type of the actual operation which will be used to hold all the details for executing an operation, something that implements CycleOp
All Superinterfaces:
LongFunction<OPTYPE>, OpResultTracker
All Known Implementing Classes:
AdminNamespaceOpDispenser, AdminTenantOpDispenser, AdminTopicOpDispenser, AmqpBaseOpDispenser, AmqpMsgRecvOpDispenser, AmqpMsgSendOpDispenser, AssertingOpDispenser, AzureAISearchBaseOpDispenser, AzureAISearchCreateOrUpdateIndexOpDispenser, AzureAISearchDeleteIndexOpDispenser, AzureAISearchListIndexesOpDispenser, AzureAISearchSearchDocumentsOpDispenser, AzureAISearchUploadDocumentsOpDispenser, BaseOpDispenser, CapturingOpDispenser, Cqld4BaseOpDispenser, CqlD4BatchStmtDispenser, Cqld4CqlBaseOpDispenser, Cqld4FluentGraphOpDispenser, Cqld4GremlinOpDispenser, Cqld4PreparedStmtDispenser, CqlD4RainbowTableDispenser, Cqld4RawStmtDispenser, Cqld4SimpleCqlStmtDispenser, Cqld4SsTableDispenser, DataApiCountDocumentsOpDispenser, DataApiCreateCollectionOpDispenser, DataApiCreateCollectionWithClassOpDispenser, DataApiCreateDatabaseOpDispenser, DataApiCreateNamespaceOpDispenser, DataApiDeleteAllOpDispenser, DataApiDeleteManyOpDispenser, DataApiDeleteOneOpDispenser, DataApiDropCollectionOpDispenser, DataApiDropDatabaseOpDispenser, DataApiDropNamespaceOpDispenser, DataApiEstimatedDocumentCountOpDispenser, DataApiFindByIdOpDispenser, DataApiFindDistinctOpDispenser, DataApiFindOneAndDeleteOpDispenser, DataApiFindOneAndReplaceOpDispenser, DataApiFindOneAndUpdateOpDispenser, DataApiFindOneOpDispenser, DataApiFindOpDispenser, DataApiFindVectorFilterOpDispenser, DataApiFindVectorOpDispenser, DataApiGetDatabaseInfoOpDispenser, DataApiInsertManyOpDispenser, DataApiInsertOneOpDispenser, DataApiInsertOneVectorOpDispenser, DataApiListCollectionNamesOpDispenser, DataApiListCollectionsOpDispenser, DataApiListDatabasesOpDispenser, DataApiListNamespacesOpDispenser, DataApiOpDispenser, DataApiReplaceOneOpDispenser, DataApiUpdateManyOpDispenser, DataApiUpdateOneOpDispenser, DDBCreateTableOpDispenser, DDBDeleteTableOpDispenser, DDBGetItemOpDispenser, DDBPutItemOpDispenser, DDBQueryOpDispenser, DiagOpDispenser, DryrunOpDispenser, ExampleOpDispenserType1, ExampleOpDispenserType2, GCPSpannerBaseOpDispenser, GCPSpannerCreateDatabaseDdlOpDispenser, GCPSpannerDropDatabaseDdlOpDispenser, GCPSpannerExecuteDmlOpDispenser, GCPSpannerInsertOpDispenser, GCPSpannerUpdateDatabaseDdlOpDispenser, HttpOpDispenser, KafkaBaseOpDispenser, MessageConsumerOpDispenser, MessageConsumerOpDispenser, MessageConsumerOpDispenser, MessageProducerOpDispenser, MessageProducerOpDispenser, MessageProducerOpDispenser, MessageReaderOpDispenser, MongoCommandOpDispenser, MongoDbUpdateOpDispenser, Neo4JAsyncAutoCommitOpDispenser, Neo4JAsyncReadTxnOpDispenser, Neo4JAsyncWriteTxnOpDispenser, Neo4JBaseOpDispenser, Neo4JSyncAutoCommitOpDispenser, Neo4JSyncReadTxnOpDispenser, Neo4JSyncWriteTxnOpDispenser, PulsarAdminOpDispenser, PulsarBaseOpDispenser, PulsarClientOpDispenser, QdrantBaseOpDispenser, QdrantCollectionExistsOpDispenser, QdrantCollectionInfoOpDispenser, QdrantCountPointsOpDispenser, QdrantCreateCollectionOpDispenser, QdrantCreatePayloadIndexOpDispenser, QdrantDeleteCollectionOpDispenser, QdrantListCollectionAliasesOpDispenser, QdrantListCollectionsOpDispenser, QdrantListSnapshotsOpDispenser, QdrantSearchPointsOpDispenser, QdrantUpsertPointsOpDispenser, RawDynamoDBOpDispenser, ResultPrintingOpDispenser, S4JBaseOpDispenser, StdoutOpDispenser, TcpClientOpDispenser, TcpServerOpDispenser, WeaviateBaseOpDispenser, WeaviateCreateCollectionOpDispenser, WeaviateCreateObjectsOpDispenser, WeaviateDeleteCollectionOpDispenser, WeaviateGetCollectionSchemaOpDispenser

public interface OpDispenser<OPTYPE extends CycleOp<?>> extends LongFunction<OPTYPE>, OpResultTracker

Synopsis

An OpDispenser is responsible for producing an executable operation for a given cycle number. OpDispenser's are NOT responsible for determine what kind of operation the user intended. These two roles are separated by design so that when an OpDispenser is called, all of the work of figuring out what specific type of operations to run has already been done. OpDispensers are produced by OpMappers. Thus the role of an OpMapper is to construct a cycle->op function.

There is an important relationship between op templates which are interpreted by op mapping and the executable operations which are produced by op dispensers. At a high level, the chain looks like this:

op template -> op mapper -> op dispenser -> executable op

The types and roles associated with op synthesis are:

  • OpTemplate - the raw op template data structure
  • ParsedOp - an API around op template; a lambda construction kit
  • OpMapper - interprets user intent by looking at the op template and constructs an associated op dispenser
  • OpDispenser - Applies a cycle number to a lambda to produce an executable op, and keeps track of template-specific metrics.
  • CycleOp - The base type of executable operations.

BaseOpDispenser

Some common behaviors which are intended to be portable across all op dispenser types are implemented in BaseOpDispenser. It is strongly recommended that you use this as your base type when implementing op dispensers. (refactoring will make this mandatory)

Concepts

REWRITE BELOW Op Synthesis is the process of building a specific executable operation for some (low level driver) API by combining the static and dynamic elements of the operation together. In most cases, implementations of OpDispenser will be constructed within the logic of an OpMapper which is responsible for determining the type of OpDispenser to use as associated with a specific type <OPTYPE>. The OpMapper is called for each op template that is active (not excluded by tag filtering) during activity initialization. It's primary responsibility is figuring out what types of OpDispensers to create based on the op templates provided by users. Once the activity is initialized, a set of op dispensers is held as live dispensers to use as needed to synthesize new operations from generated data in real time.


Implementation Strategy

OpDispenser implementations are intended to be implemented for each type of distinct operation that is supported by a DriverAdapter. That is not to say that an OpDispenser can't be responsible for producing multiple types of operations. Operations which are similar in what they need and how they are constructed make sense to be implemented in the same op dispenser. Those which need different construction logic or fundamentally different types of field values should be implemented separately. The rule of thumb is to ensure that op construction patterns are easy to understand at the mapping level (OpMapper) and streamlined for fast execution at the synthesis level (OpDispenser)

  • Method Details

    • getOp

      OPTYPE getOp(long cycle)
      This method should do all the work of creating an operation that is executable by some other caller. The value produced by the apply method should not require additional processing if a caller wants to execute the operation multiple times, as for retries.
      Parameters:
      cycle - The cycle number which serves as the seed for any generated op fields to be bound into an operation.
      Returns:
      an executable operation
    • getVerifier

      CycleFunction<Boolean> getVerifier()
    • getOpName

      String getOpName()