Skip to content

Commit 05df53e

Browse files
committed
Revert formatting changes in "Fix code formatting and typos"
This reverts commit c9d8aad.
1 parent 193daa0 commit 05df53e

File tree

4 files changed

+45
-44
lines changed

4 files changed

+45
-44
lines changed

api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ public class RetryingKafkaConnectClient extends KafkaConnectClientApi {
3434
private static final Duration RETRIES_DELAY = Duration.ofMillis(200);
3535

3636
public RetryingKafkaConnectClient(ClustersProperties.ConnectCluster config,
37-
@Nullable ClustersProperties.TruststoreConfig truststoreConfig,
38-
DataSize maxBuffSize) {
37+
@Nullable ClustersProperties.TruststoreConfig truststoreConfig,
38+
DataSize maxBuffSize) {
3939
super(new RetryingApiClient(config, truststoreConfig, maxBuffSize));
4040
}
4141

4242
private static Retry conflictCodeRetry() {
4343
return Retry
4444
.fixedDelay(MAX_RETRIES, RETRIES_DELAY)
4545
.filter(e -> e instanceof WebClientResponseException.Conflict)
46-
.onRetryExhaustedThrow((spec, signal) -> new KafkaConnectConflictReponseException(
47-
(WebClientResponseException.Conflict) signal.failure()));
46+
.onRetryExhaustedThrow((spec, signal) ->
47+
new KafkaConnectConflictReponseException(
48+
(WebClientResponseException.Conflict) signal.failure()));
4849
}
4950

5051
private static <T> Mono<T> withRetryOnConflict(Mono<T> publisher) {
@@ -57,23 +58,25 @@ private static <T> Flux<T> withRetryOnConflict(Flux<T> publisher) {
5758

5859
private static <T> Mono<T> withBadRequestErrorHandling(Mono<T> publisher) {
5960
return publisher
60-
.onErrorResume(WebClientResponseException.BadRequest.class,
61-
e -> Mono.error(new ValidationException("Invalid configuration")))
62-
.onErrorResume(WebClientResponseException.InternalServerError.class,
63-
e -> Mono.error(new ValidationException("Invalid configuration")));
61+
.onErrorResume(WebClientResponseException.BadRequest.class, e ->
62+
Mono.error(new ValidationException("Invalid configuration")))
63+
.onErrorResume(WebClientResponseException.InternalServerError.class, e ->
64+
Mono.error(new ValidationException("Invalid configuration")));
6465
}
6566

6667
@Override
6768
public Mono<Connector> createConnector(NewConnector newConnector) throws RestClientException {
6869
return withBadRequestErrorHandling(
69-
super.createConnector(newConnector));
70+
super.createConnector(newConnector)
71+
);
7072
}
7173

7274
@Override
7375
public Mono<Connector> setConnectorConfig(String connectorName, Map<String, Object> requestBody)
7476
throws RestClientException {
7577
return withBadRequestErrorHandling(
76-
super.setConnectorConfig(connectorName, requestBody));
78+
super.setConnectorConfig(connectorName, requestBody)
79+
);
7780
}
7881

7982
@Override
@@ -93,6 +96,7 @@ public Mono<ResponseEntity<Void>> deleteConnectorWithHttpInfo(String connectorNa
9396
return withRetryOnConflict(super.deleteConnectorWithHttpInfo(connectorName));
9497
}
9598

99+
96100
@Override
97101
public Mono<Connector> getConnector(String connectorName) throws WebClientResponseException {
98102
return withRetryOnConflict(super.getConnector(connectorName));
@@ -204,7 +208,7 @@ public Mono<Void> restartConnector(String connectorName, Boolean includeTasks, B
204208

205209
@Override
206210
public Mono<ResponseEntity<Void>> restartConnectorWithHttpInfo(String connectorName, Boolean includeTasks,
207-
Boolean onlyFailed) throws WebClientResponseException {
211+
Boolean onlyFailed) throws WebClientResponseException {
208212
return withRetryOnConflict(super.restartConnectorWithHttpInfo(connectorName, includeTasks, onlyFailed));
209213
}
210214

@@ -232,14 +236,14 @@ public Mono<ResponseEntity<Void>> resumeConnectorWithHttpInfo(String connectorNa
232236

233237
@Override
234238
public Mono<ResponseEntity<Connector>> setConnectorConfigWithHttpInfo(String connectorName,
235-
Map<String, Object> requestBody)
239+
Map<String, Object> requestBody)
236240
throws WebClientResponseException {
237241
return withRetryOnConflict(super.setConnectorConfigWithHttpInfo(connectorName, requestBody));
238242
}
239243

240244
@Override
241245
public Mono<ConnectorPluginConfigValidationResponse> validateConnectorPluginConfig(String pluginName,
242-
Map<String, Object> requestBody)
246+
Map<String, Object> requestBody)
243247
throws WebClientResponseException {
244248
return withRetryOnConflict(super.validateConnectorPluginConfig(pluginName, requestBody));
245249
}
@@ -253,26 +257,29 @@ public Mono<ResponseEntity<ConnectorPluginConfigValidationResponse>> validateCon
253257
private static class RetryingApiClient extends ApiClient {
254258

255259
public RetryingApiClient(ClustersProperties.ConnectCluster config,
256-
ClustersProperties.TruststoreConfig truststoreConfig,
257-
DataSize maxBuffSize) {
260+
ClustersProperties.TruststoreConfig truststoreConfig,
261+
DataSize maxBuffSize) {
258262
super(buildWebClient(maxBuffSize, config, truststoreConfig), null, null);
259263
setBasePath(config.getAddress());
260264
setUsername(config.getUsername());
261265
setPassword(config.getPassword());
262266
}
263267

264268
public static WebClient buildWebClient(DataSize maxBuffSize,
265-
ClustersProperties.ConnectCluster config,
266-
ClustersProperties.TruststoreConfig truststoreConfig) {
269+
ClustersProperties.ConnectCluster config,
270+
ClustersProperties.TruststoreConfig truststoreConfig) {
267271
return new WebClientConfigurator()
268272
.configureSsl(
269273
truststoreConfig,
270274
new ClustersProperties.KeystoreConfig(
271275
config.getKeystoreLocation(),
272-
config.getKeystorePassword()))
276+
config.getKeystorePassword()
277+
)
278+
)
273279
.configureBasicAuth(
274280
config.getUsername(),
275-
config.getPassword())
281+
config.getPassword()
282+
)
276283
.configureBufferSize(maxBuffSize)
277284
.build();
278285
}

api/src/main/java/io/kafbat/ui/controller/KafkaConnectController.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public Mono<ResponseEntity<Flux<String>>> getConnectors(String clusterName, Stri
6161
.build();
6262

6363
return validateAccess(context)
64-
.thenReturn(ResponseEntity.ok(kafkaConnectService.getConnectorNames(getCluster(clusterName), connectName)))
64+
.thenReturn(
65+
ResponseEntity.ok(kafkaConnectService.getConnectorNames(getCluster(clusterName), connectName)))
6566
.doOnEach(sig -> audit(context, sig));
6667
}
6768

@@ -136,8 +137,7 @@ public Mono<ResponseEntity<Flux<FullConnectorInfoDTO>>> getAllConnectors(
136137
: getConnectorsComparator(orderBy).reversed();
137138

138139
Flux<FullConnectorInfoDTO> job = kafkaConnectService.getAllConnectors(getCluster(clusterName), search)
139-
.filterWhen(dto -> accessControlService.isConnectAccessible(dto.getConnect(),
140-
clusterName))
140+
.filterWhen(dto -> accessControlService.isConnectAccessible(dto.getConnect(), clusterName))
141141
.sort(comparator);
142142

143143
return Mono.just(ResponseEntity.ok(job))
@@ -177,9 +177,9 @@ public Mono<ResponseEntity<ConnectorDTO>> setConnectorConfig(String clusterName,
177177
.build();
178178

179179
return validateAccess(context).then(
180-
kafkaConnectService
181-
.setConnectorConfig(getCluster(clusterName), connectName, connectorName, requestBody)
182-
.map(ResponseEntity::ok))
180+
kafkaConnectService
181+
.setConnectorConfig(getCluster(clusterName), connectName, connectorName, requestBody)
182+
.map(ResponseEntity::ok))
183183
.doOnEach(sig -> audit(context, sig));
184184
}
185185

@@ -205,8 +205,8 @@ public Mono<ResponseEntity<Void>> updateConnectorState(String clusterName, Strin
205205
return validateAccess(context).then(
206206
kafkaConnectService
207207
.updateConnectorState(getCluster(clusterName), connectName, connectorName, action)
208-
.map(ResponseEntity::ok)
209-
).doOnEach(sig -> audit(context, sig));
208+
.map(ResponseEntity::ok))
209+
.doOnEach(sig -> audit(context, sig));
210210
}
211211

212212
@Override
@@ -224,8 +224,8 @@ public Mono<ResponseEntity<Flux<TaskDTO>>> getConnectorTasks(String clusterName,
224224
return validateAccess(context).thenReturn(
225225
ResponseEntity
226226
.ok(kafkaConnectService
227-
.getConnectorTasks(getCluster(clusterName), connectName, connectorName))
228-
).doOnEach(sig -> audit(context, sig));
227+
.getConnectorTasks(getCluster(clusterName), connectName, connectorName)))
228+
.doOnEach(sig -> audit(context, sig));
229229
}
230230

231231
@Override
@@ -243,8 +243,8 @@ public Mono<ResponseEntity<Void>> restartConnectorTask(String clusterName, Strin
243243
return validateAccess(context).then(
244244
kafkaConnectService
245245
.restartConnectorTask(getCluster(clusterName), connectName, connectorName, taskId)
246-
.map(ResponseEntity::ok)
247-
).doOnEach(sig -> audit(context, sig));
246+
.map(ResponseEntity::ok))
247+
.doOnEach(sig -> audit(context, sig));
248248
}
249249

250250
@Override
@@ -260,14 +260,13 @@ public Mono<ResponseEntity<Flux<ConnectorPluginDTO>>> getConnectorPlugins(
260260
return validateAccess(context).then(
261261
Mono.just(
262262
ResponseEntity.ok(
263-
kafkaConnectService.getConnectorPlugins(getCluster(clusterName), connectName)))
264-
).doOnEach(sig -> audit(context, sig));
263+
kafkaConnectService.getConnectorPlugins(getCluster(clusterName), connectName))))
264+
.doOnEach(sig -> audit(context, sig));
265265
}
266266

267267
@Override
268268
public Mono<ResponseEntity<ConnectorPluginConfigValidationResponseDTO>> validateConnectorPluginConfig(
269-
String clusterName, String connectName, String pluginName,
270-
@Valid Mono<Map<String, Object>> requestBody,
269+
String clusterName, String connectName, String pluginName, @Valid Mono<Map<String, Object>> requestBody,
271270
ServerWebExchange exchange) {
272271
return kafkaConnectService
273272
.validateConnectorPluginConfig(
@@ -283,8 +282,7 @@ private Comparator<FullConnectorInfoDTO> getConnectorsComparator(ConnectorColumn
283282
return switch (orderBy) {
284283
case CONNECT -> Comparator.comparing(FullConnectorInfoDTO::getConnect);
285284
case TYPE -> Comparator.comparing(FullConnectorInfoDTO::getType);
286-
case STATUS -> Comparator
287-
.comparing(fullConnectorInfoDTO -> fullConnectorInfoDTO.getStatus().getState());
285+
case STATUS -> Comparator.comparing(fullConnectorInfoDTO -> fullConnectorInfoDTO.getStatus().getState());
288286
default -> defaultComparator;
289287
};
290288
}
@@ -306,8 +304,7 @@ public Mono<ResponseEntity<Void>> resetConnectorOffsets(String clusterName, Stri
306304

307305
return validateAccess(context).then(
308306
kafkaConnectService
309-
.resetConnectorOffsets(getCluster(clusterName), connectName,
310-
connectorName)
307+
.resetConnectorOffsets(getCluster(clusterName), connectName, connectorName)
311308
.map(ResponseEntity::ok))
312309
.doOnEach(sig -> audit(context, sig));
313310
}

frontend/src/components/Connect/Details/Actions/__tests__/Actions.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ describe('Actions', () => {
172172
renderComponent();
173173
await afterClickDropDownButton();
174174
await waitFor(async () =>
175-
userEvent.click(
176-
screen.getByRole('menuitem', { name: 'Reset Offsets' })
177-
)
175+
userEvent.click(screen.getByRole('menuitem', { name: 'Reset Offsets' }))
178176
);
179177
expect(screen.getByRole('dialog')).toBeInTheDocument();
180178
});

frontend/src/components/Connect/List/ActionsCell.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ const ActionsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
173173
resource: ResourceType.CONNECT,
174174
action: Action.DELETE,
175175
value: connect,
176-
}}
177-
>
176+
}}>
178177
Delete
179178
</ActionDropdownItem>
180179
</Dropdown>

0 commit comments

Comments
 (0)