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

Commit

Permalink
Merge branch 'main' into docsite
Browse files Browse the repository at this point in the history
  • Loading branch information
peterlau committed Jun 16, 2022
2 parents 0276192 + 1a1fe74 commit 97a0393
Show file tree
Hide file tree
Showing 119 changed files with 4,101 additions and 2,351 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Pull Request type
----

- [ ] Bugfix
- [ ] Feature
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes (Please run `./gradlew generateLock saveLock` to refresh dependencies)
- [ ] WHOSUSING.md
- [ ] Other (please describe):

**NOTE**: Please remember to run `./gradlew spotlessApply` to fix any format violations.

Changes in this PR
----

Expand Down
2 changes: 2 additions & 0 deletions WHOSUSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ We would like to keep track of whose using Conductor. Please send a pull request
* [JP Morgan Chase](www.chase.com) [[@maheshyaddanapudi](https://github.com/maheshyaddanapudi)]
* [Orkes ](www.orkes.io)[[@CherishSantoshi](https://github.com/CherishSantoshi)]
* [313X](https://313x.com.br)[[@dalmoveras](https://github.com/dalmoveras)]
* [Supercharge](https://supercharge.io)[[@team-supercharge](https://github.com/team-supercharge)]

2 changes: 1 addition & 1 deletion annotations-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api 'com.google.guava:guava:31.1-jre'
api 'com.squareup:javapoet:1.13.+'
api 'com.github.jknack:handlebars:4.3.+'
api 'com.google.protobuf:protobuf-java:3.20.1'
api 'com.google.protobuf:protobuf-java:3.21.1'
api 'javax.annotation:javax.annotation-api:1.3.2'
api gradleApi()

Expand Down
8 changes: 4 additions & 4 deletions annotations-processor/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"locked": "31.1-jre"
},
"com.google.protobuf:protobuf-java": {
"locked": "3.20.1"
"locked": "3.21.1"
},
"com.netflix.conductor:conductor-annotations": {
"project": true
Expand Down Expand Up @@ -87,7 +87,7 @@
"locked": "31.1-jre"
},
"com.google.protobuf:protobuf-java": {
"locked": "3.20.1"
"locked": "3.21.1"
},
"com.netflix.conductor:conductor-annotations": {
"project": true
Expand Down Expand Up @@ -137,7 +137,7 @@
"locked": "31.1-jre"
},
"com.google.protobuf:protobuf-java": {
"locked": "3.20.1"
"locked": "3.21.1"
},
"com.netflix.conductor:conductor-annotations": {
"project": true
Expand Down Expand Up @@ -181,7 +181,7 @@
"locked": "31.1-jre"
},
"com.google.protobuf:protobuf-java": {
"locked": "3.20.1"
"locked": "3.21.1"
},
"com.netflix.conductor:conductor-annotations": {
"project": true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ configure(allprojects - project(':conductor-grpc')) {
}
}

["cassandra-persistence", "core", "redis-concurrency-limit", "test-harness"].each {
['cassandra-persistence', 'core', 'redis-concurrency-limit', 'test-harness', 'client'].each {
configure(project(":conductor-$it")) {
spotless {
groovy {
Expand Down
25 changes: 7 additions & 18 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ buildscript {
}
}

apply plugin: 'com.github.spotbugs'
apply plugin: 'pmd'
apply plugin: 'groovy'

configurations.all {
exclude group: 'amazon', module: 'aws-java-sdk'
Expand All @@ -22,7 +21,9 @@ dependencies {
implementation "com.sun.jersey:jersey-client:${revJersey}"

implementation "com.netflix.spectator:spectator-api:${revSpectator}"
implementation "com.netflix.eureka:eureka-client:${revEurekaClient}"
implementation ("com.netflix.eureka:eureka-client:${revEurekaClient}") {
exclude group: 'com.google.guava', module: 'guava'
}
implementation "com.amazonaws:aws-java-sdk-core:${revAwsSdk}"

implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider"
Expand All @@ -35,20 +36,8 @@ dependencies {

testImplementation "org.powermock:powermock-module-junit4:${revPowerMock}"
testImplementation "org.powermock:powermock-api-mockito2:${revPowerMock}"
}

spotbugsMain {
reports {
xml {
enabled = false
}
html {
enabled = true
}
}
excludeFilter = file("spotbugsExclude.xml")
testImplementation "org.codehaus.groovy:groovy-all:${revGroovy}"
testImplementation "org.spockframework:spock-core:${revSpock}"
testImplementation "org.spockframework:spock-spring:${revSpock}"
}

pmd {
ignoreFailures = true
}
33 changes: 18 additions & 15 deletions client/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
"locked": "1.7.36"
}
},
"pmd": {
"net.sourceforge.pmd:pmd-java": {
"locked": "6.39.0"
}
},
"runtimeClasspath": {
"com.amazonaws:aws-java-sdk-core": {
"locked": "1.11.86"
Expand Down Expand Up @@ -156,16 +151,6 @@
"locked": "1.7.36"
}
},
"spotbugs": {
"com.github.spotbugs:spotbugs": {
"locked": "4.4.1"
}
},
"spotbugsSlf4j": {
"org.slf4j:slf4j-simple": {
"locked": "1.8.0-beta4"
}
},
"testCompileClasspath": {
"com.amazonaws:aws-java-sdk-core": {
"locked": "1.11.86"
Expand Down Expand Up @@ -212,6 +197,9 @@
"org.apache.logging.log4j:log4j-web": {
"locked": "2.17.1"
},
"org.codehaus.groovy:groovy-all": {
"locked": "2.5.13"
},
"org.powermock:powermock-api-mockito2": {
"locked": "2.0.9"
},
Expand All @@ -221,6 +209,12 @@
"org.slf4j:slf4j-api": {
"locked": "1.7.36"
},
"org.spockframework:spock-core": {
"locked": "1.3-groovy-2.5"
},
"org.spockframework:spock-spring": {
"locked": "1.3-groovy-2.5"
},
"org.springframework.boot:spring-boot-starter-log4j2": {
"locked": "2.6.7"
},
Expand Down Expand Up @@ -327,6 +321,9 @@
],
"locked": "2.17.1"
},
"org.codehaus.groovy:groovy-all": {
"locked": "2.5.13"
},
"org.powermock:powermock-api-mockito2": {
"locked": "2.0.9"
},
Expand All @@ -336,6 +333,12 @@
"org.slf4j:slf4j-api": {
"locked": "1.7.36"
},
"org.spockframework:spock-core": {
"locked": "1.3-groovy-2.5"
},
"org.spockframework:spock-spring": {
"locked": "1.3-groovy-2.5"
},
"org.springframework.boot:spring-boot-starter-log4j2": {
"locked": "2.6.7"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.apache.commons.lang3.time.StopWatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -38,8 +39,6 @@
import com.netflix.spectator.api.Spectator;
import com.netflix.spectator.api.patterns.ThreadPoolMonitor;

import com.google.common.base.Stopwatch;

/**
* Manages the threadpool used by the workers for execution and server communication (polling and
* task update).
Expand Down Expand Up @@ -220,7 +219,8 @@ private Task processTask(Task task, Worker worker, PollingSemaphore pollingSemap
}

private void executeTask(Worker worker, Task task) {
Stopwatch stopwatch = Stopwatch.createStarted();
StopWatch stopwatch = new StopWatch();
stopwatch.start();
TaskResult result = null;
try {
LOGGER.debug(
Expand All @@ -246,7 +246,7 @@ private void executeTask(Worker worker, Task task) {
} finally {
stopwatch.stop();
MetricsContainer.getExecutionTimer(worker.getTaskDefName())
.record(stopwatch.elapsed(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
.record(stopwatch.getTime(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
}

LOGGER.debug(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -28,8 +29,6 @@
import com.netflix.conductor.client.worker.Worker;
import com.netflix.discovery.EurekaClient;

import com.google.common.base.Preconditions;

/** Configures automated polling of tasks and execution via the registered {@link Worker}s. */
public class TaskRunnerConfigurer {
private static final Logger LOGGER = LoggerFactory.getLogger(TaskRunnerConfigurer.class);
Expand Down Expand Up @@ -104,8 +103,8 @@ public static class Builder {
private Map<String /*taskType*/, Integer /*threadCount*/> taskThreadCount = new HashMap<>();

public Builder(TaskClient taskClient, Iterable<Worker> workers) {
Preconditions.checkNotNull(taskClient, "TaskClient cannot be null");
Preconditions.checkNotNull(workers, "Workers cannot be null");
Validate.notNull(taskClient, "TaskClient cannot be null");
Validate.notNull(workers, "Workers cannot be null");
this.taskClient = taskClient;
this.workers = workers;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2022 Netflix, Inc.
* <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.client.exception;

import java.io.InputStream;

public class RequestHandlerException extends RuntimeException {

private InputStream response;
private int status;

public RequestHandlerException(InputStream response, int status) {
this.response = response;
this.status = status;
}

public RequestHandlerException(String message, Throwable cause) {
super(message, cause);
}

public RequestHandlerException(String message) {
super(message);
}

public InputStream getResponse() {
return response;
}

public int getStatus() {
return status;
}

public boolean hasResponse() {
return response != null;
}
}
Loading

0 comments on commit 97a0393

Please sign in to comment.