-
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.
wip: kubernetes executor database uri built
- Loading branch information
Showing
9 changed files
with
75 additions
and
28 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
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
4 changes: 2 additions & 2 deletions
4
...ubernetes/bo/KubernetesServiceResult.java → ...ls/kubernetes/bo/KubernetesApiResult.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
26 changes: 26 additions & 0 deletions
26
arc-utils/src/main/java/fr/insee/arc/utils/kubernetes/provider/KubernetesServiceLayer.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,26 @@ | ||
package fr.insee.arc.utils.kubernetes.provider; | ||
|
||
public class KubernetesServiceLayer { | ||
|
||
public static final String KUBERNETES_TOKEN_DELIMITER="-"; | ||
public static final String USER_NAME="postgres"; | ||
|
||
|
||
/** | ||
* return service name for a given statefuleSet label and given replica index | ||
* @param statefuleLabel | ||
* @param executorReplicaIndex | ||
* @return | ||
*/ | ||
public static String getName(String statefulLabel, int executorReplicaIndex) | ||
{ | ||
return String.join(KUBERNETES_TOKEN_DELIMITER, statefulLabel, String.valueOf(executorReplicaIndex)); | ||
} | ||
|
||
|
||
public static String getUri(String statefulLabel, int executorReplicaIndex) | ||
{ | ||
return "jdbc:postgresql://"+getName(statefulLabel, executorReplicaIndex)+":5432/defaultdb"; | ||
} | ||
|
||
} |
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