Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker committed Apr 9, 2024
1 parent 5191dcf commit 9603914
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@
import com.linkedin.metadata.timeline.TimelineService;
import com.linkedin.metadata.timeseries.TimeseriesAspectService;
import com.linkedin.metadata.version.GitVersion;
import com.linkedin.usage.UsageClient;
import graphql.execution.DataFetcherResult;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.linkedin.metadata.timeline.TimelineService;
import com.linkedin.metadata.timeseries.TimeseriesAspectService;
import com.linkedin.metadata.version.GitVersion;
import com.linkedin.usage.UsageClient;
import io.datahubproject.metadata.services.RestrictedService;
import io.datahubproject.metadata.services.SecretService;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.linkedin.metadata.timeseries.TimeseriesAspectService;
import com.linkedin.metadata.utils.GenericRecordUtils;
import com.linkedin.timeseries.GenericTable;
import com.linkedin.usage.UsageClient;
import com.linkedin.usage.UsageQueryResult;
import com.linkedin.usage.UsageQueryResultAggregations;
import com.linkedin.usage.UsageTimeRange;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.linkedin.datahub.graphql.generated.Dataset;
import com.linkedin.datahub.graphql.generated.DatasetStatsSummary;
import com.linkedin.metadata.client.UsageStatsJavaClient;
import com.linkedin.usage.UsageClient;
import com.linkedin.usage.UsageQueryResult;
import com.linkedin.usage.UsageQueryResultAggregations;
import com.linkedin.usage.UsageTimeRange;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,17 @@ private static UsageAggregationArray getBuckets(
}

private static UsageQueryResultAggregations getAggregations(
@Nonnull OperationContext opContext,
@Nonnull TimeseriesAspectService timeseriesAspectService,
Filter filter) {
@Nonnull OperationContext opContext,
@Nonnull TimeseriesAspectService timeseriesAspectService,
Filter filter) {
UsageQueryResultAggregations aggregations = new UsageQueryResultAggregations();
List<UserUsageCounts> userUsageCounts =
getUserUsageCounts(opContext, timeseriesAspectService, filter);
getUserUsageCounts(opContext, timeseriesAspectService, filter);
aggregations.setUsers(new UserUsageCountsArray(userUsageCounts));
aggregations.setUniqueUserCount(userUsageCounts.size());

List<FieldUsageCounts> fieldUsageCounts =
getFieldUsageCounts(opContext, timeseriesAspectService, filter);
getFieldUsageCounts(opContext, timeseriesAspectService, filter);
aggregations.setFields(new FieldUsageCountsArray(fieldUsageCounts));

return aggregations;
Expand Down Expand Up @@ -398,7 +398,8 @@ public static CalendarInterval windowToInterval(@Nonnull WindowDuration duration
}

@Nonnull
private static Long convertRangeToStartTime(@Nonnull UsageTimeRange range, long currentEpochMillis) {
private static Long convertRangeToStartTime(
@Nonnull UsageTimeRange range, long currentEpochMillis) {
// TRICKY: since start_time must be before the bucket's start, we actually
// need to subtract extra from the current time to ensure that we get precisely
// what we're looking for. Note that start_time and end_time are both inclusive,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.linkedin.metadata.timeseries.TimeseriesAspectService;
import com.linkedin.metadata.utils.elasticsearch.IndexConvention;
import com.linkedin.metadata.version.GitVersion;
import com.linkedin.usage.RestliUsageClient;
import io.datahubproject.metadata.services.RestrictedService;
import io.datahubproject.metadata.services.SecretService;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -186,7 +185,9 @@ protected GraphQLEngine graphQLEngine(
args.setEntityClient(entityClient);
args.setSystemEntityClient(systemEntityClient);
args.setGraphClient(graphClient);
args.setUsageClient(new UsageStatsJavaClient(timeseriesAspectService, configProvider.getCache().getClient().getUsageClient()));
args.setUsageClient(
new UsageStatsJavaClient(
timeseriesAspectService, configProvider.getCache().getClient().getUsageClient()));
if (isAnalyticsEnabled) {
args.setAnalyticsService(new AnalyticsService(elasticClient, indexConvention));
}
Expand Down

0 comments on commit 9603914

Please sign in to comment.