[GitHub] [ignite] andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220

2019-10-02 Thread GitBox
andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220
URL: https://github.com/apache/ignite/pull/6904#discussion_r330672022
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/security/cache/CacheOperationPermissionCheckTest.java
 ##
 @@ -31,41 +31,58 @@
 import org.junit.runners.JUnit4;
 
 import static java.util.Collections.singletonMap;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_CREATE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_DESTROY;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_PUT;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_READ;
 import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_REMOVE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.JOIN_AS_SERVER;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.TASK_EXECUTE;
 import static 
org.apache.ignite.testframework.GridTestUtils.assertThrowsWithCause;
 
 /**
  * Test CRUD cache permissions.
  */
 @RunWith(JUnit4.class)
 public class CacheOperationPermissionCheckTest extends 
AbstractCacheOperationPermissionCheckTest {
-/** */
+
+private final String NEW_CACHE="NEW_CACHE";
+/**
+ *
+ */
 @Test
-public void testServerNode() throws Exception {
-testCrudCachePermissions(false);
+public void testServerNodeAllowAll() throws Exception {
+testCrudCachePermissionsAllowAll(false);
 }
 
-/** */
+/**
+ *
+ */
 @Test
-public void testClientNode() throws Exception {
-testCrudCachePermissions(true);
+public void testClientNodeAllowAll() throws Exception {
 
 Review comment:
   No need to rename the method.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220

2019-10-02 Thread GitBox
andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220
URL: https://github.com/apache/ignite/pull/6904#discussion_r330672080
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/security/cache/CacheOperationPermissionCheckTest.java
 ##
 @@ -31,41 +31,58 @@
 import org.junit.runners.JUnit4;
 
 import static java.util.Collections.singletonMap;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_CREATE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_DESTROY;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_PUT;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_READ;
 import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_REMOVE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.JOIN_AS_SERVER;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.TASK_EXECUTE;
 import static 
org.apache.ignite.testframework.GridTestUtils.assertThrowsWithCause;
 
 /**
  * Test CRUD cache permissions.
  */
 @RunWith(JUnit4.class)
 public class CacheOperationPermissionCheckTest extends 
AbstractCacheOperationPermissionCheckTest {
-/** */
+
+private final String NEW_CACHE="NEW_CACHE";
+/**
+ *
+ */
 @Test
-public void testServerNode() throws Exception {
-testCrudCachePermissions(false);
+public void testServerNodeAllowAll() throws Exception {
+testCrudCachePermissionsAllowAll(false);
 }
 
-/** */
+/**
+ *
+ */
 @Test
-public void testClientNode() throws Exception {
-testCrudCachePermissions(true);
+public void testClientNodeAllowAll() throws Exception {
+testCrudCachePermissionsAllowAll(true);
 }
 
 /**
  * @param isClient True if is client mode.
  * @throws Exception If failed.
  */
-private void testCrudCachePermissions(boolean isClient) throws Exception {
+private void testCrudCachePermissionsAllowAll(boolean isClient) throws 
Exception {
 
 Review comment:
   No need to rename the method.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220

2019-10-02 Thread GitBox
andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220
URL: https://github.com/apache/ignite/pull/6904#discussion_r330671952
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/security/cache/CacheOperationPermissionCheckTest.java
 ##
 @@ -31,41 +31,58 @@
 import org.junit.runners.JUnit4;
 
 import static java.util.Collections.singletonMap;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_CREATE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_DESTROY;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_PUT;
 import static org.apache.ignite.plugin.security.SecurityPermission.CACHE_READ;
 import static 
org.apache.ignite.plugin.security.SecurityPermission.CACHE_REMOVE;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.JOIN_AS_SERVER;
+import static 
org.apache.ignite.plugin.security.SecurityPermission.TASK_EXECUTE;
 import static 
org.apache.ignite.testframework.GridTestUtils.assertThrowsWithCause;
 
 /**
  * Test CRUD cache permissions.
  */
 @RunWith(JUnit4.class)
 public class CacheOperationPermissionCheckTest extends 
AbstractCacheOperationPermissionCheckTest {
-/** */
+
+private final String NEW_CACHE="NEW_CACHE";
+/**
+ *
+ */
 @Test
-public void testServerNode() throws Exception {
-testCrudCachePermissions(false);
+public void testServerNodeAllowAll() throws Exception {
 
 Review comment:
   No need to rename the method.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220

2019-10-02 Thread GitBox
andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220
URL: https://github.com/apache/ignite/pull/6904#discussion_r330671047
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/security/impl/TestSecurityContext.java
 ##
 @@ -110,7 +110,7 @@ public boolean operationAllowed(String opName, 
SecurityPermission perm) {
  * @param perm Permission.
  */
 private boolean hasPermission(Collection perms, 
SecurityPermission perm) {
-if (perms == null)
+if (perms==null)
 
 Review comment:
   It was OK. Roll it back, please.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] Jokser opened a new pull request #6931: IGNITE-11704 Tombstones

2019-10-02 Thread GitBox
Jokser opened a new pull request #6931: IGNITE-11704 Tombstones
URL: https://github.com/apache/ignite/pull/6931
 
 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330628217
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ContinuousQueryView.java
 ##
 @@ -0,0 +1,214 @@
+/*
+ * 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.spi.systemview.view;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.ContinuousQueryWithTransformer;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
+import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
+import 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.RoutineInfo;
+
+/**
+ * Continuous query representation for a {@link SystemView}.
+ */
+public class ContinuousQueryView {
+/** Routine info. */
+private final RoutineInfo qry;
+
+/** Continuous query handler. */
+private final GridContinuousHandler hnd;
+
+/** Routine id. */
+private final UUID routineId;
+
+/**
+ * @param routineId Routine id.
+ * @param qry Query info.
+ */
+public ContinuousQueryView(UUID routineId, RoutineInfo qry) {
+this.qry = qry;
+this.hnd = qry.handler();
+this.routineId = routineId;
+}
+
+/** @return Continuous query id. */
+public UUID routineId() {
+return routineId;
+}
+
+/** @return Node id. */
+public UUID nodeId() {
+return qry.nodeId();
+}
+
+/** @return Cache name. */
+@Order
+public String cacheName() {
+return hnd.cacheName();
+}
+
+/** @return Topic for continuous query messages. */
+public String topic() {
+return String.valueOf(hnd.orderedTopic());
 
 Review comment:
   Replaced with `Igniteutils#toStringSafe`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330626459
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 ##
 @@ -2056,13 +2098,16 @@ else if (log.isDebugEnabled())
 private boolean autoUnsubscribe;
 
 /**
+ * @param nodeId Node id.
  * @param prjPred Projection predicate.
  * @param hnd Continuous routine handler.
  * @param bufSize Buffer size.
  * @param interval Interval.
  * @param autoUnsubscribe Automatic unsubscribe flag.
  */
-LocalRoutineInfo(@Nullable IgnitePredicate prjPred,
+LocalRoutineInfo(
+UUID nodeId,
 
 Review comment:
   We can't dot it because `LocalRoutineInfo` is serializable and sent to 
remote node.
   Please, take a look at `GridContinuousProcessor#getDiscoveryData`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330617006
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ContinuousQueryView.java
 ##
 @@ -0,0 +1,214 @@
+/*
+ * 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.spi.systemview.view;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.ContinuousQueryWithTransformer;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
+import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
+import 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.RoutineInfo;
+
+/**
+ * Continuous query representation for a {@link SystemView}.
+ */
+public class ContinuousQueryView {
+/** Routine info. */
+private final RoutineInfo qry;
+
+/** Continuous query handler. */
+private final GridContinuousHandler hnd;
+
+/** Routine id. */
+private final UUID routineId;
+
+/**
+ * @param routineId Routine id.
+ * @param qry Query info.
+ */
+public ContinuousQueryView(UUID routineId, RoutineInfo qry) {
+this.qry = qry;
+this.hnd = qry.handler();
+this.routineId = routineId;
+}
+
+/** @return Continuous query id. */
+public UUID routineId() {
+return routineId;
+}
+
+/** @return Node id. */
+public UUID nodeId() {
+return qry.nodeId();
+}
+
+/** @return Cache name. */
+@Order
+public String cacheName() {
+return hnd.cacheName();
+}
+
+/** @return Topic for continuous query messages. */
+public String topic() {
+return String.valueOf(hnd.orderedTopic());
+}
+
+/** @return Buffer size. */
+public int bufferSize() {
+return qry.bufferSize();
+}
+
+/** @return Notify interval. */
+public long interval() {
+return qry.interval();
+}
+
+/** @return Auto unsubscribe flag value. */
+public boolean autoUnsubscribe() {
+return qry.autoUnsubscribe();
+}
+
+/** @return {@code True} if continuous query registered to receive events. 
*/
+public boolean isEvents() {
+return hnd.isEvents();
+}
+
+/** @return {@code True} if continuous query registered for messaging. */
+public boolean isMessaging() {
+return hnd.isMessaging();
+}
+
+/** @return {@code True} if regular continuous query. */
+public boolean isQuery() {
+return hnd.isQuery();
+}
+
+/**
+ * @return {@code True} if {@code keepBinary} mode enabled.
+ * @see IgniteCache#withKeepBinary()
+ */
+public boolean keepBinary() {
+return hnd.keepBinary();
+}
+
+/** @return {@code True} if continuous query should receive notification 
for existing entries. */
+public boolean notifyExisting() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+return hnd0 != null && hnd0.notifyExisting();
+}
+
+/** @return {@code True} if old value required for listener. */
+public boolean oldValueRequired() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+if (hnd0 == null)
+return false;
+
+return hnd0.oldValueRequired();
+}
+
+/** @return Last send time. */
+@Order(5)
+public long lastSendTime() {
+return qry.lastSendTime();
+}
+
+/** @return Delayed register flag. */
+public boolean delayedRegister() {
+return qry.delayedRegister();
+}
+
+/**
+ * @return String representation of local listener.
+ * @see ContinuousQuery#setLocalListener(CacheEntryUpdatedListener)
+ */
+@Order(1)
+public String localListener() {

[GitHub] [ignite] xtern commented on a change in pull request #6929: IGNITE-12181 Fixed assertion for non-persisted group in PDS enabled cluster.

2019-10-02 Thread GitBox
xtern commented on a change in pull request #6929: IGNITE-12181 Fixed assertion 
for non-persisted group in PDS enabled cluster.
URL: https://github.com/apache/ignite/pull/6929#discussion_r330606896
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsAtomicCacheHistoricalRebalancingTest.java
 ##
 @@ -61,4 +63,11 @@
 if (!walRebalanceInvoked)
 throw new AssertionError("WAL rebalance hasn't been invoked.");
 }
+
+/** {@inheritDoc} */
+@Test
+@Ignore
+@Override public void testTopologyChangesWithConstantLoadOnInMemoryCache() 
{
+// No-op.
+}
 
 Review comment:
   Because testTopologyChangesWithConstantLoad is the best that I found to 
check rebalancing with indexing, but as you may know, historical (WAL) 
rebalancing doesn't support for in-memory caches, so test case with in-memory 
cache should be ignored somehow.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] xtern commented on a change in pull request #6929: IGNITE-12181 Fixed assertion for non-persisted group in PDS enabled cluster.

2019-10-02 Thread GitBox
xtern commented on a change in pull request #6929: IGNITE-12181 Fixed assertion 
for non-persisted group in PDS enabled cluster.
URL: https://github.com/apache/ignite/pull/6929#discussion_r330606896
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsAtomicCacheHistoricalRebalancingTest.java
 ##
 @@ -61,4 +63,11 @@
 if (!walRebalanceInvoked)
 throw new AssertionError("WAL rebalance hasn't been invoked.");
 }
+
+/** {@inheritDoc} */
+@Test
+@Ignore
+@Override public void testTopologyChangesWithConstantLoadOnInMemoryCache() 
{
+// No-op.
+}
 
 Review comment:
   Because testTopologyChangesWithConstantLoad is the best that I found to 
check complex rebalancing with indexing, but as you may know, historical (WAL) 
rebalancing doesn't support for in-memory caches, so test case with in-memory 
cache should be ignored somehow.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] Mmuzaf commented on a change in pull request #6929: IGNITE-12181 Fixed assertion for non-persisted group in PDS enabled cluster.

2019-10-02 Thread GitBox
Mmuzaf commented on a change in pull request #6929: IGNITE-12181 Fixed 
assertion for non-persisted group in PDS enabled cluster.
URL: https://github.com/apache/ignite/pull/6929#discussion_r330601954
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsTxHistoricalRebalancingTest.java
 ##
 @@ -61,4 +63,11 @@
 if (!walRebalanceInvoked)
 throw new AssertionError("WAL rebalance hasn't been invoked.");
 }
+
+/** {@inheritDoc} */
+@Test
+@Ignore
+@Override public void testTopologyChangesWithConstantLoadOnInMemoryCache() 
{
+// No-op.
+}
 
 Review comment:
   Why we should do so?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] Mmuzaf commented on a change in pull request #6929: IGNITE-12181 Fixed assertion for non-persisted group in PDS enabled cluster.

2019-10-02 Thread GitBox
Mmuzaf commented on a change in pull request #6929: IGNITE-12181 Fixed 
assertion for non-persisted group in PDS enabled cluster.
URL: https://github.com/apache/ignite/pull/6929#discussion_r330601211
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsAtomicCacheHistoricalRebalancingTest.java
 ##
 @@ -61,4 +63,11 @@
 if (!walRebalanceInvoked)
 throw new AssertionError("WAL rebalance hasn't been invoked.");
 }
+
+/** {@inheritDoc} */
+@Test
+@Ignore
+@Override public void testTopologyChangesWithConstantLoadOnInMemoryCache() 
{
+// No-op.
+}
 
 Review comment:
   I think it is not good for adding new ignored tests. Why we should do so?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330566135
 
 

 ##
 File path: 
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
 ##
 @@ -332,6 +336,81 @@ public void testTransactions() throws Exception {
 assertTrue(res);
 }
 
+/** */
+@Test
+public void testContinuousQuery() throws Exception {
+try(IgniteEx g1 = startGrid(1)) {
+IgniteCache cache = 
ignite.createCache("cache-1");
+
+QueryCursor qry = cache.query(new ContinuousQuery<>()
+.setInitialQuery(new ScanQuery<>())
+.setPageSize(100)
+.setTimeInterval(1000)
+.setLocalListener(evts -> {
+// No-op.
+})
+.setRemoteFilterFactory(() -> evt -> true)
+);
+
+for (int i=0; i<100; i++)
+cache.put(i, i);
+
+List> qrys = execute(ignite,
+"SELECT " +
+"  CACHE_NAME, " +
+"  BUFFER_SIZE, " +
+"  INTERVAL, " +
+"  NODE_ID, " +
+"  LOCAL_LISTENER, " +
+"  REMOTE_FILTER, " +
+"  LOCAL_TRANSFORMED_LISTENER, " +
+"  REMOTE_TRANSFORMER " +
+"FROM SYS.QUERY_CONTINUOUS");
+
+assertEquals(1, qrys.size());
+
+//Info on originating node.
+for (List cq : qrys) {
+assertEquals("cache-1", cq.get(0));
+assertEquals(100, cq.get(1));
+assertEquals(1000L, cq.get(2));
+assertEquals(ignite.localNode().id(), cq.get(3));
+//Local listener not null on originating node.
+
assertTrue(cq.get(4).toString().startsWith(getClass().getName()));
+
assertTrue(cq.get(5).toString().startsWith(getClass().getName()));
+assertNull(cq.get(6));
+assertNull(cq.get(7));
+}
+
+qrys = execute(g1,
+"SELECT " +
+"  CACHE_NAME, " +
+"  BUFFER_SIZE, " +
+"  INTERVAL, " +
+"  NODE_ID, " +
+"  LOCAL_LISTENER, " +
+"  REMOTE_FILTER, " +
+"  LOCAL_TRANSFORMED_LISTENER, " +
+"  REMOTE_TRANSFORMER " +
+"FROM SYS.QUERY_CONTINUOUS");
+
+assertEquals(1, qrys.size());
+
+//Info on remote node.
+for (List cq : qrys) {
+assertEquals("cache-1", cq.get(0));
+assertEquals(100, cq.get(1));
+assertEquals(1000L, cq.get(2));
+assertEquals(ignite.localNode().id(), cq.get(3));
+//Local listener is null on remote nodes.
+assertNull(cq.get(4));
+
assertTrue(cq.get(5).toString().startsWith(getClass().getName()));
+assertNull(cq.get(6));
+assertNull(cq.get(7));
+}
 
 Review comment:
   code duplication


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330563172
 
 

 ##
 File path: 
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
 ##
 @@ -332,6 +336,81 @@ public void testTransactions() throws Exception {
 assertTrue(res);
 }
 
+/** */
+@Test
+public void testContinuousQuery() throws Exception {
+try(IgniteEx g1 = startGrid(1)) {
+IgniteCache cache = 
ignite.createCache("cache-1");
+
+QueryCursor qry = cache.query(new ContinuousQuery<>()
 
 Review comment:
   qry is not used.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330564716
 
 

 ##
 File path: 
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
 ##
 @@ -30,10 +30,14 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
 
 Review comment:
   unnecessary import


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330501207
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ContinuousQueryView.java
 ##
 @@ -0,0 +1,214 @@
+/*
+ * 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.spi.systemview.view;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.ContinuousQueryWithTransformer;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
+import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
+import 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.RoutineInfo;
+
+/**
+ * Continuous query representation for a {@link SystemView}.
+ */
+public class ContinuousQueryView {
+/** Routine info. */
+private final RoutineInfo qry;
+
+/** Continuous query handler. */
+private final GridContinuousHandler hnd;
+
+/** Routine id. */
+private final UUID routineId;
+
+/**
+ * @param routineId Routine id.
+ * @param qry Query info.
+ */
+public ContinuousQueryView(UUID routineId, RoutineInfo qry) {
+this.qry = qry;
+this.hnd = qry.handler();
+this.routineId = routineId;
+}
+
+/** @return Continuous query id. */
+public UUID routineId() {
+return routineId;
+}
+
+/** @return Node id. */
+public UUID nodeId() {
+return qry.nodeId();
+}
+
+/** @return Cache name. */
+@Order
+public String cacheName() {
+return hnd.cacheName();
+}
+
+/** @return Topic for continuous query messages. */
+public String topic() {
+return String.valueOf(hnd.orderedTopic());
+}
+
+/** @return Buffer size. */
+public int bufferSize() {
+return qry.bufferSize();
+}
+
+/** @return Notify interval. */
+public long interval() {
+return qry.interval();
+}
+
+/** @return Auto unsubscribe flag value. */
+public boolean autoUnsubscribe() {
+return qry.autoUnsubscribe();
+}
+
+/** @return {@code True} if continuous query registered to receive events. 
*/
+public boolean isEvents() {
+return hnd.isEvents();
+}
+
+/** @return {@code True} if continuous query registered for messaging. */
+public boolean isMessaging() {
+return hnd.isMessaging();
+}
+
+/** @return {@code True} if regular continuous query. */
+public boolean isQuery() {
+return hnd.isQuery();
+}
+
+/**
+ * @return {@code True} if {@code keepBinary} mode enabled.
+ * @see IgniteCache#withKeepBinary()
+ */
+public boolean keepBinary() {
+return hnd.keepBinary();
+}
+
+/** @return {@code True} if continuous query should receive notification 
for existing entries. */
+public boolean notifyExisting() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+return hnd0 != null && hnd0.notifyExisting();
+}
+
+/** @return {@code True} if old value required for listener. */
+public boolean oldValueRequired() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+if (hnd0 == null)
+return false;
+
+return hnd0.oldValueRequired();
+}
+
+/** @return Last send time. */
+@Order(5)
+public long lastSendTime() {
+return qry.lastSendTime();
+}
+
+/** @return Delayed register flag. */
+public boolean delayedRegister() {
+return qry.delayedRegister();
+}
+
+/**
+ * @return String representation of local listener.
+ * @see ContinuousQuery#setLocalListener(CacheEntryUpdatedListener)
+ */
+@Order(1)
+public String localListener() {
 

[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330522293
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ContinuousQueryView.java
 ##
 @@ -0,0 +1,214 @@
+/*
+ * 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.spi.systemview.view;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.ContinuousQueryWithTransformer;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
+import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
+import 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.RoutineInfo;
+
+/**
+ * Continuous query representation for a {@link SystemView}.
+ */
+public class ContinuousQueryView {
+/** Routine info. */
+private final RoutineInfo qry;
+
+/** Continuous query handler. */
+private final GridContinuousHandler hnd;
+
+/** Routine id. */
+private final UUID routineId;
+
+/**
+ * @param routineId Routine id.
+ * @param qry Query info.
+ */
+public ContinuousQueryView(UUID routineId, RoutineInfo qry) {
+this.qry = qry;
+this.hnd = qry.handler();
+this.routineId = routineId;
+}
+
+/** @return Continuous query id. */
+public UUID routineId() {
+return routineId;
+}
+
+/** @return Node id. */
+public UUID nodeId() {
+return qry.nodeId();
+}
+
+/** @return Cache name. */
+@Order
+public String cacheName() {
+return hnd.cacheName();
+}
+
+/** @return Topic for continuous query messages. */
+public String topic() {
+return String.valueOf(hnd.orderedTopic());
 
 Review comment:
   Pay attention that most methods of this class return the null as String, but 
this method returns "null" as String. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330496223
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ContinuousQueryView.java
 ##
 @@ -0,0 +1,214 @@
+/*
+ * 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.spi.systemview.view;
+
+import java.util.UUID;
+import javax.cache.configuration.Factory;
+import javax.cache.event.CacheEntryUpdatedListener;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.ContinuousQueryWithTransformer;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
+import org.apache.ignite.internal.processors.continuous.GridContinuousHandler;
+import 
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.RoutineInfo;
+
+/**
+ * Continuous query representation for a {@link SystemView}.
+ */
+public class ContinuousQueryView {
+/** Routine info. */
+private final RoutineInfo qry;
+
+/** Continuous query handler. */
+private final GridContinuousHandler hnd;
+
+/** Routine id. */
+private final UUID routineId;
+
+/**
+ * @param routineId Routine id.
+ * @param qry Query info.
+ */
+public ContinuousQueryView(UUID routineId, RoutineInfo qry) {
+this.qry = qry;
+this.hnd = qry.handler();
+this.routineId = routineId;
+}
+
+/** @return Continuous query id. */
+public UUID routineId() {
+return routineId;
+}
+
+/** @return Node id. */
+public UUID nodeId() {
+return qry.nodeId();
+}
+
+/** @return Cache name. */
+@Order
+public String cacheName() {
+return hnd.cacheName();
+}
+
+/** @return Topic for continuous query messages. */
+public String topic() {
+return String.valueOf(hnd.orderedTopic());
+}
+
+/** @return Buffer size. */
+public int bufferSize() {
+return qry.bufferSize();
+}
+
+/** @return Notify interval. */
+public long interval() {
+return qry.interval();
+}
+
+/** @return Auto unsubscribe flag value. */
+public boolean autoUnsubscribe() {
+return qry.autoUnsubscribe();
+}
+
+/** @return {@code True} if continuous query registered to receive events. 
*/
+public boolean isEvents() {
+return hnd.isEvents();
+}
+
+/** @return {@code True} if continuous query registered for messaging. */
+public boolean isMessaging() {
+return hnd.isMessaging();
+}
+
+/** @return {@code True} if regular continuous query. */
+public boolean isQuery() {
+return hnd.isQuery();
+}
+
+/**
+ * @return {@code True} if {@code keepBinary} mode enabled.
+ * @see IgniteCache#withKeepBinary()
+ */
+public boolean keepBinary() {
+return hnd.keepBinary();
+}
+
+/** @return {@code True} if continuous query should receive notification 
for existing entries. */
+public boolean notifyExisting() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+return hnd0 != null && hnd0.notifyExisting();
+}
+
+/** @return {@code True} if old value required for listener. */
+public boolean oldValueRequired() {
+CacheContinuousQueryHandler hnd0 = cacheHandler();
+
+if (hnd0 == null)
+return false;
+
+return hnd0.oldValueRequired();
 
 Review comment:
   Can be simplified:
   `return hnd0 != null && hnd0.oldValueRequired();`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330542891
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -461,6 +466,61 @@ public void testClientsConnections() throws Exception {
 }
 }
 
+/** */
+@Test
+public void testContinuousQuery() throws Exception {
+try(IgniteEx g0 = startGrid(0); IgniteEx g1 = startGrid(1)) {
+IgniteCache cache = g0.createCache("cache-1");
+
+QueryCursor qry = cache.query(new ContinuousQuery<>()
 
 Review comment:
   qry is not used.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330538829
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 ##
 @@ -2056,13 +2098,16 @@ else if (log.isDebugEnabled())
 private boolean autoUnsubscribe;
 
 /**
+ * @param nodeId Node id.
  * @param prjPred Projection predicate.
  * @param hnd Continuous routine handler.
  * @param bufSize Buffer size.
  * @param interval Interval.
  * @param autoUnsubscribe Automatic unsubscribe flag.
  */
-LocalRoutineInfo(@Nullable IgnitePredicate prjPred,
+LocalRoutineInfo(
+UUID nodeId,
 
 Review comment:
   I think there is no reason to make classes (interface) RoutineInfo
   , LocalRoutineInfo and RemoteRoutineInfo static.
   If LocalRoutineInfo isn't static, you can make the constructor like this:
   ```
   LocalRoutineInfo(
   @Nullable IgnitePredicate prjPred,
   GridContinuousHandler hnd,
   int bufSize,
   long interval,
   boolean autoUnsubscribe)
   {
   assert hnd != null;
   assert bufSize > 0;
   assert interval >= 0;
   assert ctx != null;
   
   this.nodeId = ctx.localNodeId();
   this.prjPred = prjPred;
   this.hnd = hnd;
   this.bufSize = bufSize;
   this.interval = interval;
   this.autoUnsubscribe = autoUnsubscribe;
   }
   ```
   That approach is required fewer changes and less error-prone.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous query system view.

2019-10-02 Thread GitBox
dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330550838
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##
 @@ -461,6 +466,61 @@ public void testClientsConnections() throws Exception {
 }
 }
 
+/** */
+@Test
+public void testContinuousQuery() throws Exception {
+try(IgniteEx g0 = startGrid(0); IgniteEx g1 = startGrid(1)) {
+IgniteCache cache = g0.createCache("cache-1");
+
+QueryCursor qry = cache.query(new ContinuousQuery<>()
+.setInitialQuery(new ScanQuery<>())
+.setPageSize(100)
+.setTimeInterval(1000)
+.setLocalListener(evts -> {
+// No-op.
+})
+.setRemoteFilterFactory(() -> evt -> true)
+);
+
+for (int i=0; i<100; i++)
+cache.put(i, i);
+
+SystemView qrys = 
g0.context().systemView().view(CQ_SYS_VIEW);
+
+assertEquals(1, qrys.size());
+
+//Info on originating node.
+for (ContinuousQueryView cq : qrys) {
+assertEquals("cache-1", cq.cacheName());
+assertEquals(100, cq.bufferSize());
+assertEquals(1000, cq.interval());
+assertEquals(g0.localNode().id(), cq.nodeId());
+//Local listener not null on originating node.
+
assertTrue(cq.localListener().startsWith(getClass().getName()));
+assertTrue(cq.remoteFilter().startsWith(getClass().getName()));
+assertNull(cq.localTransformedListener());
+assertNull(cq.remoteTransformer());
+}
+
+qrys = g1.context().systemView().view(CQ_SYS_VIEW);
+
+assertEquals(1, qrys.size());
+
+//Info on remote node.
+for (ContinuousQueryView cq : qrys) {
+assertEquals("cache-1", cq.cacheName());
+assertEquals(100, cq.bufferSize());
+assertEquals(1000, cq.interval());
+assertEquals(g0.localNode().id(), cq.nodeId());
+//Local listener is null on remote nodes.
+assertNull(cq.localListener());
+assertTrue(cq.remoteFilter().startsWith(getClass().getName()));
+assertNull(cq.localTransformedListener());
+assertNull(cq.remoteTransformer());
+}
 
 Review comment:
   It looks like code duplication.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] asfgit closed pull request #6801: IGNITE-10113 Invoke failure handler on index build errors.

2019-10-02 Thread GitBox
asfgit closed pull request #6801: IGNITE-10113 Invoke failure handler on index 
build errors.
URL: https://github.com/apache/ignite/pull/6801
 
 
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects 
system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330466102
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
+"SYS.TABLE_COLUMNS.AUTO_INCREMENT.null.1",
+"SYS.VIEW_COLUMNS.NULLABLE.null.1",
+"SYS.VIEW_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.TYPE.null.2147483647",
+"SYS.VIEW_COLUMNS.PRECISION.null.19",
 
 Review comment:
   Seems, precision is the right word. It used in other places over the 
codebase.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects 
system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330465972
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
+"SYS.TABLE_COLUMNS.AUTO_INCREMENT.null.1",
+"SYS.VIEW_COLUMNS.NULLABLE.null.1",
+"SYS.VIEW_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.TYPE.null.2147483647",
+"SYS.VIEW_COLUMNS.PRECISION.null.19",
+"SYS.VIEW_COLUMNS.DEFATULT.null.2147483647",
 
 Review comment:
   Renamed to DEFAULT_VALUE since "default" is java keyword.
   
   


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects 
system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330465882
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
 
 Review comment:
   Renamed to DEFAULT_VALUE since "default" is java keyword.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
nizhikov commented on a change in pull request #6916: IGNITE-12213: Sql objects 
system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330463841
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
 
 Review comment:
   Seems, precision is the right word. It used in other places over the 
codebase.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330462185
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/SystemViewArrayContainerAdapter.java
 ##
 @@ -0,0 +1,111 @@
+/*
+ * 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.internal.managers.systemview;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.spi.systemview.view.SystemViewRowAttributeWalker;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * System view backed by {@code data} container.
+ * Each instance of {@code containers} collections should provide a array of 
data.
+ *
+ * @see SystemView
+ */
+public class SystemViewArrayContainerAdapter extends 
AbstractSystemView {
 
 Review comment:
   Also, perhaps these two classes can be replaced by one which iterates 
through iterables. Size method doesn't really mandatory if you return 
`canGetRowCount` as `false` for these views. In this case size will be 
calculated by H2.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330451831
 
 

 ##
 File path: 
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/SchemaManager.java
 ##
 @@ -23,6 +23,7 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
+import java.util.Arrays;
 
 Review comment:
   Unused import


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330448055
 
 

 ##
 File path: 
modules/indexing/src/main/java/org/apache/ignite/spi/systemview/view/SqlTableView.java
 ##
 @@ -0,0 +1,112 @@
+/*
+ * 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.spi.systemview.view;
+
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
+import org.h2.table.IndexColumn;
+
+/**
+ * Sql table representation for a {@link SystemView}.
+ */
+public class SqlTableView {
+/** Table. */
+private final GridH2Table tbl;
+
+/** Affinity column name. */
+private String affColName;
+
+public SqlTableView(GridH2Table tbl) {
+this.tbl = tbl;
+
+IndexColumn affCol = tbl.getAffinityKeyColumn();
+
+if (affCol != null) {
+// Only explicit affinity column should be shown. Do not do this 
for _KEY or it's alias.
+if (!tbl.rowDescriptor().isKeyColumn(affCol.column.getColumnId())) 
{
+affColName = affCol.columnName;
+}
+}
+}
+
+/** @return Cache group id. */
+@Order(3)
+public int cacheGroupId() {
+return tbl.cacheInfo().groupId();
+}
+
+/** @return Cache group name. */
+@Order(4)
+public String cacheGroupName() {
+return tbl.cacheInfo().cacheContext().group().cacheOrGroupName();
 
 Review comment:
   You should not rely on cache context since it's possible that cache context 
for some caches is absent on some nodes. All information must be retrieved from 
cache descriptors.
   Also, I don't think "cache group id" and "cache group name" fields is needed 
here and in `SqlIndexView` at all. They don't related to SQL table directly 
(related via cache) and can be easily retrieved by join with the caches view (I 
know that these fields already was in Ignite, but AFAIK there was no Ignite 
release since table view was added, so perhaps we can fix it now).


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330454241
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/SystemViewArrayContainerAdapter.java
 ##
 @@ -0,0 +1,111 @@
+/*
+ * 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.internal.managers.systemview;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.spi.systemview.view.SystemViewRowAttributeWalker;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * System view backed by {@code data} container.
+ * Each instance of {@code containers} collections should provide a array of 
data.
+ *
+ * @see SystemView
+ */
+public class SystemViewArrayContainerAdapter extends 
AbstractSystemView {
+/** Collections of the data containers */
+private final Collection containers;
+
+/** Function to extract collection of the data from container. */
+private final Function dataExtractor;
+
+/** Row function. */
+private final BiFunction rowFunc;
+
+/**
+ * @param name Name.
+ * @param desc Description.
+ * @param rowCls Row class.
+ * @param walker Walker.
+ * @param containers Container of data.
+ * @param dataExtractor Data extractor function.
+ * @param rowFunc Row function.
+ */
+public SystemViewArrayContainerAdapter(String name, String desc, Class 
rowCls,
+SystemViewRowAttributeWalker walker,
+Collection containers,
+Function dataExtractor,
+BiFunction rowFunc) {
+super(name, desc, rowCls, walker);
+
+this.containers = containers;
+this.dataExtractor = dataExtractor;
+this.rowFunc = rowFunc;
+}
+
+/** {@inheritDoc} */
+@Override public int size() {
+int sz = 0;
+
+for (C c : containers)
+sz += dataExtractor.apply(c).length;
+
+return sz;
+}
+
+/** {@inheritDoc} */
+@NotNull @Override public Iterator iterator() {
 
 Review comment:
   I think it can be simplified by using `F.concat(F.iterator(...))`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330426434
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
 
 Review comment:
   DEFAULT


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330426551
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
 
 Review comment:
   PRECE**SS**ION


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330453659
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/SystemViewCollectionContainerAdapter.java
 ##
 @@ -0,0 +1,109 @@
+/*
+ * 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.internal.managers.systemview;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.spi.systemview.view.SystemViewRowAttributeWalker;
+import org.jetbrains.annotations.NotNull;
+
+import static java.util.Collections.emptyIterator;
+
+/**
+ * System view backed by {@code data} container.
+ * Each instance of {@code containers} collections should provide a collection 
of data.
+ *
+ * @see SystemView
+ */
+public class SystemViewCollectionContainerAdapter extends 
AbstractSystemView {
+/** Collections of the data containers */
+private final Collection containers;
+
+/** Function to extract collection of the data from container. */
+private final Function> dataExtractor;
+
+/** Row function. */
+private final BiFunction rowFunc;
+
+/**
+ * @param name Name.
+ * @param desc Description.
+ * @param rowCls Row class.
+ * @param walker Walker.
+ * @param containers Container of data.
+ * @param dataExtractor Data extractor function.
+ * @param rowFunc Row function.
+ */
+public SystemViewCollectionContainerAdapter(String name, String desc, 
Class rowCls,
+SystemViewRowAttributeWalker walker,
+Collection containers,
+Function> dataExtractor,
+BiFunction rowFunc) {
+super(name, desc, rowCls, walker);
+
+this.containers = containers;
+this.dataExtractor = dataExtractor;
+this.rowFunc = rowFunc;
+}
+
+/** {@inheritDoc} */
+@Override public int size() {
+int sz = 0;
+
+for (C c : containers)
+sz += dataExtractor.apply(c).size();
+
+return sz;
+}
+
+/** {@inheritDoc} */
+@NotNull @Override public Iterator iterator() {
+return new Iterator() {
 
 Review comment:
   I think it can be simplified by using `F.concat(F.iterator(...))`


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330457656
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/SystemViewArrayContainerAdapter.java
 ##
 @@ -0,0 +1,111 @@
+/*
+ * 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.internal.managers.systemview;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.spi.systemview.view.SystemViewRowAttributeWalker;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * System view backed by {@code data} container.
+ * Each instance of {@code containers} collections should provide a array of 
data.
+ *
+ * @see SystemView
+ */
+public class SystemViewArrayContainerAdapter extends 
AbstractSystemView {
 
 Review comment:
   Personally, I don't like this name, because "array container" means 
something storing the array. Here you don't store the array, but iterates 
through the nested array. But I'm ok with this name if there is no better name 
for the class.
   The same for `SystemViewCollectionContainerAdapter` class and `register...` 
methods.


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330427224
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
+"SYS.TABLE_COLUMNS.AUTO_INCREMENT.null.1",
+"SYS.VIEW_COLUMNS.NULLABLE.null.1",
+"SYS.VIEW_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.TYPE.null.2147483647",
+"SYS.VIEW_COLUMNS.PRECISION.null.19",
+"SYS.VIEW_COLUMNS.DEFATULT.null.2147483647",
 
 Review comment:
   DEFAULT


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330427311
 
 

 ##
 File path: 
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
 ##
 @@ -788,14 +790,45 @@ public void testGetAllColumns() throws Exception {
 "SYS.TRANSACTIONS.OTHER_NODE_ID.null.2147483647",
 "SYS.TRANSACTIONS.TOP_VER.null.2147483647",
 "SYS.TRANSACTIONS.KEYS_COUNT.null.10",
-"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647"
+"SYS.TRANSACTIONS.CACHE_IDS.null.2147483647",
+"SYS.CLIENT_CONNECTIONS.VERSION.null.2147483647",
+"SYS.SCHEMAS.NAME.null.2147483647",
+"SYS.SCHEMAS.PREDEFINED.null.1",
+"SYS.TABLES.CACHE_GROUP_ID.null.10",
+"SYS.TABLES.CACHE_GROUP_NAME.null.2147483647",
+"SYS.TABLES.CACHE_ID.null.10",
+"SYS.TABLES.CACHE_NAME.null.2147483647",
+"SYS.TABLES.SCHEMA_NAME.null.2147483647",
+"SYS.TABLES.TABLE_NAME.null.2147483647",
+"SYS.TABLES.AFFINITY_KEY_COLUMN.null.2147483647",
+"SYS.TABLES.KEY_ALIAS.null.2147483647",
+"SYS.TABLES.VALUE_ALIAS.null.2147483647",
+"SYS.TABLES.KEY_TYPE_NAME.null.2147483647",
+"SYS.TABLES.VALUE_TYPE_NAME.null.2147483647",
+"SYS.VIEWS.NAME.null.2147483647",
+"SYS.VIEWS.DESCRIPTION.null.2147483647",
+"SYS.VIEWS.SCHEMA.null.2147483647",
+"SYS.TABLE_COLUMNS.AFFINITY_COLUMN.null.1",
+"SYS.TABLE_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.SCALE.null.10",
+"SYS.TABLE_COLUMNS.PK.null.1",
+"SYS.TABLE_COLUMNS.TYPE.null.2147483647",
+"SYS.TABLE_COLUMNS.DEFATULT.null.2147483647",
+"SYS.TABLE_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.TABLE_NAME.null.2147483647",
+"SYS.TABLE_COLUMNS.NULLABLE.null.1",
+"SYS.TABLE_COLUMNS.PRECISION.null.10",
+"SYS.TABLE_COLUMNS.AUTO_INCREMENT.null.1",
+"SYS.VIEW_COLUMNS.NULLABLE.null.1",
+"SYS.VIEW_COLUMNS.SCHEMA_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.COLUMN_NAME.null.2147483647",
+"SYS.VIEW_COLUMNS.TYPE.null.2147483647",
+"SYS.VIEW_COLUMNS.PRECISION.null.19",
 
 Review comment:
   PRECE**SS**ION


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330436267
 
 

 ##
 File path: 
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
 ##
 @@ -205,6 +205,8 @@ public GridH2Table(
 // Indexes must be created in the end when everything is ready.
 idxs = tblDesc.createSystemIndexes(this);
 
+//TODO: add idxs to SqlIndexView here!!!
 
 Review comment:
   ?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql objects system views.

2019-10-02 Thread GitBox
alex-plekhanov commented on a change in pull request #6916: IGNITE-12213: Sql 
objects system views.
URL: https://github.com/apache/ignite/pull/6916#discussion_r330453178
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/ReadOnlyCollectionViewN.java
 ##
 @@ -0,0 +1,111 @@
+/*
+ * 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.internal.util.lang.gridfunc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.ignite.internal.util.GridSerializableCollection;
+import org.apache.ignite.internal.util.GridSerializableIterator;
+import org.apache.ignite.internal.util.lang.GridFunc;
+import org.apache.ignite.internal.util.typedef.internal.A;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Collections wrapper.
+ * A read-only view will be created over the element and given
+ * collections and no copying will happen.
+ *
+ * @param  Element type.
+ */
+public class ReadOnlyCollectionViewN extends GridSerializableCollection {
 
 Review comment:
   There is no usages of this class. Also, class functionality can be replaced 
by `F.flatCollection()`


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:
us...@infra.apache.org


With regards,
Apache Git Services