Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
Signed-off-by: Rupal Mahajan <[email protected]>
  • Loading branch information
rupal-bq committed Jun 16, 2024
1 parent bee4863 commit 0857a6b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class ElasticJoinExecutor implements ElasticHitsExecutor {
protected final int MAX_RESULTS_ON_ONE_FETCH = 10000;
private Set<String> aliasesOnReturn;
private boolean allFieldsReturn;
private PointInTimeHandler pit;
protected PointInTimeHandler pit;

protected ElasticJoinExecutor(JoinRequestBuilder requestBuilder) {
metaResults = new MetaSearchResult();
Expand Down Expand Up @@ -302,19 +302,11 @@ public SearchResponse getResponseWithHits(
return responseWithHits;
}

public void createPointInTime(
org.opensearch.client.Client client, JoinRequestBuilder requestBuilder) {
public void createPointInTimeHandler(Client client, JoinRequestBuilder requestBuilder) {
String[] indices =
org.opensearch.common.util.ArrayUtils.concat(
requestBuilder.getFirstTable().getOriginalSelect().getIndexArr(),
requestBuilder.getSecondTable().getOriginalSelect().getIndexArr());
pit = new PointInTimeHandler(client, indices);
pit.create();
}

public void deletePointInTime() {
if (pit != null) {
pit.delete();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public HashJoinElasticExecutor(Client client, HashJoinElasticRequestBuilder requ
}

public List<SearchHit> innerRun() throws IOException, SqlParseException {
createPointInTime(client, requestBuilder);
createPointInTimeHandler(client, requestBuilder);
pit.create();

Map<String, Map<String, List<Object>>> optimizationTermsFilterStructure =
initOptimizationStructure();
Expand Down Expand Up @@ -96,7 +97,7 @@ public int compare(SearchHit o1, SearchHit o2) {
}
});
}
deletePointInTime();
pit.delete();
return combinedResult;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public NestedLoopsElasticExecutor(Client client, NestedLoopsElasticRequestBuilde

@Override
protected List<SearchHit> innerRun() throws SqlParseException {
createPointInTime(client, nestedLoopsRequest);
createPointInTimeHandler(client, nestedLoopsRequest);
pit.create();
List<SearchHit> combinedResults = new ArrayList<>();
int totalLimit = nestedLoopsRequest.getTotalLimit();
int multiSearchMaxSize = nestedLoopsRequest.getMultiSearchMaxSize();
Expand Down Expand Up @@ -129,7 +130,7 @@ protected List<SearchHit> innerRun() throws SqlParseException {
}
}
}
deletePointInTime();
pit.delete();
return combinedResults;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class TableInJoinRequestBuilder {
private List<Field> returnedFields;
private Select originalSelect;
private Integer hintLimit;
private String pitId;

public TableInJoinRequestBuilder() {}

Expand Down Expand Up @@ -60,12 +59,4 @@ public Integer getHintLimit() {
public void setHintLimit(Integer hintLimit) {
this.hintLimit = hintLimit;
}

public String getPitId() {
return pitId;
}

public void setPitId(String pitId) {
this.pitId = pitId;
}
}

0 comments on commit 0857a6b

Please sign in to comment.