This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor interaction request code to execute qs queries in paral…
…lel (#120) * test: adds e2e test for entity interaction request * adds incoming interaction and assertions for the test * adds requst and response objects for query service * add executor service and rename few variables * makes threadpool to 6 threads * addressed comments of reusing intraction request * fixed stray char * use the common executor pool defined at gateway service level * fixed snyk issue
- Loading branch information
1 parent
2255fd7
commit ed5b7bb
Showing
9 changed files
with
854 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...java/org/hypertrace/gateway/service/common/datafetcher/EntityInteractionQueryRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.hypertrace.gateway.service.common.datafetcher; | ||
|
||
import org.hypertrace.core.query.service.api.QueryRequest; | ||
import org.hypertrace.gateway.service.v1.entity.InteractionsRequest; | ||
|
||
public class EntityInteractionQueryRequest { | ||
private boolean isIncoming; | ||
private String entityType; | ||
private InteractionsRequest interactionsRequest; | ||
private QueryRequest request; | ||
|
||
public EntityInteractionQueryRequest( | ||
boolean isIncoming, | ||
String entityType, | ||
InteractionsRequest interactionsRequest, | ||
QueryRequest request) { | ||
this.isIncoming = isIncoming; | ||
this.entityType = entityType; | ||
this.interactionsRequest = interactionsRequest; | ||
this.request = request; | ||
} | ||
|
||
public boolean isIncoming() { | ||
return isIncoming; | ||
} | ||
|
||
public String getEntityType() { | ||
return entityType; | ||
} | ||
|
||
public InteractionsRequest getInteractionsRequest() { | ||
return interactionsRequest; | ||
} | ||
|
||
public QueryRequest getRequest() { | ||
return request; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ava/org/hypertrace/gateway/service/common/datafetcher/EntityInteractionQueryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.hypertrace.gateway.service.common.datafetcher; | ||
|
||
import java.util.Iterator; | ||
import org.hypertrace.core.query.service.api.ResultSetChunk; | ||
|
||
public class EntityInteractionQueryResponse { | ||
private EntityInteractionQueryRequest request; | ||
private Iterator<ResultSetChunk> resultSetChunkIterator; | ||
|
||
public EntityInteractionQueryResponse( | ||
EntityInteractionQueryRequest request, Iterator<ResultSetChunk> resultSetChunkIterator) { | ||
this.request = request; | ||
this.resultSetChunkIterator = resultSetChunkIterator; | ||
} | ||
|
||
public EntityInteractionQueryRequest getRequest() { | ||
return request; | ||
} | ||
|
||
public Iterator<ResultSetChunk> getResultSetChunkIterator() { | ||
return resultSetChunkIterator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.