[GitHub] [ignite] nizhikov commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7495: IGNITE-12745: Compute job 
view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387947503
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
 
 Review comment:
   tests added.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387875432
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
 
 Review comment:
   Let's increase timeout to avoid infrastructures affect. 


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] gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387864129
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/FilterNode.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.processors.query.calcite.exec.rel;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.function.Predicate;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ *
+ */
+public class FilterNode extends AbstractNode implements 
SingleNode, Upstream {
+/** */
+private final Predicate predicate;
+
+/** */
+private Deque inBuffer = new ArrayDeque<>(IN_BUFFER_SIZE);
 
 Review comment:
   A filter node requests more rows than its consumer requests from the filter 
because the filter filters some of them) a small buffer is used to hold the 
difference till a next portion of rows is requested. The same is true for other 
nodes, where a node requests from its input more rows than it's requested from 
the node itself.


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] gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387864129
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/FilterNode.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.processors.query.calcite.exec.rel;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.function.Predicate;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ *
+ */
+public class FilterNode extends AbstractNode implements 
SingleNode, Upstream {
+/** */
+private final Predicate predicate;
+
+/** */
+private Deque inBuffer = new ArrayDeque<>(IN_BUFFER_SIZE);
 
 Review comment:
   A filter node requests more rows than its consumer requests from the filter 
because the filter filters some of them) a small buffer is used to hold the 
difference till a next portion of rows is requested. The same is true for other 
nodes, where you may request from a node input more rows than it's requested 
from the node itself.


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] gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387865444
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/Upstream.java
 ##
 @@ -15,25 +15,26 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.internal.processors.query.calcite.exec;
+package org.apache.ignite.internal.processors.query.calcite.exec.rel;
 
 /**
  * Represents an abstract data consumer.
  *
- * Note: except several cases (like consumer node and mailboxes), 
{@link Node#request()}, {@link Node#cancel()},
- * {@link Node#reset()}, {@link Sink#push(Object)} and {@link Sink#end()} 
methods should be used from one single thread.
+ * Note: except several cases (like consumer node and mailboxes), 
{@link Node#request(int)}, {@link Node#cancel()},
+ * {@link Upstream#push(Object)} and {@link Upstream#end()} methods should be 
used from one single thread.
  */
-public interface Sink {
+public interface Upstream {
 
 Review comment:
   Yes, you right, it's my mistake, of course "downstream" should be 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] gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
gvvinblade commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387864129
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/FilterNode.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.processors.query.calcite.exec.rel;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.function.Predicate;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ *
+ */
+public class FilterNode extends AbstractNode implements 
SingleNode, Upstream {
+/** */
+private final Predicate predicate;
+
+/** */
+private Deque inBuffer = new ArrayDeque<>(IN_BUFFER_SIZE);
 
 Review comment:
   A filter node requests more rows than its consumer requests from the filter 
because the filter filters some of them) a small buffer is used to hold the 
difference till a next portion of rows is requested. The same is true for other 
nodes, where you may request from a node input more rows then requested from 
the node itself.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387854228
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387854228
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387849364
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,196 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import org.apache.ignite.internal.managers.collision.GridCollisionManager;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.spi.collision.CollisionSpi;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Compute job state. */
+public enum ComputeJobState {
+/**
+ * Job scheduled for the execution.
+ * If collision not configured all jobs in this state by default.
+ *
+ * @see GridCollisionManager
+ * @see CollisionSpi
+ */
+ACTIVE,
+
+/**
+ * If collision configured jobs may be passivated before execution.
+ *
+ * @see GridCollisionManager
+ * @see CollisionSpi
+ */
+PASSIVE,
+
+/**
+ * Job execution canceled.
+ *
+ * @see GridJobProcessor#cancelJob(IgniteUuid, IgniteUuid, boolean)
+ */
+CANCELED
+}
+
+/** Job. */
+public final GridJobWorker job;
+
+/** Job id. */
+public final IgniteUuid id;
+
+/** Job state. */
+public final ComputeJobState state;
+
+/**
+ * @param id Job id.
+ * @param job Job.
+ * @param state Job state.
+ */
+public ComputeJobView(IgniteUuid id, GridJobWorker job, ComputeJobState 
state) {
+this.id = id;
+this.job = job;
+this.state = state;
+}
+
+/** @return Job id. */
+@Order
+public IgniteUuid id() {
+return id;
+}
+
+/**
+ * {@link ComputeJobView#sessionId()} value equal to the value of {@link 
ComputeTaskView#sessionId()}
+ * if both records represents parts of the same computation.
+ *
+ * @return Session id.
+ * @see ComputeTaskView#sessionId()
+ */
+@Order(1)
+public IgniteUuid sessionId() {
+return job.getSession().getId();
+}
+
+/** @return Origin node id. */
+@Order(2)
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return Task name. */
+@Order(3)
+public String taskName() {
+return job.getSession().getTaskName();
+}
+
+/** @return Task class name. */
+@Order(4)
+public String taskClassName() {
+return job.getSession().getTaskClassName();
+}
+
+/** @return Comma separated list of cache identifiers or {@code null} for 
non affinity call. */
+@Order(5)
+public String affinityCacheIds() {
+GridReservable res = job.getPartsReservation();
+
+if (!(res instanceof GridJobProcessor.PartitionsReservation))
+return null;
+
+int[] ids = 
((GridJobProcessor.PartitionsReservation)res).getCacheIds();
+
+if (ids == null || ids.length == 0)
+return null;
+
+StringJoiner joiner = new StringJoiner(",");
+
+for (int id : ids)
+joiner.add(Integer.toString(id));
+
+return joiner.toString();
+}
+
+/** @return Affinity partition id or {@code -1} for non affinity call. */
+@Order(6)
+public int affinityPartitionId() {
+GridReservable res = job.getPartsReservation();
+
+if (!(res instanceof GridJobProcessor.PartitionsReservation))
+return -1;
+
+return ((GridJobProcessor.PartitionsReservation)res).getPartId();
+}
+
+/** @return Create time in milliseconds. */
+@Order(7)
+public long createTime() {
+return job.getCreateTime();
+

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387833290
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387844593
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
 
 Review comment:
   Can you cover job states(PASSIVE, CANCELED), 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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387846530
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387842471
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387837734
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
 
 Review comment:
   I suggest adding a check that jobs.size will be 0 after all jobs finish. 


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387850173
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
+
+checkTask(t);
+
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#runAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeRunnable() throws Exception {
+barrier = new CyclicBarrier(2);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+client.compute().runAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 

[GitHub] [ignite] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387834148
 
 

 ##
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewComputeJobTest.java
 ##
 @@ -0,0 +1,352 @@
+/*
+ * 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.metric;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeoutException;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeJobResultPolicy;
+import org.apache.ignite.compute.ComputeTask;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.spi.systemview.view.ComputeJobView;
+import org.apache.ignite.spi.systemview.view.ComputeTaskView;
+import org.apache.ignite.spi.systemview.view.SystemView;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.processors.job.GridJobProcessor.JOBS_VIEW;
+import static 
org.apache.ignite.internal.processors.task.GridTaskProcessor.TASKS_VIEW;
+import static 
org.apache.ignite.spi.systemview.view.ComputeJobView.ComputeJobState.ACTIVE;
+
+/** Tests for compute task {@link SystemView}. */
+public class SystemViewComputeJobTest extends GridCommonAbstractTest {
+/** */
+public static final long TIMEOUT = 5_000L;
+
+/** */
+private static CyclicBarrier barrier;
+
+/** */
+private static IgniteEx server;
+
+/** */
+private static IgniteEx client;
+
+/** */
+private static IgniteCache cache;
+
+/** {@inheritDoc} */
+@Override protected void beforeTestsStarted() throws Exception {
+server = startGrid(0);
+client = startClientGrid(1);
+
+cache = server.createCache("test-cache");
+
+cache.put(1, 1);
+}
+
+/** Tests work of {@link SystemView} for compute grid {@link 
IgniteCompute#broadcastAsync(IgniteRunnable)} call. */
+@Test
+public void testComputeBroadcast() throws Exception {
+barrier = new CyclicBarrier(6);
+
+SystemView jobs = 
server.context().systemView().view(JOBS_VIEW);
+
+for (int i = 0; i < 5; i++) {
+client.compute().broadcastAsync(() -> {
+try {
+barrier.await(TIMEOUT, MILLISECONDS);
+barrier.await(TIMEOUT, MILLISECONDS);
+}
+catch (InterruptedException | BrokenBarrierException | 
TimeoutException e) {
+throw new RuntimeException(e);
+}
+});
+}
+
+barrier.await(TIMEOUT, MILLISECONDS);
+
+assertEquals(5, jobs.size());
+
+ComputeJobView t = jobs.iterator().next();
 
 Review comment:
   Lets check each job view:
   ```
   for (ComputeJobView job : jobs)
checkJob(job);
   ```


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 #7486: IGNITE-12733: TransmissionHandler can now notify user listeners when it ends

2020-03-04 Thread GitBox
Mmuzaf commented on a change in pull request #7486: IGNITE-12733: 
TransmissionHandler can now notify user listeners when it ends
URL: https://github.com/apache/ignite/pull/7486#discussion_r387846357
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 ##
 @@ -2835,7 +2835,11 @@ private void receiveFromChannel(
 boolean exit = in.readBoolean();
 
 if (exit) {
-rcvCtxs.remove(topic);
+ReceiverContext rcv0 = rcvCtxs.remove(topic);
 
 Review comment:
   fixed


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 #7486: IGNITE-12733: TransmissionHandler can now notify user listeners when it ends

2020-03-04 Thread GitBox
Mmuzaf commented on a change in pull request #7486: IGNITE-12733: 
TransmissionHandler can now notify user listeners when it ends
URL: https://github.com/apache/ignite/pull/7486#discussion_r387846291
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/TransmissionHandler.java
 ##
 @@ -40,6 +40,15 @@
  * {@link TransmissionPolicy#CHUNK} the #chunkHandler() will be 
picked up.
  */
 public interface TransmissionHandler {
+/**
+ * The end of the handled transmission. This means that all resources 
associated with previously opened
+ * session are freed and can be reused. Generally, it means that 
transmission topic from now can
 
 Review comment:
   fixed


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 #7486: IGNITE-12733: TransmissionHandler can now notify user listeners when it ends

2020-03-04 Thread GitBox
xtern commented on a change in pull request #7486: IGNITE-12733: 
TransmissionHandler can now notify user listeners when it ends
URL: https://github.com/apache/ignite/pull/7486#discussion_r387805861
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 ##
 @@ -2835,7 +2835,11 @@ private void receiveFromChannel(
 boolean exit = in.readBoolean();
 
 if (exit) {
-rcvCtxs.remove(topic);
+ReceiverContext rcv0 = rcvCtxs.remove(topic);
 
 Review comment:
   Why not name this variable simply "rcv" (instead of rcv0)?


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 #7486: IGNITE-12733: TransmissionHandler can now notify user listeners when it ends

2020-03-04 Thread GitBox
xtern commented on a change in pull request #7486: IGNITE-12733: 
TransmissionHandler can now notify user listeners when it ends
URL: https://github.com/apache/ignite/pull/7486#discussion_r387799642
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/TransmissionHandler.java
 ##
 @@ -40,6 +40,15 @@
  * {@link TransmissionPolicy#CHUNK} the #chunkHandler() will be 
picked up.
  */
 public interface TransmissionHandler {
+/**
+ * The end of the handled transmission. This means that all resources 
associated with previously opened
+ * session are freed and can be reused. Generally, it means that 
transmission topic from now can
 
 Review comment:
   "session is freed"


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 #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387732736
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFileSender.java
 ##
 @@ -0,0 +1,236 @@
+/*
+ * 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.processors.cache.persistence.snapshot;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.binary.BinaryType;
+import 
org.apache.ignite.internal.processors.cache.persistence.partstate.GroupPartitionId;
+import org.apache.ignite.internal.processors.marshaller.MappedName;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+abstract class SnapshotFileSender {
+/** Busy processing lock. */
+private final ReadWriteLock lock = new ReentrantReadWriteLock();
+
+/** Executor to run operation at. */
+private final Executor exec;
+
+/** {@code true} if sender is currently working */
+private volatile boolean closed;
+
+/** Ignite logger to use. */
+protected final IgniteLogger log;
+
+/**
+ * @param log Ignite logger to use.
+ */
+protected SnapshotFileSender(IgniteLogger log, Executor exec) {
+this.exec = exec;
+this.log = log.getLogger(SnapshotFileSender.class);
+}
+
+/**
+ * @return Executor to run internal operations on.
+ */
+public Executor executor() {
+return exec;
+}
+
+/**
+ * @param mappings Local node marshaller mappings.
+ */
+public final void sendMarshallerMeta(List> 
mappings) {
+if (!lock.readLock().tryLock())
+return;
+
+try {
+if (closed)
+return;
+
+if (mappings == null)
+return;
+
+sendMarshallerMeta0(mappings);
+}
+finally {
+lock.readLock().unlock();
+}
+}
+
+/**
+ * @param types Collection of known binary types.
+ */
+public final void sendBinaryMeta(Map types) {
 
 Review comment:
   Use `Collection` here instead of `Map`


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 #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387671245
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java
 ##
 @@ -93,22 +97,33 @@
 
 fileIOFactory = 
ctx.config().getDataStorageConfiguration().getFileIOFactory();
 
-if (binaryMetadataFileStoreDir != null)
-workDir = binaryMetadataFileStoreDir;
-else {
-final String subFolder = 
ctx.pdsFolderResolver().resolveFolders().folderName();
-
-workDir = new File(U.resolveWorkDirectory(
-ctx.config().getWorkDirectory(),
-"binary_meta",
-false
-),
-subFolder);
-}
+try {
+if (binaryMetadataFileStoreDir != null)
+workDir = binaryMetadataFileStoreDir;
+else {
+final String subFolder = 
ctx.pdsFolderResolver().resolveFolders().folderName();
+
+workDir = new File(U.resolveWorkDirectory(
+igniteWorkDir,
+"binary_meta",
+false
+),
+subFolder);
+}
 
-U.ensureDirectory(workDir, "directory for serialized binary metadata", 
log);
+U.ensureDirectory(workDir, "directory for serialized binary 
metadata", log);
+}
+catch (IgniteCheckedException e) {
+throw new IgniteException(e);
+}
+}
 
+/**
+ * Starts worker thread for acyn writing of binary metadata.
 
 Review comment:
   acyn -> async


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 #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387684487
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
 ##
 @@ -4107,6 +4112,8 @@ private Checkpoint 
markCheckpointBegin(CheckpointMetricsTracker tracker) throws
 
 CheckpointProgressImpl curr = scheduledCp;
 
+curr.dbLsnrs = new ArrayList<>(lsnrs);
 
 Review comment:
   Do we really need it inside `CheckpointProgressImpl`? It's used in one 
method only, let's make it local.


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 #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387733936
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFutureTask.java
 ##
 @@ -0,0 +1,852 @@
+/*
+ * 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.processors.cache.persistence.snapshot;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicIntegerArray;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.function.BooleanSupplier;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.pagemem.PageIdUtils;
+import org.apache.ignite.internal.pagemem.store.PageStore;
+import org.apache.ignite.internal.pagemem.store.PageWriteListener;
+import org.apache.ignite.internal.processors.cache.CacheGroupContext;
+import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState;
+import 
org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener;
+import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager;
+import 
org.apache.ignite.internal.processors.cache.persistence.partstate.GroupPartitionId;
+import 
org.apache.ignite.internal.processors.cache.persistence.partstate.PagesAllocationRange;
+import 
org.apache.ignite.internal.processors.cache.persistence.partstate.PartitionAllocationMap;
+import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
+import org.apache.ignite.internal.processors.cache.persistence.wal.crc.FastCrc;
+import org.apache.ignite.internal.util.GridIntIterator;
+import org.apache.ignite.internal.util.GridIntList;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.internal.util.lang.IgniteThrowableRunner;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+import static 
org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.cacheDirName;
+import static 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.cacheWorkDir;
+import static 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.getPartitionFile;
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.getPartionDeltaFile;
+import static 
org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager.relativeNodePath;
+
+/**
+ *
+ */
+class SnapshotFutureTask extends GridFutureAdapter implements 
DbCheckpointListener {
+/** Shared context. */
+private final GridCacheSharedContext cctx;
+
+/** 

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387727364
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
 ##
 @@ -533,6 +536,11 @@ public GridBinaryMarshaller marshaller() {
 binaryCtx.updateMetadata(typeId, meta, false);
 }
 
+/** {@inheritDoc} */
+@Override public BinaryTypeWriter createBinaryWriter(String igniteWorkDir) 
{
+return new BinaryMetadataFileStore(metadataLocCache, ctx, log, 
igniteWorkDir, binaryMetadataFileStoreDir);
 
 Review comment:
   There will be problems if `binaryMetadataFileStoreDir` is not null in 
`CacheObjectBinaryProcessorImpl`


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 #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387730116
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java
 ##
 @@ -119,6 +134,14 @@ void stop() {
 U.cancel(writer);
 }
 
+/** {@inheritDoc} */
+@Override public void writeMeta(int typeId, BinaryType type) {
 
 Review comment:
   `typeId` parameter is never 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] alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: Backup page store manager, initial

2020-03-04 Thread GitBox
alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: 
Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r387728682
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
 ##
 @@ -533,6 +536,11 @@ public GridBinaryMarshaller marshaller() {
 binaryCtx.updateMetadata(typeId, meta, false);
 }
 
+/** {@inheritDoc} */
+@Override public BinaryTypeWriter createBinaryWriter(String igniteWorkDir) 
{
+return new BinaryMetadataFileStore(metadataLocCache, ctx, log, 
igniteWorkDir, binaryMetadataFileStoreDir);
 
 Review comment:
   Also, you don't need `metadataLocCache` for snapshot creation, I think it's 
better to create `BinaryMetadataFileStore` directly using constructor in 
snapshot manager and remove this 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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387731382
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeTaskView.java
 ##
 @@ -18,73 +18,100 @@
 package org.apache.ignite.spi.systemview.view;
 
 import java.util.UUID;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
 import org.apache.ignite.internal.processors.task.GridTaskWorker;
 import org.apache.ignite.lang.IgniteUuid;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Compute task representation for a {@link SystemView}.
  */
 public class ComputeTaskView {
 /** Worker for task. */
-private final GridTaskWorker worker;
+public final GridTaskWorker worker;
+
+/** Task id. */
+public final IgniteUuid id;
 
 /**
+ * @param id Task id.
  * @param worker Worker for task.
  */
-public ComputeTaskView(GridTaskWorker worker) {
+public ComputeTaskView(IgniteUuid id, GridTaskWorker worker) {
+this.id = id;
 this.worker = worker;
 }
 
+/** @return Task id. */
+@Order
+public IgniteUuid id() {
+return id;
+}
+
+/**
+ * {@link ComputeTaskView#sessionId()} value equal to the value of {@link 
ComputeJobView#sessionId()}
+ * if both records represents parts of the same computation.
+ *
+ * @see ComputeJobView#sessionId()
 
 Review comment:
   @see should be placed after @return


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] rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387710339
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/Upstream.java
 ##
 @@ -15,25 +15,26 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.internal.processors.query.calcite.exec;
+package org.apache.ignite.internal.processors.query.calcite.exec.rel;
 
 /**
  * Represents an abstract data consumer.
  *
- * Note: except several cases (like consumer node and mailboxes), 
{@link Node#request()}, {@link Node#cancel()},
- * {@link Node#reset()}, {@link Sink#push(Object)} and {@link Sink#end()} 
methods should be used from one single thread.
+ * Note: except several cases (like consumer node and mailboxes), 
{@link Node#request(int)}, {@link Node#cancel()},
+ * {@link Upstream#push(Object)} and {@link Upstream#end()} methods should be 
used from one single thread.
  */
-public interface Sink {
+public interface Upstream {
 
 Review comment:
   The `Upstream` name may be easily confused with RxJava's `Upstream` where it 
means the opposite: in RxJava data moves from upstream to downstream. In the 
current engine we move data from `source` to `upstream`. Don't you think it's a 
bit confusing too? What about simple and obvious names like `Parent` and 
`Child` as in Calcite? Why just don't use them?


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] rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387725186
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/Call.java
 ##
 @@ -0,0 +1,110 @@
+/*
+ * 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.processors.query.calcite.exec.exp;
+
+import java.util.List;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlOperatorTable;
+import org.apache.calcite.sql.SqlSyntax;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.validate.SqlNameMatchers;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.exp.type.DataType;
+import org.apache.ignite.internal.util.MutableSingletonList;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ * Describes {@link org.apache.calcite.rex.RexCall}.
+ */
+public class Call implements Expression {
+/** */
+private DataType type;
+
+/** */
+private String opName;
+
+/** */
+private SqlSyntax syntax;
+
+/** */
+private List operands;
+
+/** */
+private transient CallOperation opImpl;
+
+/**
+ * @param type Result type.
+ * @param operands Operands.
+ */
+public Call(DataType type, String opName, SqlSyntax syntax, 
List operands) {
+this.type = type;
+this.opName = opName;
+this.syntax = syntax;
+this.operands = operands;
+}
+
+/** {@inheritDoc} */
+@Override public DataType resultType() {
+return type;
+}
+
+/**
+ * @param opTable Operators table.
+ * @return Sql logical operator.
+ */
+public SqlOperator sqlOperator(SqlOperatorTable opTable) {
+List bag = new MutableSingletonList<>();
+
+opTable.lookupOperatorOverloads(
+new SqlIdentifier(opName, SqlParserPos.ZERO), null,
+syntax, bag, SqlNameMatchers.withCaseSensitive(true));
+
+return F.first(bag);
+}
+
+/** */
+public String opName() {
+return opName;
+}
+
+/** */
+public SqlSyntax syntax() {
+return syntax;
+}
+
+/**
+ * @return Operands.
+ */
+public List operands() {
+return operands;
+}
+
+/** {@inheritDoc} */
+@Override public  T accept(ExpressionVisitor visitor) {
+return visitor.visit(this);
+}
+
+/** {@inheritDoc} */
+@Override public  T evaluate(ExecutionContext ctx, Object... args) {
+if (opImpl == null)
+opImpl = new ExpressionFactory(ctx.parent().typeFactory(), 
ctx.parent().conformance(), ctx.parent().opTable()).implement(this);
 
 Review comment:
   Such long lines are not readable


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387731070
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,157 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+public final GridJobWorker job;
+
+/** Job id. */
+public final IgniteUuid id;
+
+/**
+ * @param id Job id.
+ * @param job Job.
+ */
+public ComputeJobView(IgniteUuid id, GridJobWorker job) {
+this.id = id;
+this.job = job;
+}
+
+/** @return Job id. */
+@Order
+public IgniteUuid id() {
+return id;
+}
+
+/**
+ * {@link ComputeJobView#sessionId()} value equal to the value of {@link 
ComputeTaskView#sessionId()}
+ * if both records represents parts of the same computation.
+ *
+ * @see ComputeTaskView#sessionId()
 
 Review comment:
   `@see` should be placed after `@return`


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] rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite integration. Expressions factory base implementation.

2020-03-04 Thread GitBox
rkondakov commented on a change in pull request #7489: IGNITE-12708: Calcite 
integration. Expressions factory base implementation.
URL: https://github.com/apache/ignite/pull/7489#discussion_r387724898
 
 

 ##
 File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/FilterNode.java
 ##
 @@ -0,0 +1,145 @@
+/*
+ * 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.processors.query.calcite.exec.rel;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.function.Predicate;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ *
+ */
+public class FilterNode extends AbstractNode implements 
SingleNode, Upstream {
+/** */
+private final Predicate predicate;
+
+/** */
+private Deque inBuffer = new ArrayDeque<>(IN_BUFFER_SIZE);
 
 Review comment:
   Why do we need buffer here and in other nodes? I agree that we need some 
kind of buffering in (or before) Outbox node, but anyway, I would do it as a 
separate tree node, like `BufferNode` for simplicity and flexibility.


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 #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7495: IGNITE-12745: Compute job 
view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387729841
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,157 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+public final GridJobWorker job;
+
+/** Job id. */
+public final IgniteUuid id;
+
+/**
+ * @param id Job id.
+ * @param job Job.
+ */
+public ComputeJobView(IgniteUuid id, GridJobWorker job) {
+this.id = id;
+this.job = job;
+}
+
+/** @return Job id. */
+@Order
+public IgniteUuid id() {
+return id;
+}
+
+/**
+ * {@link ComputeJobView#sessionId()} value equal to the value of {@link 
ComputeTaskView#sessionId()}
+ * if both records represents parts of the same computation.
+ *
+ * @see ComputeTaskView#sessionId()
+ * @return Session id.
+ */
+@Order(1)
+public IgniteUuid sessionId() {
+return job.getSession().getId();
+}
+
+/** @return Origin node id. */
+@Order(2)
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return Task name. */
+@Order(3)
+public String taskName() {
+return job.getSession().getTaskName();
+}
+
+/** @return Task class name. */
+@Order(4)
+public String taskClassName() {
+return job.getSession().getTaskClassName();
+}
+
+/** @return Affinity cache name or {@code null} for non affinity call. */
 
 Review comment:
   Yes. Thank you. Fixed.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387727821
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,157 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import org.apache.ignite.internal.managers.systemview.walker.Order;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+public final GridJobWorker job;
+
+/** Job id. */
+public final IgniteUuid id;
+
+/**
+ * @param id Job id.
+ * @param job Job.
+ */
+public ComputeJobView(IgniteUuid id, GridJobWorker job) {
+this.id = id;
+this.job = job;
+}
+
+/** @return Job id. */
+@Order
+public IgniteUuid id() {
+return id;
+}
+
+/**
+ * {@link ComputeJobView#sessionId()} value equal to the value of {@link 
ComputeTaskView#sessionId()}
+ * if both records represents parts of the same computation.
+ *
+ * @see ComputeTaskView#sessionId()
+ * @return Session id.
+ */
+@Order(1)
+public IgniteUuid sessionId() {
+return job.getSession().getId();
+}
+
+/** @return Origin node id. */
+@Order(2)
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return Task name. */
+@Order(3)
+public String taskName() {
+return job.getSession().getTaskName();
+}
+
+/** @return Task class name. */
+@Order(4)
+public String taskClassName() {
+return job.getSession().getTaskClassName();
+}
+
+/** @return Affinity cache name or {@code null} for non affinity call. */
 
 Review comment:
   Comma separated list of affinity cache identifiers?


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] agura opened a new pull request #7496: IGNITE-12748 Export scheduling is moved to onContextInitialized in Pu…

2020-03-04 Thread GitBox
agura opened a new pull request #7496: IGNITE-12748 Export scheduling is moved 
to onContextInitialized in Pu…
URL: https://github.com/apache/ignite/pull/7496
 
 
   …shMetricsExporterAdapter


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 #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7495: IGNITE-12745: Compute job 
view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387697966
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysCancelled() {
+return job.isSystemCanceled();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysStopping() {
+return job.isSysStopping();
+}
+
+/** @return {@code True} if job started. */
+public boolean isStarted() {
+return job.isStarted();
+}
+
+/** @return Executor name. */
+public String executorName() {
+return job.executorName();
+}
+
+/** @return Job class name. */
 
 Review comment:
   They both are correct. I think we should use `taskName` and `taskClassName` 
to highlight to the user that these columns are the same as in `TASKS` view.


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] agura closed pull request #7484: IGNITE-12729 LT.warn() doesn't ignore exception

2020-03-04 Thread GitBox
agura closed pull request #7484: IGNITE-12729 LT.warn() doesn't ignore exception
URL: https://github.com/apache/ignite/pull/7484
 
 
   


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] agura commented on issue #7484: IGNITE-12729 LT.warn() doesn't ignore exception

2020-03-04 Thread GitBox
agura commented on issue #7484: IGNITE-12729 LT.warn() doesn't ignore exception
URL: https://github.com/apache/ignite/pull/7484#issuecomment-594494977
 
 
   Merged to the master branch.


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] agura commented on issue #7488: IGNITE-12735 Possible NPE during export of communication metrics is fixed

2020-03-04 Thread GitBox
agura commented on issue #7488: IGNITE-12735 Possible NPE during export of 
communication metrics is fixed
URL: https://github.com/apache/ignite/pull/7488#issuecomment-594493822
 
 
   Merged to the master branch.


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] agura closed pull request #7488: IGNITE-12735 Possible NPE during export of communication metrics is fixed

2020-03-04 Thread GitBox
agura closed pull request #7488: IGNITE-12735 Possible NPE during export of 
communication metrics is fixed
URL: https://github.com/apache/ignite/pull/7488
 
 
   


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387548787
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
 ##
 @@ -71,6 +71,9 @@
 @GridToStringExclude
 @Nullable private transient ServiceDeploymentActions 
serviceDeploymentActions;
 
+/** Forced change of cluster state. */
+private boolean force = true;
 
 Review comment:
   > Why the default value is true?
   
   For backward compatibility and due to general idea. Within this ticket we 
prevent unsafe deactivation only where required. Most of the deactivation 
requests are still forced. Like through `Ignite, IgniteMXBean, IgniteCluster` 
etc. Also there is usage of this message from another places: 
   `GridClusterStateProcessor#autoAdjustExchangeActions(), 
GridClusterStateProcessor#autoAdjustInMemoryClusterState()`


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387548787
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
 ##
 @@ -71,6 +71,9 @@
 @GridToStringExclude
 @Nullable private transient ServiceDeploymentActions 
serviceDeploymentActions;
 
+/** Forced change of cluster state. */
+private boolean force = true;
 
 Review comment:
   > Why the default value is true?
   
   For backward compatibility. Most of the deactivation requests are still 
forced. Like through `Ignite, IgniteMXBean, IgniteCluster` etc. Also there is 
usage of this message from another places: 
   `GridClusterStateProcessor#autoAdjustExchangeActions(), 
GridClusterStateProcessor#autoAdjustInMemoryClusterState()`
   


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387563217
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -924,49 +945,8 @@ protected IgniteCheckedException 
concurrentStateChangeError(ClusterState state,
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture changeGlobalState(
-final boolean activate,
 
 Review comment:
   > Why this deletion?
   
   To simplify and reduce internal API and code base. There were already 2 
changeGlobalState(). First, I introduced new one with ‘force’ not to change 
previous API. There 3 methods (2 of them deprecated) became a mesh. After all, 
as it is internal API, I suggest to keep one change-state method. Isn’t it 
better?


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387571618
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysCancelled() {
+return job.isSystemCanceled();
+}
+
+/** @return {@code True} if ???. */
 
 Review comment:
   Please, add meaningful description instead ???.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387570874
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysCancelled() {
+return job.isSystemCanceled();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysStopping() {
+return job.isSysStopping();
+}
+
+/** @return {@code True} if job started. */
+public boolean isStarted() {
+return job.isStarted();
+}
+
+/** @return Executor name. */
+public String executorName() {
+return job.executorName();
+}
+
+/** @return Job class name. */
 
 Review comment:
   Job or Task class name is correct?


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387580811
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
 
 Review comment:
   in milliseconds?


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387569998
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysCancelled() {
+return job.isSystemCanceled();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysStopping() {
+return job.isSysStopping();
+}
+
+/** @return {@code True} if job started. */
+public boolean isStarted() {
+return job.isStarted();
+}
+
+/** @return Executor name. */
+public String executorName() {
+return job.executorName();
+}
+
+/** @return Job class name. */
+public String taskClassName() {
+return job.getSession().getTaskClassName();
+}
+
+/** @return Task name. */
+public String taskName() {
+return job.getSession().getTaskName();
+}
+
+/** @return Affinity cache ids. */
 
 Review comment:
   I suggest to mark `nullable` and update javadoc.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387589019
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
 ##
 @@ -271,17 +271,42 @@ public GridDeployment getDeployment() {
  *
  * @return {@code True} if job was cancelled by the system.
  */
-boolean isSystemCanceled() {
+public boolean isSystemCanceled() {
 return sysCancelled;
 }
 
 /**
  * @return Create time.
  */
-long getCreateTime() {
+public long getCreateTime() {
 return createTime;
 }
 
+/** @return Start time. */
+public long getStartTime() {
+return startTime;
+}
+
+/** @return Finish time. */
+public long getFinishTime() {
+return finishTime;
+}
+
+/** @return Sys stopping. */
 
 Review comment:
   What `sys` is means?


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387571568
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
 
 Review comment:
   Please, add meaningful description instead ???.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387575334
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
 
 Review comment:
   Job id


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387568854
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
+return job.getFinishTime();
+}
+
+/** @return Origin node id. */
+public UUID originNodeId() {
+return job.getTaskNode().id();
+}
+
+/** @return {@code True} if job is internal. */
+public boolean isInternal() {
+return job.isInternal();
+}
+
+/** @return {@code True} if job is finishing. */
+public boolean isFinishing() {
+return job.isFinishing();
+}
+
+/** @return {@code True} if job is timed out. */
+public boolean isTimedOut() {
+return job.isTimedOut();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysCancelled() {
+return job.isSystemCanceled();
+}
+
+/** @return {@code True} if ???. */
+public boolean isSysStopping() {
+return job.isSysStopping();
+}
+
+/** @return {@code True} if job started. */
+public boolean isStarted() {
+return job.isStarted();
+}
+
+/** @return Executor name. */
+public String executorName() {
+return job.executorName();
+}
+
+/** @return Job class name. */
+public String taskClassName() {
+return job.getSession().getTaskClassName();
+}
+
+/** @return Task name. */
+public String taskName() {
+return job.getSession().getTaskName();
+}
+
+/** @return Affinity cache ids. */
+public String affinityCacheIds() {
+GridReservable res = job.getPartsReservation();
+
+if (!(res instanceof GridJobProcessor.PartitionsReservation))
+return null;
+
+int[] ids = 
((GridJobProcessor.PartitionsReservation)res).getCacheIds();
+
+if (ids == null || ids.length == 0)
+return null;
+
+StringJoiner joiner = new StringJoiner(",");
+
+for (int id : ids)
+joiner.add(Integer.toString(id));
+
+return joiner.toString();
+}
+
+/** @return Affinity partition id. */
 
 Review comment:
   I think it should be described what -1 is means.


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387581402
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/ComputeJobView.java
 ##
 @@ -0,0 +1,140 @@
+/*
+ * 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.StringJoiner;
+import java.util.UUID;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridReservable;
+import org.apache.ignite.internal.processors.job.GridJobProcessor;
+import org.apache.ignite.internal.processors.job.GridJobWorker;
+import org.apache.ignite.lang.IgniteUuid;
+
+/**
+ * Compute job representation for a {@link SystemView}.
+ */
+public class ComputeJobView {
+/** Job. */
+private final GridJobWorker job;
+
+/**
+ * @param job Job.
+ */
+public ComputeJobView(GridJobWorker job) {
+this.job = job;
+}
+
+/** @return Task id. */
+public IgniteUuid id() {
+return job.getJobId();
+}
+
+/** @return Create time. */
+public long createTime() {
+return job.getCreateTime();
+}
+
+/** @return Start time. */
+public long startTime() {
+return job.getStartTime();
+}
+
+/** @return Finish time. */
+public long fininshTime() {
 
 Review comment:
   typo `finishTime`


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] NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute job view implemented.

2020-03-04 Thread GitBox
NSAmelchev commented on a change in pull request #7495: IGNITE-12745: Compute 
job view implemented.
URL: https://github.com/apache/ignite/pull/7495#discussion_r387588599
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
 ##
 @@ -1702,6 +1726,16 @@ public PartitionsReservation(int[] cacheIds, int partId,
 partititons = new GridDhtLocalPartition[cacheIds.length];
 }
 
+/** @return Caches. */
 
 Review comment:
   Caches' identifiers ?


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387568450
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientClusterStateRequest.java
 ##
 @@ -69,6 +70,21 @@ public static GridClientClusterStateRequest 
state(ClusterState state) {
 return msg;
 }
 
+/** Default constructor for the exernalization. */
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387568120
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -115,6 +118,11 @@
 /** */
 private static final String METASTORE_CURR_BLT_KEY = "metastoreBltKey";
 
+/** Warning of unsafe deactivation. */
+public static final String DATA_LOST_ON_DEACTIVATION_WARNING =
+"Cluster has caches configured without persistence. " +
+"During deactivation in-memory data and objects can be lost!";
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387566134
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/IGridClusterStateProcessor.java
 ##
 @@ -108,30 +108,20 @@ boolean onStateChangeMessage(AffinityTopologyVersion 
topVer,
 /** */
 void cacheProcessorStarted();
 
-/**
- * @param activate New cluster state.
- * @param baselineNodes New baseline nodes.
- * @param forceChangeBaselineTopology Force change baseline topology.
- * @return State change future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean)} instead.
- */
-@Deprecated
-IgniteInternalFuture changeGlobalState(
-boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-);
-
 /**
  * @param state New cluster state.
+ * @param force If {@code True} skips checking of the operation safety.
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387566298
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -924,49 +945,8 @@ protected IgniteCheckedException 
concurrentStateChangeError(ClusterState state,
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture changeGlobalState(
-final boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-) {
-return changeGlobalState(activate, baselineNodes, 
forceChangeBaselineTopology, false);
-}
-
-/** {@inheritDoc} */
-@Override public IgniteInternalFuture changeGlobalState(
-ClusterState state,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-) {
-return changeGlobalState(state, baselineNodes, 
forceChangeBaselineTopology, false);
-}
-
-/**
- * @param activate New activate state.
- * @param baselineNodes New BLT nodes.
- * @param forceChangeBaselineTopology Force change BLT.
- * @param isAutoAdjust Auto adjusting flag.
- * @return Global change state future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean, boolean)} instead.
- */
-@Deprecated
-public IgniteInternalFuture changeGlobalState(
-final boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology,
-boolean isAutoAdjust
-) {
-return changeGlobalState(activate ? ACTIVE : INACTIVE, baselineNodes, 
forceChangeBaselineTopology, isAutoAdjust);
-}
-
-/**
- * @param state New activate state.
- * @param baselineNodes New BLT nodes.
- * @param forceChangeBaselineTopology Force change BLT.
- * @param isAutoAdjust Auto adjusting flag.
- * @return Global change state future.
- */
-public IgniteInternalFuture changeGlobalState(
 ClusterState state,
+boolean force,
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387566194
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -1045,6 +1025,7 @@ else if (ClusterState.active(state)) {
 /** */
 private IgniteInternalFuture changeGlobalState0(
 ClusterState state,
+boolean force,
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387564676
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientClusterStateRequestV2.java
 ##
 @@ -0,0 +1,83 @@
+/*
+ * 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.processors.rest.client.message;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.cluster.ClusterState;
+
+/**
+ * Enchanced version of {@link GridClientClusterStateRequest}.
+ * Introduced to support forced version of the change state command and keep 
backward compatibility
+ * with nodes of old version that may occur in cluster at the rolling updates.
+ */
+public class GridClientClusterStateRequestV2 extends 
GridClientClusterStateRequest {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Forced change of cluster state. */
+private boolean force;
 
 Review comment:
   Fixed.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387563805
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/IGridClusterStateProcessor.java
 ##
 @@ -108,30 +108,20 @@ boolean onStateChangeMessage(AffinityTopologyVersion 
topVer,
 /** */
 void cacheProcessorStarted();
 
-/**
- * @param activate New cluster state.
- * @param baselineNodes New baseline nodes.
- * @param forceChangeBaselineTopology Force change baseline topology.
- * @return State change future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean)} instead.
- */
-@Deprecated
-IgniteInternalFuture changeGlobalState(
 
 Review comment:
   > Why this deletion?
   
   Same as above ("To simplify and reduce internal API and code base...")


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387563217
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -924,49 +945,8 @@ protected IgniteCheckedException 
concurrentStateChangeError(ClusterState state,
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture changeGlobalState(
-final boolean activate,
 
 Review comment:
   > Why this deletion?
   
   To simplify and reduce internal API and code base. There were already 2 
changeGlobalState(). First, I introduced new one with ‘force’ not to change 
previous API. There 3 (2 of them deprecated) became a mesh. After all, as it is 
internal API, I suggest to keep one change-state method. Isn’t it better?


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387552701
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
 ##
 @@ -71,6 +71,9 @@
 @GridToStringExclude
 @Nullable private transient ServiceDeploymentActions 
serviceDeploymentActions;
 
+/** Forced change of cluster state. */
+private boolean force = true;
 
 Review comment:
   I think we should make `force == false` by default and explicitly pass 
`true` when required.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387548787
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
 ##
 @@ -71,6 +71,9 @@
 @GridToStringExclude
 @Nullable private transient ServiceDeploymentActions 
serviceDeploymentActions;
 
+/** Forced change of cluster state. */
+private boolean force = true;
 
 Review comment:
   > Why the default value is true?
   
   For backward compatibility. Most of the deactivation requests are still 
forcable. Through Ignite, IgniteMXBean, IgniteCluster etc.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387547266
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/commandline/DeactivateCommand.java
 ##
 @@ -78,6 +81,21 @@
 return null;
 }
 
+/** {@inheritDoc} */
+@Override public void parseArguments(CommandArgIterator argIter) {
+force = false;
 
 Review comment:
   > Do we need this line? Default `force` value is `false` already.
   
   Yes, we need this. Commands are statefull unfortunately. Without this, next 
command usage will go with previous value 'force' param.


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] Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
Vladsz83 commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387547117
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/commandline/ClusterStateChangeCommand.java
 ##
 @@ -91,6 +98,18 @@
 catch (IllegalArgumentException e) {
 throw new IllegalArgumentException("Can't parse new cluster state. 
State: " + s, e);
 }
+
+force = false;
 
 Review comment:
   > Do we need this line? Default `force` value is `false` already.
   
   Yes, we need this. Commands are statefull unfortunately. Without this, next 
command usage will go with previous value 'force' param.


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387517031
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientClusterStateRequest.java
 ##
 @@ -69,6 +70,21 @@ public static GridClientClusterStateRequest 
state(ClusterState state) {
 return msg;
 }
 
+/** Default constructor for the exernalization. */
 
 Review comment:
   typo: ex*t*ernalization


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387515325
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -115,6 +118,11 @@
 /** */
 private static final String METASTORE_CURR_BLT_KEY = "metastoreBltKey";
 
+/** Warning of unsafe deactivation. */
+public static final String DATA_LOST_ON_DEACTIVATION_WARNING =
+"Cluster has caches configured without persistence. " +
+"During deactivation in-memory data and objects can be lost!";
 
 Review comment:
   We should change "*can*" to "*will*" because there is no case when in-memory 
data will not be lost after deactivation.
   So correct message to the user
   
   `Deactivation stopped. Cluster has in-memory caches(without persistence). 
During deactivation, in-memory data will be lost.'


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387515325
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -115,6 +118,11 @@
 /** */
 private static final String METASTORE_CURR_BLT_KEY = "metastoreBltKey";
 
+/** Warning of unsafe deactivation. */
+public static final String DATA_LOST_ON_DEACTIVATION_WARNING =
+"Cluster has caches configured without persistence. " +
+"During deactivation in-memory data and objects can be lost!";
 
 Review comment:
   We should change *can* to *will* because there is no case whe in-memory data 
will not be lost after deactivation.
   So correct message to the user
   
   `Deactivation stopped. Cluster has in-memory caches(without persistence). 
During deactivation, in-memory data will be lost.'


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387509903
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -924,49 +945,8 @@ protected IgniteCheckedException 
concurrentStateChangeError(ClusterState state,
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture changeGlobalState(
-final boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-) {
-return changeGlobalState(activate, baselineNodes, 
forceChangeBaselineTopology, false);
-}
-
-/** {@inheritDoc} */
-@Override public IgniteInternalFuture changeGlobalState(
-ClusterState state,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-) {
-return changeGlobalState(state, baselineNodes, 
forceChangeBaselineTopology, false);
-}
-
-/**
- * @param activate New activate state.
- * @param baselineNodes New BLT nodes.
- * @param forceChangeBaselineTopology Force change BLT.
- * @param isAutoAdjust Auto adjusting flag.
- * @return Global change state future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean, boolean)} instead.
- */
-@Deprecated
-public IgniteInternalFuture changeGlobalState(
-final boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology,
-boolean isAutoAdjust
-) {
-return changeGlobalState(activate ? ACTIVE : INACTIVE, baselineNodes, 
forceChangeBaselineTopology, isAutoAdjust);
-}
-
-/**
- * @param state New activate state.
- * @param baselineNodes New BLT nodes.
- * @param forceChangeBaselineTopology Force change BLT.
- * @param isAutoAdjust Auto adjusting flag.
- * @return Global change state future.
- */
-public IgniteInternalFuture changeGlobalState(
 ClusterState state,
+boolean force,
 
 Review comment:
   We should rename this flag to `forceDeactivation` because its value applies 
to the deactivation command only.
   
   


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387509547
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/IGridClusterStateProcessor.java
 ##
 @@ -108,30 +108,20 @@ boolean onStateChangeMessage(AffinityTopologyVersion 
topVer,
 /** */
 void cacheProcessorStarted();
 
-/**
- * @param activate New cluster state.
- * @param baselineNodes New baseline nodes.
- * @param forceChangeBaselineTopology Force change baseline topology.
- * @return State change future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean)} instead.
- */
-@Deprecated
-IgniteInternalFuture changeGlobalState(
-boolean activate,
-Collection baselineNodes,
-boolean forceChangeBaselineTopology
-);
-
 /**
  * @param state New cluster state.
+ * @param force If {@code True} skips checking of the operation safety.
 
 Review comment:
   We should rename this flag to `forceDeactivation` because it value applies 
to the deactivation command only.
   
   


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387509764
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -1045,6 +1025,7 @@ else if (ClusterState.active(state)) {
 /** */
 private IgniteInternalFuture changeGlobalState0(
 ClusterState state,
+boolean force,
 
 Review comment:
   We should rename this flag to `forceDeactivation` because its value applies 
to the deactivation command only.
   
   


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387509141
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientClusterStateRequestV2.java
 ##
 @@ -0,0 +1,83 @@
+/*
+ * 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.processors.rest.client.message;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.cluster.ClusterState;
+
+/**
+ * Enchanced version of {@link GridClientClusterStateRequest}.
+ * Introduced to support forced version of the change state command and keep 
backward compatibility
+ * with nodes of old version that may occur in cluster at the rolling updates.
+ */
+public class GridClientClusterStateRequestV2 extends 
GridClientClusterStateRequest {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Forced change of cluster state. */
+private boolean force;
 
 Review comment:
   We should rename this flag to `forceDeactivation` because it value apply to 
the deactivation command only.


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387509141
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientClusterStateRequestV2.java
 ##
 @@ -0,0 +1,83 @@
+/*
+ * 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.processors.rest.client.message;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.cluster.ClusterState;
+
+/**
+ * Enchanced version of {@link GridClientClusterStateRequest}.
+ * Introduced to support forced version of the change state command and keep 
backward compatibility
+ * with nodes of old version that may occur in cluster at the rolling updates.
+ */
+public class GridClientClusterStateRequestV2 extends 
GridClientClusterStateRequest {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Forced change of cluster state. */
+private boolean force;
 
 Review comment:
   We should rename this flast to `forceDeactivation` because it value apply to 
the deactivation command only.


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387507524
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
 ##
 @@ -924,49 +945,8 @@ protected IgniteCheckedException 
concurrentStateChangeError(ClusterState state,
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture changeGlobalState(
-final boolean activate,
 
 Review comment:
   Why this deletion?


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387507811
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/IGridClusterStateProcessor.java
 ##
 @@ -108,30 +108,20 @@ boolean onStateChangeMessage(AffinityTopologyVersion 
topVer,
 /** */
 void cacheProcessorStarted();
 
-/**
- * @param activate New cluster state.
- * @param baselineNodes New baseline nodes.
- * @param forceChangeBaselineTopology Force change baseline topology.
- * @return State change future.
- * @deprecated Use {@link #changeGlobalState(ClusterState, Collection, 
boolean)} instead.
- */
-@Deprecated
-IgniteInternalFuture changeGlobalState(
 
 Review comment:
   Why this deletion?


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 #7471: IGNITE-12701 : Disallow silent deactivation in CLI and REST.

2020-03-04 Thread GitBox
nizhikov commented on a change in pull request #7471: IGNITE-12701 : Disallow 
silent deactivation in CLI and REST.
URL: https://github.com/apache/ignite/pull/7471#discussion_r387506990
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
 ##
 @@ -71,6 +71,9 @@
 @GridToStringExclude
 @Nullable private transient ServiceDeploymentActions 
serviceDeploymentActions;
 
+/** Forced change of cluster state. */
+private boolean force = true;
 
 Review comment:
   Why the default value is true?


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