-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into upgrade_to_powsybl_dependencies_2024.4.0
- Loading branch information
Showing
12 changed files
with
244 additions
and
104 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
17 changes: 17 additions & 0 deletions
17
src/main/java/org/gridsuite/modification/server/BuildException.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,17 @@ | ||
/* | ||
* Copyright (c) 2024, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.gridsuite.modification.server; | ||
|
||
/** | ||
* @author Joris Mancini <joris.mancini_externe at rte-france.com> | ||
*/ | ||
public class BuildException extends RuntimeException { | ||
public BuildException(String message, Throwable e) { | ||
super(message, e); | ||
} | ||
} |
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
41 changes: 0 additions & 41 deletions
41
src/main/java/org/gridsuite/modification/server/service/BuildFailedPublisherService.java
This file was deleted.
Oops, something went wrong.
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
42 changes: 42 additions & 0 deletions
42
...a/org/gridsuite/modification/server/service/LargeNetworkModificationExecutionService.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,42 @@ | ||
/** | ||
* Copyright (c) 2024, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.gridsuite.modification.server.service; | ||
|
||
import jakarta.annotation.PreDestroy; | ||
import lombok.NonNull; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.Executors; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
import java.util.function.Supplier; | ||
|
||
/** | ||
* @author Slimane Amar <slimane.amar at rte-france.com> | ||
*/ | ||
@Service | ||
public class LargeNetworkModificationExecutionService { | ||
|
||
private ThreadPoolExecutor executorService; | ||
|
||
public LargeNetworkModificationExecutionService(@Value("${max-large-concurrent-applications}") int maxConcurrentLargeModifications, | ||
@NonNull NetworkModificationObserver networkModificationObserver) { | ||
executorService = (ThreadPoolExecutor) Executors.newFixedThreadPool(maxConcurrentLargeModifications); | ||
networkModificationObserver.createThreadPoolMetric(executorService); | ||
} | ||
|
||
@PreDestroy | ||
private void preDestroy() { | ||
executorService.shutdown(); | ||
} | ||
|
||
public <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) { | ||
return CompletableFuture.supplyAsync(supplier, executorService); | ||
} | ||
} |
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.