You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/11/25 01:07:47 UTC

[GitHub] [ignite] sk0x50 commented on a change in pull request #8252: IGNITE-13450 Add event fired before query execution

sk0x50 commented on a change in pull request #8252:
URL: https://github.com/apache/ignite/pull/8252#discussion_r530040865



##########
File path: modules/core/src/main/java/org/apache/ignite/events/EventType.java
##########
@@ -922,6 +922,16 @@
      */
     public static final int EVT_CLUSTER_SNAPSHOT_FAILED = 151;
 
+    /**
+     * Built-in event type: query execution.

Review comment:
       Could you please provide a comprehensive description of this event?
   The current Javadoc gives no clue on this event. Moreover, `SqlQueryExecutionEvent` itself does not provide any specific information too.
   At least, it would be useful to clearly state the phase of query execution that triggers this event and etc.

##########
File path: modules/core/src/main/java/org/apache/ignite/events/SqlQueryExecutionEvent.java
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 org.apache.ignite.events;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.events.EventType.EVT_SQL_QUERY_EXECUTION;
+
+/**
+ * Query execution event.
+ * <p>
+ * Grid events are used for notification about what happens within the grid. Note that by
+ * design Ignite keeps all events generated on the local node locally and it provides
+ * APIs for performing a distributed queries across multiple nodes:
+ * <ul>
+ *      <li>
+ *          {@link org.apache.ignite.IgniteEvents#remoteQuery(org.apache.ignite.lang.IgnitePredicate, long, int...)} -
+ *          asynchronously querying events occurred on the nodes specified, including remote nodes.
+ *      </li>
+ *      <li>
+ *          {@link org.apache.ignite.IgniteEvents#localQuery(org.apache.ignite.lang.IgnitePredicate, int...)} -
+ *          querying only local events stored on this local node.
+ *      </li>
+ *      <li>
+ *          {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate, int...)} -
+ *          listening to local grid events (events from remote nodes not included).
+ *      </li>
+ * </ul>
+ * User can also wait for events using method {@link org.apache.ignite.IgniteEvents#waitForLocal(org.apache.ignite.lang.IgnitePredicate, int...)}.
+ * <h1 class="header">Events and Performance</h1>
+ * Note that by default all events in Ignite are enabled and therefore generated and stored
+ * by whatever event storage SPI is configured. Ignite can and often does generate thousands events per seconds
+ * under the load and therefore it creates a significant additional load on the system. If these events are
+ * not needed by the application this load is unnecessary and leads to significant performance degradation.
+ * <p>
+ * It is <b>highly recommended</b> to enable only those events that your application logic requires
+ * by using {@link org.apache.ignite.configuration.IgniteConfiguration#getIncludeEventTypes()} method in Ignite configuration. Note that certain
+ * events are required for Ignite's internal operations and such events will still be generated but not stored by
+ * event storage SPI if they are disabled in Ignite configuration.
+ *
+ * @see EventType#EVT_SQL_QUERY_EXECUTION
+ */
+public class SqlQueryExecutionEvent extends EventAdapter {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Query text. */
+    private final String text;
+
+    /** Query arguments. */
+    @GridToStringInclude
+    private final Object[] args;

Review comment:
       `args` may contain sensitive information and should be masked by *** when  `IgniteSystemProperties#IGNITE_TO_STRING_INCLUDE_SENSITIVE` is false.

##########
File path: modules/core/src/main/java/org/apache/ignite/events/SqlQueryExecutionEvent.java
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 org.apache.ignite.events;
+
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.events.EventType.EVT_SQL_QUERY_EXECUTION;
+
+/**
+ * Query execution event.

Review comment:
       It seems to me, this Javadoc is just a copy&paste and it looks useless.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org