Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Jain <[email protected]>
  • Loading branch information
vibrantvarun committed Dec 26, 2023
1 parent ba17401 commit eccaf2a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import lombok.extern.log4j.Log4j2;
import org.opensearch.neuralsearch.TestUtils;
import static org.opensearch.neuralsearch.TestUtils.NODES_BWC_CLUSTER;
import static org.opensearch.neuralsearch.TestUtils.TEXT_EMBEDDING_PROCESSOR;
import org.opensearch.neuralsearch.query.NeuralQueryBuilder;

@Log4j2
public class SemanticSearch extends AbstractRollingUpgradeTestCase{
private static final String PIPELINE_NAME = "nlp-pipeline";
private static final String TEST_FIELD = "test-field";
Expand All @@ -23,6 +25,9 @@ public class SemanticSearch extends AbstractRollingUpgradeTestCase{
private static final int NUM_DOCS = 1;

public void testSemanticSearch() throws Exception{
log.info("Get Cluster Type=========================="+getClusterType());
getIndices();
getShards();
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
switch (getClusterType()){
case OLD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;

@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
@Log4j2
public abstract class BaseNeuralSearchIT extends OpenSearchSecureRestTestCase {

protected static final Locale LOCALE = Locale.ROOT;
Expand Down Expand Up @@ -850,6 +852,27 @@ protected Map<String, Object> getIngestionPipeline(String pipelineName) {
return (Map<String, Object>) responseMap.get(pipelineName);
}

/**
* Get indices
*/
@SneakyThrows
protected void getIndices() {
Request request = new Request("GET", "/_cat/indices");
Response response = client().performRequest(request);
String responseBody = EntityUtils.toString(response.getEntity());
log.info("Indices are ============================");
log.info(responseBody);
}

@SneakyThrows
protected void getShards() {
Request request = new Request("GET", "/_cat/shards");
Response response = client().performRequest(request);
String responseBody = EntityUtils.toString(response.getEntity());
log.info("Shards are ============================");
log.info(responseBody);
}

/**
* Enumeration for types of pipeline processors, used to lookup resources like create
* processor request as those are type specific
Expand Down

0 comments on commit eccaf2a

Please sign in to comment.