use of com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold in project dsbulk by datastax.
the class LogSettingsTest method should_disable_maxErrors.
@Test()
void should_disable_maxErrors() throws IOException {
Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxErrors", -42);
LogSettings settings = new LogSettings(config, executionId);
settings.init();
ErrorThreshold threshold = settings.errorThreshold;
assertThat(threshold).isInstanceOf(UnlimitedErrorThreshold.class);
}
use of com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold in project dsbulk by datastax.
the class LogSettingsTest method should_accept_maxQueryWarnings_as_absolute_number.
@Test()
void should_accept_maxQueryWarnings_as_absolute_number() throws IOException {
Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxQueryWarnings", 20);
LogSettings settings = new LogSettings(config, executionId);
settings.init();
ErrorThreshold threshold = settings.queryWarningsThreshold;
assertThat(threshold).isInstanceOf(AbsoluteErrorThreshold.class);
assertThat(((AbsoluteErrorThreshold) threshold).getMaxErrors()).isEqualTo(20);
}
use of com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold in project dsbulk by datastax.
the class LogSettingsTest method should_disable_maxQueryWarnings.
@Test()
void should_disable_maxQueryWarnings() throws IOException {
Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxQueryWarnings", -42);
LogSettings settings = new LogSettings(config, executionId);
settings.init();
ErrorThreshold threshold = settings.queryWarningsThreshold;
assertThat(threshold).isInstanceOf(UnlimitedErrorThreshold.class);
}
use of com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold in project dsbulk by datastax.
the class LogSettingsTest method should_accept_maxErrors_as_percentage.
@Test()
void should_accept_maxErrors_as_percentage() throws IOException {
Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxErrors", "20%");
LogSettings settings = new LogSettings(config, executionId);
settings.init();
ErrorThreshold threshold = settings.errorThreshold;
assertThat(threshold).isInstanceOf(RatioErrorThreshold.class);
assertThat(((RatioErrorThreshold) threshold).getMaxErrorRatio()).isEqualTo(0.2f);
// min sample is fixed and cannot be changed by the user currently
assertThat(((RatioErrorThreshold) threshold).getMinSample()).isEqualTo(100);
}
use of com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold in project dsbulk by datastax.
the class LogSettingsTest method should_accept_maxErrors_as_absolute_number.
@Test()
void should_accept_maxErrors_as_absolute_number() throws IOException {
Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxErrors", 20);
LogSettings settings = new LogSettings(config, executionId);
settings.init();
ErrorThreshold threshold = settings.errorThreshold;
assertThat(threshold).isInstanceOf(AbsoluteErrorThreshold.class);
assertThat(((AbsoluteErrorThreshold) threshold).getMaxErrors()).isEqualTo(20);
}
Aggregations