Skip to content

Commit 3719f8c

Browse files
authored
Add method signature to log (#25252)
## Description 1. Add method signature to log 2. Remove unused method. ## Motivation and Context <!---Why is this change required? What problem does it solve?--> <!---If it fixes an open issue, please link to the issue here.--> ## Impact <!---Describe any public API or user-facing feature change or any performance impact--> ## Test Plan <!---Please fill in how you tested your change--> ## Contributor checklist - [ ] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [ ] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. ## Release Notes ``` == NO RELEASE NOTE == ```
1 parent d5e76af commit 3719f8c

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

presto-main-base/src/main/java/com/facebook/presto/execution/SafeEventLoopGroup.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.concurrent.Executor;
2727
import java.util.concurrent.ThreadFactory;
2828
import java.util.function.Consumer;
29-
import java.util.function.Supplier;
3029

3130
import static java.util.Objects.requireNonNull;
3231
import static java.util.concurrent.TimeUnit.NANOSECONDS;
@@ -75,7 +74,7 @@ protected void run()
7574
runTask(task);
7675
}
7776
catch (Throwable t) {
78-
log.error("Error running task on event loop", t);
77+
log.error(t, "Error executing task on event loop");
7978
}
8079
updateLastExecutionTime();
8180
}
@@ -92,7 +91,7 @@ public void execute(Runnable task, Consumer<Throwable> failureHandler, Scheduler
9291
task.run();
9392
}
9493
catch (Throwable t) {
95-
log.error("Error executing task on event loop", t);
94+
log.error(t, "Error executing method %s on event loop.", methodSignature);
9695
if (failureHandler != null) {
9796
failureHandler.accept(t);
9897
}
@@ -106,24 +105,5 @@ public void execute(Runnable task, Consumer<Throwable> failureHandler, Scheduler
106105
}
107106
});
108107
}
109-
110-
public <T> void execute(Supplier<T> task, Consumer<T> successHandler, Consumer<Throwable> failureHandler)
111-
{
112-
requireNonNull(task, "task is null");
113-
this.execute(() -> {
114-
try {
115-
T result = task.get();
116-
if (successHandler != null) {
117-
successHandler.accept(result);
118-
}
119-
}
120-
catch (Throwable t) {
121-
log.error("Error executing task on event loop", t);
122-
if (failureHandler != null) {
123-
failureHandler.accept(t);
124-
}
125-
}
126-
});
127-
}
128108
}
129109
}

0 commit comments

Comments
 (0)