Skip to content

Commit 1123b17

Browse files
committed
fix lint
1 parent a853aa1 commit 1123b17

File tree

5 files changed

+32
-23
lines changed

5 files changed

+32
-23
lines changed

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/BackfillPolicyFieldsConfig.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
import org.springframework.context.annotation.Bean;
88
import org.springframework.context.annotation.Configuration;
99

10-
1110
@Configuration
1211
public class BackfillPolicyFieldsConfig {
1312

1413
@Bean
15-
public BackfillBrowsePathsV2 backfillBrowsePathsV2(EntityService<?> entityService, SearchService searchService,
14+
public BackfillBrowsePathsV2 backfillBrowsePathsV2(
15+
EntityService<?> entityService,
16+
SearchService searchService,
1617
@Value("${systemUpdate.policyFields.enabled}") final boolean enabled,
1718
@Value("${systemUpdate.policyFields.reprocess.enabled}") final boolean reprocessEnabled,
1819
@Value("${systemUpdate.policyFields.batchSize}") final Integer batchSize) {
19-
return new BackfillBrowsePathsV2(entityService, searchService, enabled, reprocessEnabled, batchSize);
20+
return new BackfillBrowsePathsV2(
21+
entityService, searchService, enabled, reprocessEnabled, batchSize);
2022
}
21-
}
23+
}

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/SystemUpdateConfig.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public SystemUpdate systemUpdate(
5252
version,
5353
backfillBrowsePathsV2,
5454
reindexDataJobViaNodesCLL,
55-
backfillPolicyFields
56-
);
55+
backfillPolicyFields);
5756
}
5857

5958
@Value("#{systemEnvironment['DATAHUB_REVISION'] ?: '0'}")

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/system/SystemUpdate.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public SystemUpdate(
3232

3333
_preStartupUpgrades = List.of(buildIndicesJob);
3434
_steps = List.of(new DataHubStartupStep(kafkaEventProducer, version));
35-
_postStartupUpgrades = List.of(cleanIndicesJob, backfillBrowsePathsV2, upgradeViaNodeCll, backfillPolicyFields);
35+
_postStartupUpgrades =
36+
List.of(cleanIndicesJob, backfillBrowsePathsV2, upgradeViaNodeCll, backfillPolicyFields);
3637
}
3738

3839
@Override

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/system/entity/steps/BackfillPolicyFields.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.linkedin.metadata.search.SearchService;
88
import java.util.List;
99

10-
1110
public class BackfillPolicyFields implements Upgrade {
1211
private final List<UpgradeStep> _steps;
1312

@@ -18,7 +17,8 @@ public BackfillPolicyFields(
1817
boolean reprocessEnabled,
1918
Integer batchSize) {
2019
if (enabled) {
21-
_steps = ImmutableList.of(
20+
_steps =
21+
ImmutableList.of(
2222
new BackfillPolicyFieldsStep(
2323
entityService, searchService, reprocessEnabled, batchSize));
2424
} else {

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/system/entity/steps/BackfillPolicyFieldsStep.java

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.linkedin.datahub.upgrade.system.entity.steps;
22

3+
import static com.linkedin.metadata.Constants.*;
4+
35
import com.google.common.collect.ImmutableList;
46
import com.linkedin.common.AuditStamp;
57
import com.linkedin.common.urn.Urn;
@@ -34,10 +36,10 @@
3436
import lombok.extern.slf4j.Slf4j;
3537
import org.jetbrains.annotations.NotNull;
3638

37-
import static com.linkedin.metadata.Constants.*;
38-
39-
40-
/** This bootstrap step is responsible for upgrading DataHub policy documents with new searchable fields in ES */
39+
/**
40+
* This bootstrap step is responsible for upgrading DataHub policy documents with new searchable
41+
* fields in ES
42+
*/
4143
@Slf4j
4244
public class BackfillPolicyFieldsStep implements UpgradeStep {
4345
private static final String UPGRADE_ID = "BackfillPolicyFieldsStep";
@@ -47,7 +49,9 @@ public class BackfillPolicyFieldsStep implements UpgradeStep {
4749
private final EntityService<?> entityService;
4850
private final SearchService _searchService;
4951

50-
public BackfillPolicyFieldsStep(EntityService<?> entityService, SearchService searchService,
52+
public BackfillPolicyFieldsStep(
53+
EntityService<?> entityService,
54+
SearchService searchService,
5155
boolean reprocessEnabled,
5256
Integer batchSize) {
5357
this.entityService = entityService;
@@ -74,8 +78,7 @@ public Function<UpgradeContext, UpgradeStepResult> executable() {
7478
do {
7579
log.info(
7680
String.format(
77-
"Upgrading batch of policies %s-%s",
78-
migratedCount, migratedCount + batchSize));
81+
"Upgrading batch of policies %s-%s", migratedCount, migratedCount + batchSize));
7982
scrollId = backfillPolicies(auditStamp, scrollId);
8083
migratedCount += batchSize;
8184
} while (scrollId != null);
@@ -169,8 +172,9 @@ private Filter backfillPolicyFieldFilter() {
169172
private void ingestPolicyFields(Urn urn, AuditStamp auditStamp) {
170173
EntityResponse entityResponse = null;
171174
try {
172-
entityResponse = entityService.getEntityV2(
173-
urn.getEntityType(), urn, Collections.singleton(DATAHUB_POLICY_INFO_ASPECT_NAME));
175+
entityResponse =
176+
entityService.getEntityV2(
177+
urn.getEntityType(), urn, Collections.singleton(DATAHUB_POLICY_INFO_ASPECT_NAME));
174178
} catch (URISyntaxException e) {
175179
log.error(
176180
String.format(
@@ -181,16 +185,20 @@ private void ingestPolicyFields(Urn urn, AuditStamp auditStamp) {
181185

182186
if (entityResponse != null
183187
&& entityResponse.getAspects().containsKey(DATAHUB_POLICY_INFO_ASPECT_NAME)) {
184-
final DataMap dataMap = entityResponse.getAspects().get(DATAHUB_POLICY_INFO_ASPECT_NAME).getValue().data();
188+
final DataMap dataMap =
189+
entityResponse.getAspects().get(DATAHUB_POLICY_INFO_ASPECT_NAME).getValue().data();
185190
final DataHubPolicyInfo infoAspect = new DataHubPolicyInfo(dataMap);
186-
log.debug(String.format("Restating policy information for urn %s with value %s", urn, infoAspect));
191+
log.debug(
192+
String.format("Restating policy information for urn %s with value %s", urn, infoAspect));
187193
MetadataChangeProposal proposal = new MetadataChangeProposal();
188194
proposal.setEntityUrn(urn);
189195
proposal.setEntityType(urn.getEntityType());
190196
proposal.setAspectName(DATAHUB_POLICY_INFO_ASPECT_NAME);
191197
proposal.setChangeType(ChangeType.RESTATE);
192198
proposal.setSystemMetadata(
193-
new SystemMetadata().setRunId(DEFAULT_RUN_ID).setLastObserved(System.currentTimeMillis()));
199+
new SystemMetadata()
200+
.setRunId(DEFAULT_RUN_ID)
201+
.setLastObserved(System.currentTimeMillis()));
194202
proposal.setAspect(GenericRecordUtils.serializeAspect(infoAspect));
195203
entityService.ingestProposal(proposal, auditStamp, true);
196204
}
@@ -208,5 +216,4 @@ private static ConjunctiveCriterion getCriterionForMissingField(String field) {
208216
conjunctiveCriterion.setAnd(criterionArray);
209217
return conjunctiveCriterion;
210218
}
211-
212-
}
219+
}

0 commit comments

Comments
 (0)