Skip to content

Commit

Permalink
remove default implementations from interface
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Apr 23, 2024
1 parent dd34820 commit 299c2a5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/main/java/io/cryostat/reports/MemoryCachingReportsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ public Uni<Map<String, AnalysisResult>> reportFor(
return delegate.reportFor(jvmId, filename);
});
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(ActiveRecording recording) {
return reportFor(recording, r -> true);
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(String jvmId, String filename) {
return reportFor(jvmId, filename, r -> true);
}
}
8 changes: 2 additions & 6 deletions src/main/java/io/cryostat/reports/ReportsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ public interface ReportsService {
Uni<Map<String, AnalysisResult>> reportFor(
ActiveRecording recording, Predicate<IRule> predicate);

default Uni<Map<String, AnalysisResult>> reportFor(ActiveRecording recording) {
return reportFor(recording, r -> true);
}
Uni<Map<String, AnalysisResult>> reportFor(ActiveRecording recording);

Uni<Map<String, AnalysisResult>> reportFor(
String jvmId, String filename, Predicate<IRule> predicate);

default Uni<Map<String, AnalysisResult>> reportFor(String jvmId, String filename) {
return reportFor(jvmId, filename, r -> true);
}
Uni<Map<String, AnalysisResult>> reportFor(String jvmId, String filename);

static String key(ActiveRecording recording) {
return String.format("%s/%d", recording.target.jvmId, recording.id);
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/io/cryostat/reports/ReportsServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ public Uni<Map<String, AnalysisResult>> reportFor(
return Uni.createFrom().future(future);
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(ActiveRecording recording) {
return reportFor(recording, r -> true);
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(String jvmId, String filename) {
return reportFor(jvmId, filename, r -> true);
}

private Future<Map<String, AnalysisResult>> process(
InputStream stream, Predicate<IRule> predicate) {
return reportGenerator.generateEvalMapInterruptibly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,14 @@ private Uni<Map<String, AnalysisResult>> getStorage(String key) {
}
});
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(ActiveRecording recording) {
return reportFor(recording, r -> true);
}

@Override
public Uni<Map<String, AnalysisResult>> reportFor(String jvmId, String filename) {
return reportFor(jvmId, filename, r -> true);
}
}

0 comments on commit 299c2a5

Please sign in to comment.