Class ExporterTestHarness
Exporter interface, by simulating the lifecycle that it would have on a live broker while
allowing callers to control the execution flow.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsConstructorDescriptionExporterTestHarness(Exporter exporter) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated, for removal: This API element is subject to removal in a future version.Closes the exportervoidDeprecated, for removal: This API element is subject to removal in a future version.Will configure the exporter with a default empty configuration, an empty arguments map, but the correct given ID.voidDeprecated, for removal: This API element is subject to removal in a future version.Convenience method forconfigure(String, InputStream)which will transform the file into anInputStream.voidconfigure(String id, InputStream yaml) Deprecated, for removal: This API element is subject to removal in a future version.Will configure the exporter with the given ID, and parse the input as if it were a partial YAML document; this would allow one to test sample configuration and make sure they're parsed as expected.<T> voidDeprecated, for removal: This API element is subject to removal in a future version.Convenience method which will substitute a prepared configuration instance such that it is always returned by a call toConfiguration.instantiate(Class)export()Deprecated, for removal: This API element is subject to removal in a future version.Exports a single default record.export(MockRecord record) Deprecated, for removal: This API element is subject to removal in a future version.Exports the given record, updating the latest position to the position of the record.export(Consumer<MockRecord> configurator) Deprecated, for removal: This API element is subject to removal in a future version.Will export a mock record to the exporter; the is called right before, providing a means of modifying the record before.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.longDeprecated, for removal: This API element is subject to removal in a future version.Returns the last position as reported by the exporter throughController.updateLastExportedRecordPosition(long)longDeprecated, for removal: This API element is subject to removal in a future version.Returns the last exported record's position; note that this is not the last updated record position, as updated by the exporter, but simply the position of that last record handed off to the exporter viaExporter.export(Record).voidopen()Deprecated, for removal: This API element is subject to removal in a future version.Resets scheduled tasks and opens the exporter.voidrunScheduledTasks(Duration elapsed) Deprecated, for removal: This API element is subject to removal in a future version.Runs all scheduled tasks which should be expired if time has passed since the last time this was called.stream()Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record.stream(MockRecord seed) Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record based on the given seed.stream(Consumer<MockRecord> configurator) Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record based on a default record, which the caller can modify before it used as a seed for the stream.
-
Constructor Details
-
ExporterTestHarness
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
exporter- the exporter to be tested
-
-
Method Details
-
configure
Deprecated, for removal: This API element is subject to removal in a future version.Will configure the exporter with a default empty configuration, an empty arguments map, but the correct given ID.- Parameters:
id- the ID of the exporter- Throws:
Exception
-
configure
Deprecated, for removal: This API element is subject to removal in a future version.Will configure the exporter with the given ID, and parse the input as if it were a partial YAML document; this would allow one to test sample configuration and make sure they're parsed as expected.The given YAML document can be a partial document which contains strictly the exporter definition. For example:
zeebe: broker: exporters: elasticsearsch: className: io.camunda.zeebe.exporter.ElasticsearchExporter args: ...NOTE: the ID of the exporter in the YAML document MUST match the given ID here to avoid any issues where you would pass a sample YAML document with multiple exporter definitions.
- Parameters:
id- id of the exporteryaml- the reference YAML document- Throws:
Exception
-
configure
Deprecated, for removal: This API element is subject to removal in a future version.Convenience method forconfigure(String, InputStream)which will transform the file into anInputStream. See its documentation for more.- Parameters:
id- the exporter IDconfigFile- pointer to a yaml configuration file- Throws:
Exception
-
configure
Deprecated, for removal: This API element is subject to removal in a future version.Convenience method which will substitute a prepared configuration instance such that it is always returned by a call toConfiguration.instantiate(Class)NOTE: in this case,
Configuration.getArguments()always returns an empty map.- Type Parameters:
T- type of the configuration class- Parameters:
id- the exporter IDconfig- new return value ofConfiguration.instantiate(Class)- Throws:
Exception
-
open
public void open()Deprecated, for removal: This API element is subject to removal in a future version.Resets scheduled tasks and opens the exporter.NOTE: if closing/opening the exporter here several times, the start position will be the same as the end position when the exporter was last closed.
-
close
public void close()Deprecated, for removal: This API element is subject to removal in a future version.Closes the exporter -
export
Deprecated, for removal: This API element is subject to removal in a future version.Exports a single default record.- Returns:
- generated record
-
export
Deprecated, for removal: This API element is subject to removal in a future version.Exports the given record, updating the latest position to the position of the record.- Parameters:
record- record to export- Returns:
- exported record
-
export
Deprecated, for removal: This API element is subject to removal in a future version.Will export a mock record to the exporter; the is called right before, providing a means of modifying the record before.- Parameters:
configurator- a consumer to modify the record, can be null- Returns:
- the exported record
-
stream
Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record.- Returns:
- a stream of
MockRecord
-
stream
Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record based on the given seed.Subsequent records after the seed will be exactly the same, with the exception that the position and timestamps of later records are always greater than that of previous ones.
- Parameters:
seed- the initial sample record- Returns:
- a stream of
MockRecord
-
stream
Deprecated, for removal: This API element is subject to removal in a future version.Streams a series of record based on a default record, which the caller can modify before it used as a seed for the stream. For more, seestream(MockRecord).- Parameters:
configurator- a consumer to modify the record, can be null- Returns:
- a stream of
MockRecord
-
runScheduledTasks
Deprecated, for removal: This API element is subject to removal in a future version.Runs all scheduled tasks which should be expired if time has passed since the last time this was called.- Parameters:
elapsed- time to elapse
-
getController
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- underlying mock controller
-
getContext
Deprecated, for removal: This API element is subject to removal in a future version. -
getPosition
public long getPosition()Deprecated, for removal: This API element is subject to removal in a future version.Returns the last exported record's position; note that this is not the last updated record position, as updated by the exporter, but simply the position of that last record handed off to the exporter viaExporter.export(Record).- Returns:
- the last exported record's position
-
getLastUpdatedPosition
public long getLastUpdatedPosition()Deprecated, for removal: This API element is subject to removal in a future version.Returns the last position as reported by the exporter throughController.updateLastExportedRecordPosition(long)- Returns:
- the last exported record position
-