Skip to content

Commit f4ff82d

Browse files
authored
Allow skipping version conflict check via system property (#753)
* Allow skipping version conflict check via system property When opensearch.hadoop.version.check.skip system property is set to "true", the multiple JAR detection in Version.java is bypassed. This allows users on managed platforms (e.g. AWS Glue) to override a bundled older version of the connector that cannot be removed from the classpath. Signed-off-by: Sotaro Hikita <bering1814@gmail.com> * Update CHANGELOG Signed-off-by: Sotaro Hikita <bering1814@gmail.com> * use Booleans.parseBoolean Signed-off-by: Sotaro Hikita <bering1814@gmail.com> --------- Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
1 parent caeeea6 commit f4ff82d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
33

44
## [Unreleased]
5+
### Added
6+
- Add system property `opensearch.hadoop.version.check.skip` to bypass multiple JAR version detection ([#753](https://github.com/opensearch-project/opensearch-hadoop/pull/753))
7+
58
### Dependencies
69
- Bumps `commons-logging:commons-logging` from 1.3.5 to 1.3.6
710
- Bumps `com.fasterxml.jackson.core:jackson-databind` from 2.21.1 to 2.21.3

mr/src/main/java/org/opensearch/hadoop/util/Version.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.util.Properties;
4141

4242
import org.apache.commons.logging.LogFactory;
43+
import org.opensearch.hadoop.util.unit.Booleans;
4344

4445

4546
public abstract class Version {
@@ -104,7 +105,7 @@ public abstract class Version {
104105
sb.append("\n");
105106
}
106107
}
107-
if (foundJars > 1) {
108+
if (foundJars > 1 && !Booleans.parseBoolean(System.getProperty("opensearch.hadoop.version.check.skip"))) {
108109
throw new RuntimeException(sb.toString());
109110
}
110111
}

0 commit comments

Comments
 (0)