Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

update to java 17 #269

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
fetch-depth: 0
- name: Gradle wrapper validation
uses: gradle/wrapper-validation-action@v1
- name: Set up Zulu JDK 11
- name: Set up Zulu JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
name: Gradle Build and Publish
steps:
- uses: actions/checkout@v2
- name: Set up Zulu JDK 11
- name: Set up Zulu JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_from_main_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
name: Gradle Build and Publish
steps:
- uses: actions/checkout@v2
- name: Set up Zulu JDK 11
- name: Set up Zulu JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ allprojects {
apply plugin: 'java-library'
apply plugin: 'project-report'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

group = 'com.netflix.conductor'

Expand Down
2 changes: 1 addition & 1 deletion index/es7-persistence/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'java'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import javax.annotation.PreDestroy;
import javax.sql.DataSource;

import com.netflix.conductor.postgres.util.ExecutorsUtil;
import org.springframework.retry.support.RetryTemplate;

import com.netflix.conductor.common.metadata.events.EventExecution;
Expand All @@ -38,6 +37,7 @@
import com.netflix.conductor.metrics.Monitors;
import com.netflix.conductor.model.TaskModel;
import com.netflix.conductor.model.WorkflowModel;
import com.netflix.conductor.postgres.util.ExecutorsUtil;
import com.netflix.conductor.postgres.util.Query;

import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -53,7 +53,8 @@ public class PostgresExecutionDAO extends PostgresBaseDAO
public PostgresExecutionDAO(
RetryTemplate retryTemplate, ObjectMapper objectMapper, DataSource dataSource) {
super(retryTemplate, objectMapper, dataSource);
this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
this.scheduledExecutorService =
Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-execution-"));
}

Expand All @@ -79,7 +80,8 @@ public void destroy() {
}
} catch (InterruptedException ie) {
logger.warn(
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for removeWorkflowWithExpiry", ie);
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for removeWorkflowWithExpiry",
ie);
scheduledExecutorService.shutdownNow();
Thread.currentThread().interrupt();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import javax.annotation.PreDestroy;
import javax.sql.DataSource;

import com.netflix.conductor.postgres.util.ExecutorsUtil;
import org.springframework.retry.support.RetryTemplate;

import com.netflix.conductor.common.metadata.events.EventHandler;
Expand All @@ -33,6 +32,7 @@
import com.netflix.conductor.dao.MetadataDAO;
import com.netflix.conductor.metrics.Monitors;
import com.netflix.conductor.postgres.config.PostgresProperties;
import com.netflix.conductor.postgres.util.ExecutorsUtil;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Preconditions;
Expand All @@ -52,13 +52,11 @@ public PostgresMetadataDAO(
super(retryTemplate, objectMapper, dataSource);

long cacheRefreshTime = properties.getTaskDefCacheRefreshInterval().getSeconds();
this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-metadata-"));
this.scheduledExecutorService =
Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-metadata-"));
this.scheduledExecutorService.scheduleWithFixedDelay(
this::refreshTaskDefs,
cacheRefreshTime,
cacheRefreshTime,
TimeUnit.SECONDS);
this::refreshTaskDefs, cacheRefreshTime, cacheRefreshTime, TimeUnit.SECONDS);
}

@PreDestroy
Expand All @@ -73,7 +71,8 @@ public void destroy() {
}
} catch (InterruptedException ie) {
logger.warn(
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for refreshTaskDefs", ie);
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for refreshTaskDefs",
ie);
scheduledExecutorService.shutdownNow();
Thread.currentThread().interrupt();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import javax.annotation.PreDestroy;
import javax.sql.DataSource;

import com.netflix.conductor.postgres.util.ExecutorsUtil;
import org.springframework.retry.support.RetryTemplate;

import com.netflix.conductor.core.events.queue.Message;
import com.netflix.conductor.dao.QueueDAO;
import com.netflix.conductor.postgres.util.ExecutorsUtil;
import com.netflix.conductor.postgres.util.Query;

import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -43,13 +43,14 @@ public PostgresQueueDAO(
RetryTemplate retryTemplate, ObjectMapper objectMapper, DataSource dataSource) {
super(retryTemplate, objectMapper, dataSource);

this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-queue-"));
this.scheduledExecutorService =
Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-queue-"));
this.scheduledExecutorService.scheduleAtFixedRate(
this::processAllUnacks,
UNACK_SCHEDULE_MS,
UNACK_SCHEDULE_MS,
TimeUnit.MILLISECONDS);
this::processAllUnacks,
UNACK_SCHEDULE_MS,
UNACK_SCHEDULE_MS,
TimeUnit.MILLISECONDS);
logger.debug("{} is ready to serve", PostgresQueueDAO.class.getName());
}

Expand All @@ -65,7 +66,8 @@ public void destroy() {
}
} catch (InterruptedException ie) {
logger.warn(
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for processAllUnacks", ie);
"Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for processAllUnacks",
ie);
scheduledExecutorService.shutdownNow();
Thread.currentThread().interrupt();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.postgres.util;

import java.util.concurrent.Executors;
Expand All @@ -22,5 +33,4 @@ public Thread newThread(Runnable r) {
}
};
}

}