forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checkpoint: adding version-specification to doc migration
Signed-off-by: Chris Helma <chelma+github@amazon.com>
- Loading branch information
Showing
6 changed files
with
143 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
RFS/src/main/java/com/rfs/common/SourceResourceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.rfs.common; | ||
|
||
import com.rfs.models.IndexMetadata; | ||
import com.rfs.models.ShardMetadata; | ||
|
||
public interface SourceResourceProvider { | ||
SnapshotRepo.Provider getSnapshotRepoProvider(SourceRepo sourceRepo); | ||
IndexMetadata.Factory getIndexMetadataFactory(SnapshotRepo.Provider repoDataProvider); | ||
ShardMetadata.Factory getShardMetadataFactory(SnapshotRepo.Provider repoDataProvider); | ||
|
||
int getBufferSizeInBytes(); | ||
boolean getSoftDeletesPossible(); | ||
String getSoftDeletesFieldData(); | ||
} |
21 changes: 21 additions & 0 deletions
21
RFS/src/main/java/com/rfs/common/SourceResourceProviderFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.rfs.common; | ||
|
||
import com.rfs.version_es_6_8.SourceResourceProvider_ES_6_8; | ||
import com.rfs.version_es_7_10.SourceResourceProvider_ES_7_10; | ||
|
||
public class SourceResourceProviderFactory { | ||
public static SourceResourceProvider getProvider(ClusterVersion version) { | ||
switch (version) { | ||
case ES_6_8: | ||
return new SourceResourceProvider_ES_6_8(); | ||
case ES_7_10: | ||
return new SourceResourceProvider_ES_7_10(); | ||
case ES_7_17: | ||
// We don't currently distinguish between 7.10 and 7.17 | ||
return new SourceResourceProvider_ES_7_10(); | ||
default: | ||
throw new IllegalArgumentException("Invalid version: " + version); | ||
} | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
RFS/src/main/java/com/rfs/version_es_6_8/SourceResourceProvider_ES_6_8.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.rfs.version_es_6_8; | ||
|
||
import com.rfs.common.SnapshotRepo; | ||
import com.rfs.common.SourceRepo; | ||
import com.rfs.common.SourceResourceProvider; | ||
import com.rfs.models.IndexMetadata; | ||
import com.rfs.models.ShardMetadata; | ||
|
||
public class SourceResourceProvider_ES_6_8 implements SourceResourceProvider { | ||
@Override | ||
public SnapshotRepo.Provider getSnapshotRepoProvider(SourceRepo sourceRepo) { | ||
return new SnapshotRepoProvider_ES_6_8(sourceRepo); | ||
} | ||
|
||
@Override | ||
public IndexMetadata.Factory getIndexMetadataFactory(SnapshotRepo.Provider repoDataProvider) { | ||
return new IndexMetadataFactory_ES_6_8(repoDataProvider); | ||
} | ||
|
||
@Override | ||
public ShardMetadata.Factory getShardMetadataFactory(SnapshotRepo.Provider repoDataProvider) { | ||
return new ShardMetadataFactory_ES_6_8(repoDataProvider); | ||
} | ||
|
||
@Override | ||
public int getBufferSizeInBytes() { | ||
return ElasticsearchConstants_ES_6_8.BUFFER_SIZE_IN_BYTES; | ||
} | ||
|
||
@Override | ||
public boolean getSoftDeletesPossible() { | ||
return ElasticsearchConstants_ES_6_8.SOFT_DELETES_POSSIBLE; | ||
} | ||
|
||
@Override | ||
public String getSoftDeletesFieldData() { | ||
return ElasticsearchConstants_ES_6_8.SOFT_DELETES_FIELD; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
RFS/src/main/java/com/rfs/version_es_7_10/SourceResourceProvider_ES_7_10.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.rfs.version_es_7_10; | ||
|
||
import com.rfs.common.SnapshotRepo; | ||
import com.rfs.common.SourceRepo; | ||
import com.rfs.common.SourceResourceProvider; | ||
import com.rfs.models.IndexMetadata; | ||
import com.rfs.models.ShardMetadata; | ||
|
||
public class SourceResourceProvider_ES_7_10 implements SourceResourceProvider { | ||
@Override | ||
public SnapshotRepo.Provider getSnapshotRepoProvider(SourceRepo sourceRepo) { | ||
return new SnapshotRepoProvider_ES_7_10(sourceRepo); | ||
} | ||
|
||
@Override | ||
public IndexMetadata.Factory getIndexMetadataFactory(SnapshotRepo.Provider repoDataProvider) { | ||
return new IndexMetadataFactory_ES_7_10(repoDataProvider); | ||
} | ||
|
||
@Override | ||
public ShardMetadata.Factory getShardMetadataFactory(SnapshotRepo.Provider repoDataProvider) { | ||
return new ShardMetadataFactory_ES_7_10(repoDataProvider); | ||
} | ||
|
||
@Override | ||
public int getBufferSizeInBytes() { | ||
return ElasticsearchConstants_ES_7_10.BUFFER_SIZE_IN_BYTES; | ||
} | ||
|
||
@Override | ||
public boolean getSoftDeletesPossible() { | ||
return ElasticsearchConstants_ES_7_10.SOFT_DELETES_POSSIBLE; | ||
} | ||
|
||
@Override | ||
public String getSoftDeletesFieldData() { | ||
return ElasticsearchConstants_ES_7_10.SOFT_DELETES_FIELD; | ||
} | ||
|
||
} |