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.
perf(entities): fetch total directly (#77)
* chore(entities-api): flag to fetch total entitiess * snake case for proto fields * perf(entities): fetch total entities, only if requested * perf(entities): fetch total direcctly * added unit tests * upgraded entity service dependencies * added unit tests
- Loading branch information
1 parent
77eebec
commit 46d7899
Showing
13 changed files
with
341 additions
and
151 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
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
18 changes: 6 additions & 12 deletions
18
...-impl/src/main/java/org/hypertrace/gateway/service/common/datafetcher/EntityResponse.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 |
---|---|---|
@@ -1,30 +1,24 @@ | ||
package org.hypertrace.gateway.service.common.datafetcher; | ||
|
||
import org.hypertrace.gateway.service.entity.EntityKey; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class EntityResponse { | ||
private final EntityFetcherResponse entityFetcherResponse; | ||
// set of entity keys, irrespective of offset and limit | ||
private final Set<EntityKey> entityKeys; | ||
private final long total; | ||
|
||
public EntityResponse() { | ||
this.entityFetcherResponse = new EntityFetcherResponse(); | ||
this.entityKeys = new HashSet<>(); | ||
this.total = 0; | ||
} | ||
|
||
public EntityResponse(EntityFetcherResponse entityFetcherResponse, Set<EntityKey> entityKeys) { | ||
public EntityResponse(EntityFetcherResponse entityFetcherResponse, long total) { | ||
this.entityFetcherResponse = entityFetcherResponse; | ||
this.entityKeys = entityKeys; | ||
this.total = total; | ||
} | ||
|
||
public EntityFetcherResponse getEntityFetcherResponse() { | ||
return entityFetcherResponse; | ||
} | ||
|
||
public Set<EntityKey> getEntityKeys() { | ||
return entityKeys; | ||
public long getTotal() { | ||
return total; | ||
} | ||
} |
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
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.