Skip to content

Commit c1987f9

Browse files
committed
skil health check at InitializationUtils on serverless mode
1 parent e25c665 commit c1987f9

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

mr/src/main/java/org/opensearch/hadoop/rest/InitializationUtils.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,19 @@ public static void checkIndexStatus(Settings settings) {
8585

8686
try {
8787
if (bootstrap.indexExists(readResource.index())) {
88-
RestClient.Health status = bootstrap.getHealth(readResource.index());
89-
if (status == RestClient.Health.RED) {
90-
throw new OpenSearchHadoopIllegalStateException("Index specified [" + readResource.index()
91-
+ "] is either red or " +
92-
"includes an index that is red, and thus all requested data cannot be safely and fully loaded. "
93-
+
94-
"Bailing out...");
88+
if (settings.getServerlessMode()) {
89+
if (LOG.isDebugEnabled()) {
90+
LOG.debug("Serverless mode - skipping health check (not supported in serverless)");
91+
}
92+
} else {
93+
RestClient.Health status = bootstrap.getHealth(readResource.index());
94+
if (status == RestClient.Health.RED) {
95+
throw new OpenSearchHadoopIllegalStateException("Index specified [" + readResource.index()
96+
+ "] is either red or " +
97+
"includes an index that is red, and thus all requested data cannot be safely and fully loaded. "
98+
+
99+
"Bailing out...");
100+
}
95101
}
96102
}
97103
} finally {

0 commit comments

Comments
 (0)