Skip to content

Commit

Permalink
Rename enable_detector_scan to detector_scan
Browse files Browse the repository at this point in the history
Signed-off-by: Chase Engelbrecht <[email protected]>
  • Loading branch information
engechas committed Feb 12, 2024
1 parent d49e657 commit c8124b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class BulkApiWrapperFactory {
public static BulkApiWrapper getWrapper(final IndexConfiguration indexConfiguration,
final OpenSearchClient openSearchClient,
final RestHighLevelClient restHighLevelClient) {
if (indexConfiguration.isEnableDetectorScan()) {
if (indexConfiguration.isDetectorScan()) {
return new OpenSearchDetectorScanBulkApiWrapper(restHighLevelClient);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class IndexConfiguration {
public static final String DOCUMENT_VERSION_EXPRESSION = "document_version";
public static final String DOCUMENT_VERSION_TYPE = "document_version_type";
public static final String NORMALIZE_INDEX = "normalize_index";
public static final String ENABLE_DETECTOR_SCAN = "enable_detector_scan";
public static final String DETECTOR_SCAN = "detector_scan";

private IndexType indexType;
private TemplateType templateType;
Expand All @@ -101,7 +101,7 @@ public class IndexConfiguration {
private final String versionExpression;
private final VersionType versionType;
private final boolean normalizeIndex;
private final boolean enableDetectorScan;
private final boolean detectorScan;

private static final String S3_PREFIX = "s3://";
private static final String DEFAULT_AWS_REGION = "us-east-1";
Expand All @@ -119,7 +119,7 @@ private IndexConfiguration(final Builder builder) {
this.versionExpression = builder.versionExpression;
this.versionType = builder.versionType;
this.normalizeIndex = builder.normalizeIndex;
this.enableDetectorScan = builder.enableDetectorScan;
this.detectorScan = builder.detectorScan;

determineTemplateType(builder);

Expand Down Expand Up @@ -242,8 +242,8 @@ public static IndexConfiguration readIndexConfig(final PluginSetting pluginSetti
final boolean normalizeIndex = pluginSetting.getBooleanOrDefault(NORMALIZE_INDEX, false);
builder = builder.withNormalizeIndex(normalizeIndex);

final boolean enableDetectorScan = pluginSetting.getBooleanOrDefault(ENABLE_DETECTOR_SCAN, false);
builder = builder.withEnableDetectorScan(enableDetectorScan);
final boolean detectorScan = pluginSetting.getBooleanOrDefault(DETECTOR_SCAN, false);
builder = builder.withDetectorScan(detectorScan);

builder = builder.withVersionExpression(versionExpression);
if (versionExpression != null && (!expressionEvaluator.isValidFormatExpression(versionExpression))) {
Expand Down Expand Up @@ -400,7 +400,7 @@ public String getDocumentRootKey() {

public boolean isNormalizeIndex() { return normalizeIndex; }

public boolean isEnableDetectorScan() { return enableDetectorScan; }
public boolean isDetectorScan() { return detectorScan; }

/**
* This method is used in the creation of IndexConfiguration object. It takes in the template file path
Expand Down Expand Up @@ -486,7 +486,7 @@ public static class Builder {
private VersionType versionType;
private String versionExpression;
private boolean normalizeIndex;
private boolean enableDetectorScan;
private boolean detectorScan;

public Builder withIndexAlias(final String indexAlias) {
checkArgument(indexAlias != null, "indexAlias cannot be null.");
Expand Down Expand Up @@ -665,8 +665,8 @@ public Builder withNormalizeIndex(final boolean normalizeIndex) {
return this;
}

public Builder withEnableDetectorScan(final boolean enableDetectorScan) {
this.enableDetectorScan = enableDetectorScan;
public Builder withDetectorScan(final boolean detectorScan) {
this.detectorScan = detectorScan;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void testGetOpenSearchDefaultBulkApiWrapper() {

@Test
void testGetEnableDetectorScanBulkApiWrapper() {
when(indexConfiguration.isEnableDetectorScan()).thenReturn(true);
when(indexConfiguration.isDetectorScan()).thenReturn(true);
assertThat(BulkApiWrapperFactory.getWrapper(indexConfiguration, openSearchClient, restHighLevelClient),
instanceOf(OpenSearchDetectorScanBulkApiWrapper.class));
}
Expand Down

0 comments on commit c8124b8

Please sign in to comment.