Skip to content

Commit 5f62c7f

Browse files
committed
clean up unused code
Signed-off-by: Jackie Han <hnyng@amazon.com>
1 parent 654066e commit 5f62c7f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/main/java/org/opensearch/timeseries/util/RestHandlerUtils.java

-20
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,17 @@
2626
import org.opensearch.OpenSearchStatusException;
2727
import org.opensearch.action.search.SearchPhaseExecutionException;
2828
import org.opensearch.action.search.ShardSearchFailure;
29-
import org.opensearch.ad.transport.IndexAnomalyDetectorResponse;
3029
import org.opensearch.common.Nullable;
3130
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
3231
import org.opensearch.common.xcontent.XContentHelper;
3332
import org.opensearch.common.xcontent.XContentType;
3433
import org.opensearch.core.action.ActionListener;
35-
import org.opensearch.core.action.ActionResponse;
3634
import org.opensearch.core.common.Strings;
3735
import org.opensearch.core.common.bytes.BytesReference;
3836
import org.opensearch.core.rest.RestStatus;
3937
import org.opensearch.core.xcontent.NamedXContentRegistry;
4038
import org.opensearch.core.xcontent.ToXContent;
4139
import org.opensearch.core.xcontent.XContentParser;
42-
import org.opensearch.forecast.transport.IndexForecasterResponse;
4340
import org.opensearch.index.IndexNotFoundException;
4441
import org.opensearch.indices.InvalidIndexNameException;
4542
import org.opensearch.rest.RestChannel;
@@ -293,21 +290,4 @@ public static Entity buildEntity(RestRequest request, String detectorId) throws
293290
// not a valid profile request with correct entity information
294291
return null;
295292
}
296-
297-
public static String getConfigIdFromIndexResponse(ActionResponse actionResponse) {
298-
String configId;
299-
if (actionResponse instanceof IndexAnomalyDetectorResponse) {
300-
IndexAnomalyDetectorResponse response = (IndexAnomalyDetectorResponse) actionResponse;
301-
configId = response.getId();
302-
logger.info("Handling IndexAnomalyDetectorResponse for configId: {}", configId);
303-
} else if (actionResponse instanceof IndexForecasterResponse) {
304-
IndexForecasterResponse response = (IndexForecasterResponse) actionResponse;
305-
configId = response.getId();
306-
logger.info("Handling IndexForecasterResponse for configId: {}", configId);
307-
} else {
308-
throw new IllegalStateException("Unexpected response type: " + actionResponse.getClass().getName());
309-
}
310-
return configId;
311-
}
312-
313293
}

0 commit comments

Comments
 (0)