code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
private String getAzkabanBaseImageFullPath(final VersionSet versionSet) { return versionSet.getVersion(this.azkabanBaseImageName).get().pathWithVersion(); }
TODO: Get azkaban base image version from version set. @return
getAzkabanBaseImageFullPath
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private String getAzkabanConfigVersion(final VersionSet versionSet) { return versionSet.getVersion(this.azkabanConfigImageName).get().getVersion(); }
TODO: Get azkaban base image version from version set. @return
getAzkabanConfigVersion
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private ImmutableMap getLabelsForPod(final ExecutableFlow executableFlow, final int flowResourceRecommendationId, Map<String, String> flowParam) { final int executionId = executableFlow.getExecutionId(); final ImmutableMap.Builder mapBuilder = ImmutableMap.builder(); mapBuilder.put(CLUSTER_LABEL_NAME,...
Create labels that should be applied to the Pod. @return
getLabelsForPod
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
public static String getLabelSelector(final Props azkProps) { requireNonNull(azkProps, "azkaban properties must not be null"); final String clusterName = azkProps.getString(ConfigurationKeys.AZKABAN_CLUSTER_NAME, DEFAULT_CLUSTER_NAME); final StringBuilder selectorBuilder = new StringBuilder(); s...
Get a {@code lableSelector} that can be used to list all the flow-container-pods for the current namespace. Example Selector: 'cluster=cluster1,app=azkaban-exec-server' @return label selector
getLabelSelector
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
public static Pair<String, Integer> getFlowServiceEndpoint(final Props azkProps, final int executionId) { requireNonNull(azkProps, "azkaban properties must not be null"); final String clusterName = azkProps.getString(ConfigurationKeys.AZKABAN_CLUSTER_NAME, DEFAULT_CLUSTER_NAME); final String service...
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
getFlowServiceEndpoint
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
@Override public void setVPARampUp(final int rampUp) { this.vpaRampUp = rampUp; }
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
setVPARampUp
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
@Override public int getVPARampUp() { return this.vpaRampUp; }
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
getVPARampUp
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
@Override public void setVPAEnabled(final boolean enabled) { this.vpaEnabled = enabled; }
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
setVPAEnabled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
@Override public boolean getVPAEnabled() { return this.vpaEnabled; }
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
getVPAEnabled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
@Override public VPAFlowCriteria getVPAFlowCriteria() { return this.vpaFlowCriteria; }
Given a flow ID, return the callable endpoint of the flow pod's service where the flow is executed on. The endpoint is accessible by another pod which resides in the same k8s cluster. Naming rule of the endpoint: "[serviceName].[namespace]:[servicePort]" The returned endpoint is presented by a {@link Pair} consisting o...
getVPAFlowCriteria
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private boolean IsVPAEnabledForFlow(ExecutableFlow executableFlow) { int flowNameHashValMapping = ContainerImplUtils.getFlowNameHashValMapping(executableFlow); return vpaEnabled && flowNameHashValMapping <= this.vpaRampUp && this.vpaFlowCriteria.IsVPAEnabledForFlow(executableFlow); }
Return a boolean value indicates whether vertical pod autoscaler is enabled for a given flow based on ramp up rate and global vpa enabled flag @param executableFlow @return vpa enable status
IsVPAEnabledForFlow
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private ImmutableMap getAnnotationsForPod() { return ImmutableMap.of(); }
TODO: Add implementation to get annotations for Pod. @return
getAnnotationsForPod
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void addInitContainers(final ExecutableFlow executableFlow, final Set<String> jobTypes, final Set<String> dependencyTypes, final AzKubernetesV1SpecBuilder v1SpecBuilder, final VersionSet versionSet) throws ExecutorManagerException { final ExecutableFlow flow = executableFlow; fin...
TODO: Check if we need to turn everything into lower case? @param executableFlow @param jobTypes @param dependencyTypes @param v1SpecBuilder @param versionSet @throws ExecutorManagerException
addInitContainers
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void addSecretVolume(final AzKubernetesV1SpecBuilder v1SpecBuilder) { v1SpecBuilder.addSecretVolume(this.secretVolume, this.secretName, this.secretMountpath); }
TODO: Check if we need to turn everything into lower case? @param executableFlow @param jobTypes @param dependencyTypes @param v1SpecBuilder @param versionSet @throws ExecutorManagerException
addSecretVolume
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void createService(final int executionId) throws ExecutorManagerException { try { final AzKubernetesV1ServiceBuilder azKubernetesV1ServiceBuilder = new AzKubernetesV1ServiceBuilder( "v1Service.yaml"); final V1Service serviceObject = azKubernetesV1ServiceBuilder ...
This method is used to create service for flow container for execution id. @param executionId @throws ExecutorManagerException
createService
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private boolean isServiceRequired() { return this.azkProps .getBoolean(ContainerizedDispatchManagerProperties.KUBERNETES_SERVICE_REQUIRED, false); }
This method is used to check whether service should be created in Kubernetes for flow container pod or not. @return
isServiceRequired
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void deletePod(final int executionId) throws ExecutorManagerException { final String podName = getPodName(executionId); try { final GenericKubernetesApi<V1Pod, V1PodList> podClient = new GenericKubernetesApi<>(V1Pod.class, V1PodList.class, "", "v1", "pods", this.client); ...
This method is used to delete pod in Kubernetes. It will terminate the pod. @param executionId @throws ExecutorManagerException
deletePod
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void deleteService(final int executionId) throws ExecutorManagerException { final String serviceName = getServiceName(executionId); try { // Using GenericKubernetesApi due to a Known issue in K8s Java client and OpenAPIv2: // See more here: https://github.com/kubernetes-client/java/issues/86...
This method is used to delete service in Kubernetes which is created for Pod. @param executionId @throws ExecutorManagerException
deleteService
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private String getVPAName(final int recommendationId) { return getK8sEntityName(this.vpaPrefix, this.clusterName, recommendationId); }
This method is used to get vpa name. It will be created using vpa name prefix, azkaban cluster name and flow resource recommendation id. @param recommendationId @return
getVPAName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private String getServiceName(final int executionId) { return getK8sEntityName(this.servicePrefix, this.clusterName, executionId); }
This method is used to get service name. It will be created using service name prefix, azkaban cluster name and execution id. @param executionId @return
getServiceName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private String getPodName(final int executionId) { return getK8sEntityName(this.podPrefix, this.clusterName, executionId); }
This method is used to get name of Pod based on naming convention. It will be created using pod name prefix, azkaban cluster name and execution id. @param executionId @return
getPodName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
public static String getK8sEntityName(final String prefix, final String clusterName, final int resourceId) { return String.join("-", prefix, clusterName, String.valueOf(resourceId)); }
A helper method to get name of a k8s entity (e.g. Pod or Service) associated with a resource on Azkaban (e.g. Execution or VPA). @param prefix name prefix @param clusterName current cluster's name @param resourceId ID of the Azkaban resource @return the k8s entity name of the given Azkaban resource ID
getK8sEntityName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private final Set<State> getImageVersionState(Map<String, String> flowParams) { if (isDevPod(flowParams)) { return State.getAllStates(); } else { return State.getNewActiveAndStableStateFilter(); } }
A helper method to get name of a k8s entity (e.g. Pod or Service) associated with a resource on Azkaban (e.g. Execution or VPA). @param prefix name prefix @param clusterName current cluster's name @param resourceId ID of the Azkaban resource @return the k8s entity name of the given Azkaban resource ID
getImageVersionState
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private static final boolean isDevPod(Map<String, String> flowParam) { if (flowParam != null && !flowParam.isEmpty() && flowParam .containsKey(FlowParameters.FLOW_PARAM_ENABLE_DEV_POD)) { return true; } return false; }
A helper method to get name of a k8s entity (e.g. Pod or Service) associated with a resource on Azkaban (e.g. Execution or VPA). @param prefix name prefix @param clusterName current cluster's name @param resourceId ID of the Azkaban resource @return the k8s entity name of the given Azkaban resource ID
isDevPod
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesContainerizedImpl.java
Apache-2.0
private void createVPAObject(final String namespace, final String flowVPALabelName, final String flowVPAName, final String flowContainerName, final String minAllowedCPU, final String minAllowedMemory, final String maxAllowedCPU, final String maxAllowedMemory) throws ExecutorManagerException { try ...
This class is the implementation for native Kubernetes VPA Recommender: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler. It has implementation for getting CPU and memory recommendation for a given Azkaban flow. For any recommendation query, it will query the Kubernetes VPA object associated...
createVPAObject
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommender.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommender.java
Apache-2.0
@Override public VPARecommendation getFlowContainerRecommendedRequests(final String namespace, final String flowVPALabelName, final String flowVPAName, final String flowContainerName, final double cpuRecommendationMultiplier, final double memoryRecommendationMultiplier, final String minAllowed...
This class is the implementation for native Kubernetes VPA Recommender: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler. It has implementation for getting CPU and memory recommendation for a given Azkaban flow. For any recommendation query, it will query the Kubernetes VPA object associated...
getFlowContainerRecommendedRequests
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommender.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommender.java
Apache-2.0
private okhttp3.Call getNamespacedVPACall( String namespace, String vpaObjectName) throws ApiException { // create path and map variables String path = String.format(KUBERNETES_GET_VPA_RECOMMENDER_API_FORMAT, namespace, vpaObjectName); String[] authNames = new String[] { "BearerToken" }; ...
Build call for getNamespacedVPACall @return Call to execute
getNamespacedVPACall
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
Apache-2.0
public ApiResponse<V1VerticalPodAutoscaler> getNamespacedVPA( String namespace, String vpaObjectName) throws ApiException { okhttp3.Call localVarCall = getNamespacedVPACall(namespace, vpaObjectName); Type localVarReturnType = new TypeToken<V1VerticalPodAutoscaler>() {}.getType(); return lo...
Get VPA recommendation for a given vpa object in namespace @param namespace kubernetes namespace @param vpaObjectName VPA object name @return response in V1VerticalPodAutoscaler format
getNamespacedVPA
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
Apache-2.0
private okhttp3.Call createNamespacedVPACall( String namespace, V1VerticalPodAutoscaler vpaObject) throws ApiException { // create path and map variables String path = String.format(KUBERNETES_POST_VPA_RECOMMENDER_API_FORMAT, namespace); String[] authNames = new String[] { "BearerToken" }...
Build call for createNamespacedVPACall @return Call to execute
createNamespacedVPACall
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
Apache-2.0
public ApiResponse<V1VerticalPodAutoscaler> createNamespacedVPA( String namespace, V1VerticalPodAutoscaler vpaObject) throws ApiException { okhttp3.Call localVarCall = createNamespacedVPACall(namespace, vpaObject); Type localVarReturnType = new TypeToken<V1VerticalPodAutoscaler>() {}.getType()...
Get VPA recommendation for a given vpa object in namespace @param namespace kubernetes namespace @param vpaObject VPA object @return response in V1VerticalPodAutoscaler format
createNamespacedVPA
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/KubernetesVPARecommenderV1Api.java
Apache-2.0
public void reloadFlowFilter() { // Reset the filter map loadFlowFilter(); }
Reloads the in-memory flows map with the flow filter file.
reloadFlowFilter
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
@VisibleForTesting public void reloadFlowFilter(final String fileLocation) { // Reset the filter map loadFlowFilter(fileLocation); }
Reloads the in-memory flows map with the flow filter file.
reloadFlowFilter
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
synchronized private void loadFlowFilter(final String fileLocation) { // Basic checks if (fileLocation == null) { return; } final Path filePath = Paths.get(fileLocation); if (Files.notExists(filePath) || !Files.isReadable(filePath)) { logger.info("Flow filter file at location " + fileLoc...
Read the flow filter file and create a map of flow names. The read happens on best effort basis. i.e, if a flow name is not correctly formatted, it is ignored.
loadFlowFilter
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
private void validateAndAdd(final List<String> flowFQN, final Set<String> projects, final Set<String> flows, final Map<String, Set<String>> projectFlowMap) { if (!(flowFQN.size() == 1 || flowFQN.size() == 2)) { return; } final String project = flowFQN.get(0); if (flowFQN.size() == 1) { proj...
Validate flowFQN and add it to flows map. @param flowFQN stored in the file is of format: <project name> when entire project needs to be in the filter and <project name>:<flow name>.
validateAndAdd
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
public boolean IsVPAEnabledForFlow(final ExecutableFlow flow) { return !flowExists(flow.getProjectName(), flow.getFlowId()); }
If the flow exists in the flow filter, then return false, else return true. @param flow executable flow object. @return VPA Enable flag.
IsVPAEnabledForFlow
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
@VisibleForTesting public boolean flowExists(final String projectName, final String flowName) { return this.projects.contains(projectName) || this.flows.contains(flowName) || (this.projectFlows.containsKey(projectName) && this.projectFlows.get(projectName).contains(flowName)); }
If the flow exists in the flow filter, then return false, else return true. @param flow executable flow object. @return VPA Enable flag.
flowExists
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/VPAFlowCriteria.java
Apache-2.0
private static EnumSet<AzPodStatus> getInvalidSourceStatusesForReady() { return finalStatuses; }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForReady
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static EnumSet<AzPodStatus> getInvalidSourceStatusesForAppStarting() { EnumSet<AzPodStatus> invalidSources = EnumSet.copyOf(getInvalidSourceStatusesForReady()); invalidSources.add(AZ_POD_READY); return invalidSources; }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForAppStarting
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForInitRunning() { EnumSet<AzPodStatus> invalidSources = EnumSet.copyOf(getInvalidSourceStatusesForAppStarting()); invalidSources.add(AZ_POD_APP_CONTAINERS_STARTING); return invalidSources; }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForInitRunning
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static EnumSet<AzPodStatus> getInvalidSourceStatusesForScheduled() { EnumSet<AzPodStatus> invalidSources = EnumSet.copyOf(getInvalidSourceStatusesForInitRunning()); invalidSources.add(AZ_POD_INIT_CONTAINERS_RUNNING); return invalidSources; }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForScheduled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static EnumSet<AzPodStatus> getInvalidSourceStatusesForRequested() { EnumSet<AzPodStatus> invalidSources = EnumSet.copyOf(getInvalidSourceStatusesForScheduled()); invalidSources.add(AZ_POD_SCHEDULED); return invalidSources; }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForRequested
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForAppFailure() { return EnumSet.of(AZ_POD_INIT_FAILURE, AZ_POD_DELETED); }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForAppFailure
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForInitFailure() { return EnumSet.of(AZ_POD_APP_FAILURE, AZ_POD_DELETED); }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForInitFailure
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForUnexpected() { return EnumSet.of(AZ_POD_DELETED); }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForUnexpected
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForDeleted() { return ImmutableSet.of(); }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForDeleted
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Set<AzPodStatus> getInvalidSourceStatusesForUnset() { return EnumSet.allOf(AzPodStatus.class); }
Contains static routines for validation of {@link AzPodStatus} transitions.
getInvalidSourceStatusesForUnset
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private static Map<AzPodStatus, Set<AzPodStatus>> buildInvalidStatusMap() { ImmutableMap.Builder builder = ImmutableMap.builder() .put(AZ_POD_READY, getInvalidSourceStatusesForReady()) .put(AZ_POD_APP_CONTAINERS_STARTING, getInvalidSourceStatusesForAppStarting()) .put(AZ_POD_INIT_CON...
Contains static routines for validation of {@link AzPodStatus} transitions.
buildInvalidStatusMap
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
public static boolean isTransitionValid(AzPodStatus oldStatus, AzPodStatus newStatus) { Set<AzPodStatus> invalidSet = invalidSourceStatusMap .getOrDefault(newStatus, ImmutableSet.of()); return !invalidSet.contains(oldStatus); }
Checks if the transition from {@code oldStatus} to {@code newStatus} is supported. A return value of 'false' indicates a event status sequence that is not expected to occur in practice and can help to identify problem with the event processing behavior. @param oldStatus @param newStatus @return true if transition is s...
isTransitionValid
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatus.java
Apache-2.0
private void deliverCallbacksForEvent(AzPodStatusMetadata podStatusMetadata) { this.listenerMap.get(podStatusMetadata.getAzPodStatus()).stream() .forEach(callback -> callback.accept(podStatusMetadata)); }
Process all the callbacks for a given event. Lambdas corresponding to the callback method from every registered {@link AzPodStatusListener} are scheduled for execution on the {@code executor} @param podStatusMetadata
deliverCallbacksForEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
Apache-2.0
@Override public void onEvent(Watch.Response<V1Pod> watchEvent) { // Technically, logging the pod watch event can also be performed as part of a callback. // For now the logging is inline to ensure the the event is logged before any corresponding // callbacks and are invoked. try { AzPodStatusMe...
Process all the callbacks for a given event. Lambdas corresponding to the callback method from every registered {@link AzPodStatusListener} are scheduled for execution on the {@code executor} @param podStatusMetadata
onEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
Apache-2.0
private static void logPodWatchEvent(AzPodStatusMetadata event) { // There could be value in logging the entire 'raw' event for post-mortem of any issues. // We should consider logging the event in a separate log file as a json object. logger.info(String.format("WatchEvent for pod %s : %s", event.getPodName...
Process all the callbacks for a given event. Lambdas corresponding to the callback method from every registered {@link AzPodStatusListener} are scheduled for execution on the {@code executor} @param podStatusMetadata
logPodWatchEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusDrivingListener.java
Apache-2.0
public Response<V1Pod> getPodWatchEvent() { return this.podWatchEvent; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getPodWatchEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public V1Pod getV1Pod() { return this.v1Pod; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getV1Pod
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public V1PodStatus getV1PodStatus() { return this.v1PodStatus; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getV1PodStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public String getPodName() { return this.podName; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getPodName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public List<V1PodCondition> getPodConditions() { return this.podConditions; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getPodConditions
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<V1PodCondition> getScheduledCondition() { return this.scheduledCondition; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getScheduledCondition
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<V1PodCondition> getContainersReadyCondition() { return this.containersReadyCondition; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getContainersReadyCondition
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<V1PodCondition> getInitializedCondition() { return this.initializedCondition; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getInitializedCondition
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<V1PodCondition> getReadyCondition() { return this.readyCondition; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getReadyCondition
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<PodConditionStatus> getScheduledConditionStatus() { return this.scheduledConditionStatus; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getScheduledConditionStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<PodConditionStatus> getContainersReadyConditionStatus() { return this.containersReadyConditionStatus; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getContainersReadyConditionStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<PodConditionStatus> getInitializedConditionStatus() { return this.initializedConditionStatus; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getInitializedConditionStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public Optional<PodConditionStatus> getReadyConditionStatus() { return this.readyConditionStatus; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getReadyConditionStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public PodPhase getPodPhase() { return this.podPhase; }
Construct the {@link AzPodStatusExtractor} from the given pod watch event. @param podWatchEvent
getPodPhase
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void extractConditions() { requireNonNull(this.podConditions, "pod status conditions must not be null"); Map<String, V1PodCondition> conditionMap = new HashMap<>(); this.podConditions.stream().forEach( condition -> conditionMap.put(condition.getType().toString(), condition)); t...
Extract the 4 kubernetes conditions from the event. Events can have either any number of conditions [0 - 4] present in them. Optional.empty() denotes a missing condition in the event. @see <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/">Pod Lifecycle</a>
extractConditions
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void extractConditionStatuses() { this.scheduledCondition.ifPresent(cond -> { requireNonNull(cond.getStatus()); this.scheduledConditionStatus = Optional.of(PodConditionStatus.valueOf(cond.getStatus())); }); this.containersReadyCondition.ifPresent(cond -> { requireNonNull(cond.getSt...
For each of the Conditions present in the the event, extract the corresponding status. Optional.empty() denotes the corresponding condition was not present.
extractConditionStatuses
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void extractPhase() { requireNonNull(this.v1PodStatus.getPhase(), "pod status phase must not be null"); // This will throw an IllegalArgumentException in case of an unexpected phase name. this.podPhase = PodPhase.valueOf(String.valueOf(this.v1PodStatus.getPhase())); }
Extract the Pod Phase from the event. @see <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/">Pod Lifecycle</a>
extractPhase
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodRequested() { if (isPodCompleted()) { logger.debug("PodRequested is false as podPhase is in completion state"); return false; } // Scheduled conditions should either not be present or be false if (this.scheduledConditionStatus.isPresent() && this.schedule...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_REQUESTED} @return true if the classification succeeds, false otherwise.
checkForAzPodRequested
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodScheduled() { if (isPodCompleted()) { logger.debug("PodScheduled is false as podPhase is in completion state"); return false; } // Pod must have been scheduled if (!this.scheduledConditionStatus.isPresent()) { logger.debug("PodScheduled false as scheduled c...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_SCHEDULED} @return true if the classification succeeds, false otherwise.
checkForAzPodScheduled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean isAnyInitContainerFailed() { requireNonNull(this.v1PodStatus, "pod status must not be null"); List<V1ContainerStatus> initContainerStatuses = this.v1PodStatus.getInitContainerStatuses(); if (initContainerStatuses == null || initContainerStatuses.isEmpty()) { logger.debug("AnyInitContai...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_SCHEDULED} @return true if the classification succeeds, false otherwise.
isAnyInitContainerFailed
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodInitContainersRunning() { if (isPodCompleted()) { logger.debug("InitRunning is false as podPhase is in completion state"); return false; } // Pod must have scheduled if (!this.scheduledConditionStatus.isPresent() || this.scheduledConditionStatus.get() != ...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_INIT_CONTAINERS_RUNNING} @return true if the classification succeeds, false otherwise.
checkForAzPodInitContainersRunning
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodAppContainerStarting() { if (isPodCompleted()) { logger.debug("ContainerStarting is false as podPhase is in completion state"); return false; } // Pod must have been initialized if (!this.initializedConditionStatus.isPresent() || this.initializedCondition...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_APP_CONTAINERS_STARTING} @return true if the classification succeeds, false otherwise.
checkForAzPodAppContainerStarting
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean isAnyAppContainerFailed() { requireNonNull(this.v1PodStatus, "pod status must not be null"); List<V1ContainerStatus> containerStatuses = this.v1PodStatus.getContainerStatuses(); if (containerStatuses == null || containerStatuses.isEmpty()) { logger.debug("AnyAppContainerFailed is false...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_APP_CONTAINERS_STARTING} @return true if the classification succeeds, false otherwise.
isAnyAppContainerFailed
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean anyContainerFailed(List<V1ContainerStatus> containerStatuses) { return containerStatuses.stream().anyMatch(status -> { if (status.getState().getTerminated() != null) { return status.getState().getTerminated().getExitCode() == null || status.getState().getTerminated().ge...
This method can be utilized to check for any failed container among the list provided. The containers can be init or app containers. @param containerStatuses @return true if any of the container failed, otherwise false.
anyContainerFailed
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodReady() { if (isPodCompleted()) { logger.debug("PodReady is false as podPhase is in completion state"); return false; } // ContainersReady condition must be True if (!this.containersReadyConditionStatus.isPresent() || this.containersReadyConditionStatus.g...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_READY} @return true if the classification succeeds, false otherwise.
checkForAzPodReady
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodCompleted() { // Phase should be succeeded if(this.podPhase != PodPhase.Succeeded) { logger.debug("PodCompleted is false as phase is not succeeded"); return false; } logger.debug("PodCompleted is true"); return true; }
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_COMPLETED} @return true if the classification succeeds, false otherwise.
checkForAzPodCompleted
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodInitFailure() { // Phase must be failed. if (this.podPhase != PodPhase.Failed) { logger.debug("InitFailed is false and phase is not failed"); return false; } // Initalized conditions should not be true if (this.initializedConditionStatus.isPresent() && ...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_INIT_FAILURE} @return true if the classification succeeds, false otherwise.
checkForAzPodInitFailure
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean checkForAzPodAppFailure() { // Phase must be failed. if (this.podPhase != PodPhase.Failed) { logger.debug("AppFailed is false and phase is not failed"); return false; } // Initialized condition should be true if (!this.initializedConditionStatus.isPresent() || th...
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_APP_FAILURE} @return true if the classification succeeds, false otherwise.
checkForAzPodAppFailure
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private boolean isPodCompleted() { return this.podPhase == PodPhase.Succeeded || this.podPhase == PodPhase.Failed; }
Evaluate if event can be classified as status {@link AzPodStatus#AZ_POD_APP_FAILURE} @return true if the classification succeeds, false otherwise.
isPodCompleted
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void logContainerStatus(V1ContainerStatus containerStatus) { requireNonNull(containerStatus, "container status must not be null"); V1ContainerState containerState = containerStatus.getState(); if (containerState == null) { logger.error("Container state is null for container " + containerStatu...
Log useful information from a container status. This will log status information for a container to help with debugging and analysis of container failures. Logging verbosity has been tuned to not log excessive messages when containers don't have any failures. @param containerStatus container status to log
logContainerStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void logContainerStatuses(List<V1ContainerStatus> containerStatuses) { if (containerStatuses == null || containerStatuses.isEmpty()) { logger.debug("No container statuses were found for logging"); return; } containerStatuses.forEach(this::logContainerStatus); }
Log useful information from a container status. This will log status information for a container to help with debugging and analysis of container failures. Logging verbosity has been tuned to not log excessive messages when containers don't have any failures. @param containerStatus container status to log
logContainerStatuses
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void logInitContainerStatuses() { logger.debug("Logging init container statuses"); logContainerStatuses(this.v1PodStatus.getInitContainerStatuses()); }
Log useful information from a container status. This will log status information for a container to help with debugging and analysis of container failures. Logging verbosity has been tuned to not log excessive messages when containers don't have any failures. @param containerStatus container status to log
logInitContainerStatuses
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
private void logAppContainerStatuses() { logger.debug("Logging application container statuses"); logContainerStatuses(this.v1PodStatus.getContainerStatuses()); }
Log useful information from a container status. This will log status information for a container to help with debugging and analysis of container failures. Logging verbosity has been tuned to not log excessive messages when containers don't have any failures. @param containerStatus container status to log
logAppContainerStatuses
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public AzPodStatus createAzPodStatus() { // All pod statuses are checked for any status extracted from the pod event. If multiple // statuses are detected, the first derived pod status will be returned, and the conflict // will be logged List<AzPodStatus> derivedStatuses = new ArrayList<>(); if (ch...
Return the {@link AzPodStatus} derived from given Pod watch event. @return
createAzPodStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public static AzPodStatusMetadata getAzPodStatusFromEvent(Watch.Response<V1Pod> event) { return new AzPodStatusMetadata(new AzPodStatusExtractor(event)); }
Convenience method to create AzPodStatus from event in a single call. @param event @return
getAzPodStatusFromEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusExtractor.java
Apache-2.0
public AzPodStatus getAzPodStatus() { return this.azPodStatus; }
This is intended for maintaining any relevant data from a Pod Watch event that was derived during the inference of {@link AzPodStatus}. The data here can be consumed by any downstream callbacks.
getAzPodStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public String getPodName() { return this.podName; }
This is intended for maintaining any relevant data from a Pod Watch event that was derived during the inference of {@link AzPodStatus}. The data here can be consumed by any downstream callbacks.
getPodName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public Watch.Response<V1Pod> getPodWatchEvent() { return this.podWatchEvent; }
This is intended for maintaining any relevant data from a Pod Watch event that was derived during the inference of {@link AzPodStatus}. The data here can be consumed by any downstream callbacks.
getPodWatchEvent
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public Optional<FlowPodMetadata> getFlowPodMetadata() { return this.flowPodMetadata; }
This is intended for maintaining any relevant data from a Pod Watch event that was derived during the inference of {@link AzPodStatus}. The data here can be consumed by any downstream callbacks.
getFlowPodMetadata
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public String getExecutionId() { return this.executionId; }
This is specifically for maintaining data relevant to a FlowContainer pod. Any data not specific to FlowContainers should be directly added to the outer class {@link AzPodStatusMetadata}
getExecutionId
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public String getClusterName() { return this.clusterName; }
This is specifically for maintaining data relevant to a FlowContainer pod. Any data not specific to FlowContainers should be directly added to the outer class {@link AzPodStatusMetadata}
getClusterName
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public boolean isCleanupDisabled() { return this.isCleanupDisabled; }
This is specifically for maintaining data relevant to a FlowContainer pod. Any data not specific to FlowContainers should be directly added to the outer class {@link AzPodStatusMetadata}
isCleanupDisabled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public boolean isOOMKilled() { return this.isOOMKilled; }
This is specifically for maintaining data relevant to a FlowContainer pod. Any data not specific to FlowContainers should be directly added to the outer class {@link AzPodStatusMetadata}
isOOMKilled
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
public static Optional<FlowPodMetadata> extract(AzPodStatusExtractor podStatusExtractor) { requireNonNull(podStatusExtractor.getV1Pod(), "pod must not be null"); requireNonNull(podStatusExtractor.getV1Pod().getMetadata(), "pod metadata must not be null"); requireNonNull(podStatusExtractor.getV1Pod().g...
This is specifically for maintaining data relevant to a FlowContainer pod. Any data not specific to FlowContainers should be directly added to the outer class {@link AzPodStatusMetadata}
extract
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/AzPodStatusMetadata.java
Apache-2.0
protected boolean isUpdatedPodStatusDistinct(final AzPodStatusMetadata event) { AzPodStatus currentStatus = AzPodStatus.AZ_POD_UNSET; currentStatus = podStatusCache.getIfPresent(event.getPodName()); boolean shouldSkip = currentStatus == event.getAzPodStatus(); if (shouldSkip) { logger.info(format...
Checks whether the {@link AzPodStatus} of a new event is the same as the one already cached. @param event pod watch event @return true if the status is different from cached value, false otherwise
isUpdatedPodStatusDistinct
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/ContainerStatusMetricsListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/ContainerStatusMetricsListener.java
Apache-2.0
protected void updatePodStatus(final AzPodStatusMetadata event) { podStatusCache.put(event.getPodName(), event.getAzPodStatus()); logger.debug(format("Updated status to %s, for pod %s", event.getAzPodStatus(), event.getPodName())); }
Checks whether the {@link AzPodStatus} of a new event is the same as the one already cached. @param event pod watch event @return true if the status is different from cached value, false otherwise
updatePodStatus
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/ContainerStatusMetricsListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/ContainerStatusMetricsListener.java
Apache-2.0
@VisibleForTesting public ContainerizedImpl getContainerizedImpl() { return this.containerizedImpl; }
Provides callback implementations of {@link AzPodStatusListener} for (1) Updating WebServer and database state of flows based on Pod status (2) Driving pod lifecycle actions, such as deleting flow pods in a final state.
getContainerizedImpl
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
Apache-2.0
@VisibleForTesting public ExecutorLoader getExecutorLoader() { return this.executorLoader; }
Provides callback implementations of {@link AzPodStatusListener} for (1) Updating WebServer and database state of flows based on Pod status (2) Driving pod lifecycle actions, such as deleting flow pods in a final state.
getExecutorLoader
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
Apache-2.0
private boolean validateTransition(AzPodStatusMetadata event, AzPodStatus currentStatus) { logger.debug(format("Transition requested from %s -> %s, for pod %s", currentStatus, event.getAzPodStatus(), event.getPodName())); return TransitionValidator.isTransitionValid(currentStatus, event....
Validate the the transition from the current state to the new state in the {@code event} is supported. Note that the validation is on best-effort basis as the cache may not always contain an event for all running flows. This could happen, for example, during webserver restarts. @param event pod watch event @returns tru...
validateTransition
java
azkaban/azkaban
azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
https://github.com/azkaban/azkaban/blob/master/azkaban-common/src/main/java/azkaban/executor/container/watch/FlowStatusManagerListener.java
Apache-2.0