AMashenkov commented on code in PR #3522:
URL: https://github.com/apache/ignite-3/pull/3522#discussion_r1905264147


##########
modules/eventlog/src/main/java/org/apache/ignite/internal/eventlog/api/EventLog.java:
##########
@@ -20,9 +20,31 @@
 import java.util.function.Supplier;
 
 /**
- * Logs events into specified sinks.
- * TODO: https://issues.apache.org/jira/browse/IGNITE-21665.
+ * The main interface for logging events.
+ *
+ * <p>Example of usage. Let it be configured in the cluster configuration:
+ * <pre>
+ *     eventlog.channels.exampleChannel: {
+ *       types: [USER_AUTHENTICATED],
+ *       enabled: true
+ *     }
+ *     eventlog.sinks.exampleSink: {
+ *       channel: "exampleChannel",
+ *       type: "log",
+ *       criteria: "exampleLog"
+ *     }
+ * </pre>
+ *
+ * <p>Here is how to fire an event that will be logged into the log file 
defined by "exampleLog":
+ * <pre>
+ *     eventLog.log(() -> 
IgniteEvents.USER_AUTHENTICATED.create(EventUser.of("user1", 
"basicAuthenticationProvider"));
+ * </pre>
  */
 public interface EventLog {
+    /**
+     * Writes event into every channel this event relates to.
+     *
+     * @param eventProvider Event provider.
+     */

Review Comment:
   What are the guarantees for Supplier? When and in which thread it will be 
called?
   The javavoc should claims either "the implementation must call the lamda in 
the currrent thread", or notify the lamda must be thread safe.
   
   Why do we pass a lamda instead of Event object? To do object construction 
lazily?
   The implementation doesn't allow lazy construction, because no event filter 
is implied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to