Skip to content

Commit 3e90c14

Browse files
committed
fixes
1 parent e359375 commit 3e90c14

File tree

6 files changed

+20
-26
lines changed

6 files changed

+20
-26
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
command: mvn verify sonar:sonar
1212

1313
executors:
14-
j19:
14+
jdk:
1515
docker:
1616
- image: 'cimg/openjdk:21.0.6'
1717

@@ -22,6 +22,6 @@ workflows:
2222
maven_test:
2323
jobs:
2424
- maven/test:
25-
executor: j19
25+
executor: jdk
2626
- build:
2727
context: SonarCloud

pom.xml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,16 @@
4545

4646
<build>
4747
<plugins>
48-
<plugin>
49-
<groupId>org.apache.maven.plugins</groupId>
50-
<artifactId>maven-compiler-plugin</artifactId>
51-
<version>3.14.0</version>
52-
<configuration>
53-
<release>${java.version}</release>
54-
<compilerArgs>
55-
<arg>--enable-preview</arg>
56-
</compilerArgs>
57-
<source>${java.version}</source>
58-
<target>${java.version}</target>
59-
</configuration>
60-
</plugin>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.14.0</version>
52+
<configuration>
53+
<release>${java.version}</release>
54+
<source>${java.version}</source>
55+
<target>${java.version}</target>
56+
</configuration>
57+
</plugin>
6158
<plugin>
6259
<groupId>org.apache.maven.plugins</groupId>
6360
<artifactId>maven-jar-plugin</artifactId>

skaffold.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: skaffold/v2beta29
1+
apiVersion: skaffold/v4beta5
22
kind: Config
33
metadata:
44
name: sample-java-concurrency
@@ -21,6 +21,7 @@ build:
2121
local:
2222
push: true
2323
deploy:
24-
kubectl:
25-
manifests:
24+
kubectl: {}
25+
manifests:
26+
rawYaml:
2627
- k8s/deployment.yaml

src/main/java/pl/piomin/model/CustomTask.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.util.concurrent.Delayed;
44
import java.util.concurrent.TimeUnit;
5-
import java.util.concurrent.atomic.AtomicLong;
65

76
public record CustomTask(long startTime, String msg, long id) implements Delayed {
87

src/main/java/pl/piomin/server/SimpleCPUConsumeHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@
88
import java.math.BigInteger;
99
import java.util.Random;
1010
import java.util.concurrent.atomic.AtomicLong;
11+
import java.util.logging.Level;
12+
import java.util.logging.Logger;
1113

1214
public class SimpleCPUConsumeHandler implements HttpHandler {
1315

14-
// Logger LOG = Logger.getLogger("handler");
16+
Logger LOG = Logger.getLogger("handler");
1517
AtomicLong i = new AtomicLong();
1618

1719
@Override
1820
public void handle(HttpExchange exchange) throws IOException {
1921
new BigInteger(200, 3, new Random());
2022
String response = "Hello_" + i.incrementAndGet();
21-
// LOG.log(Level.INFO, "(thread->{0}) {1}", new Object[] {Thread.currentThread(), response});
23+
LOG.log(Level.INFO, "(thread->{0}) {1}", new Object[] {Thread.currentThread(), response});
2224
exchange.sendResponseHeaders(200, response.length());
2325
OutputStream os = exchange.getResponseBody();
2426
os.write(response.getBytes());

src/main/java/pl/piomin/server/SimpleDelayedHandler.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ public void handle(HttpExchange t) throws IOException {
3333
if (withLock) {
3434
response = workers.get((int) (id.incrementAndGet() % workersCount)).doJob();
3535
} else {
36-
// try {
37-
// Thread.sleep(200);
38-
// } catch (InterruptedException e) {
39-
// throw new RuntimeException(e);
40-
// }
4136
new BigInteger(500, 10, new Random());
4237
response = "Ping_" + id.incrementAndGet();
4338
}

0 commit comments

Comments
 (0)