File tree Expand file tree Collapse file tree
mr/src/main/java/org/opensearch/hadoop/rest Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments