Repository: incubator-ignite Updated Branches: refs/heads/ignite-63 cc2942450 -> 4187cb06c
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue3.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue3.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue3.java deleted file mode 100644 index 205e03e..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridCacheDeploymentTestValue3.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.io.*; - -/** - * - */ -public class GridCacheDeploymentTestValue3 implements Serializable { - /** */ - private String val = "test-" + System.currentTimeMillis(); - - /** - * @return Value. - */ - public String getValue() { - return val; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(GridCacheDeploymentTestValue3.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeFilter.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeFilter.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeFilter.java deleted file mode 100644 index a1ca70b..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.events.*; -import org.apache.ignite.internal.util.typedef.*; - -/** - * Filter for event consume test. - */ -public class GridEventConsumeFilter implements P1<IgniteEvent> { - /** {@inheritDoc} */ - @Override public boolean apply(IgniteEvent e) { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeProjectionPredicate.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeProjectionPredicate.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeProjectionPredicate.java deleted file mode 100644 index 958d740..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridEventConsumeProjectionPredicate.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.cluster.*; -import org.apache.ignite.internal.util.typedef.*; - -/** - * Projection predicate for event consume test. - */ -public class GridEventConsumeProjectionPredicate implements PN { - /** {@inheritDoc} */ - @Override public boolean apply(ClusterNode n) { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExcludeNodeFilter.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExcludeNodeFilter.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExcludeNodeFilter.java deleted file mode 100644 index cb83ee7..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExcludeNodeFilter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.cluster.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.util.*; - -/** - * This node filter excludes the node with the given UUID - * from the topology. - */ -public class GridExcludeNodeFilter implements IgnitePredicate<ClusterNode> { - /** Node ID to exclude. */ - private final UUID excludeId; - - /** - * @param excludeId Excluded node UUID. - */ - public GridExcludeNodeFilter(UUID excludeId) { - assert excludeId != null; - - this.excludeId = excludeId; - } - - /** {@inheritDoc} */ - @Override public boolean apply(ClusterNode e) { - return !excludeId.equals(e.id()); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(GridExcludeNodeFilter.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityFunction.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityFunction.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityFunction.java deleted file mode 100644 index b32e4ac..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityFunction.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.cache.affinity.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.util.*; - -/** - * Mock affinity implementation that ensures constant key-to-node mapping based on {@code GridCacheModuloAffinity} The - * partition selection is as follows: 0 maps to partition 1 and any other value maps to partition 1. - */ -public class GridExternalAffinityFunction implements GridCacheAffinityFunction { - /** Node attribute for index. */ - public static final String IDX_ATTR = "nodeIndex"; - - /** Number of backups. */ - private int backups; - - /** Number of partitions. */ - private int parts; - - /** Empty constructor. Equivalent for {@code new GridCacheModuloAffinity(2, 0)}. */ - public GridExternalAffinityFunction() { - this(2, 0); - } - - /** - * @param parts Number of partitions. - * @param backups Number of backups. - */ - public GridExternalAffinityFunction(int parts, int backups) { - assert parts > 0; - assert backups >= 0; - - this.parts = parts; - this.backups = backups; - } - - /** {@inheritDoc} */ - @SuppressWarnings("unchecked") - @Override public List<List<ClusterNode>> assignPartitions(GridCacheAffinityFunctionContext ctx) { - List<List<ClusterNode>> res = new ArrayList<>(partitions()); - - List<ClusterNode> topSnapshot = ctx.currentTopologySnapshot(); - - for (int part = 0; part < parts; part++) { - res.add(F.isEmpty(topSnapshot) ? - Collections.<ClusterNode>emptyList() : - // Wrap affinity nodes with unmodifiable list since unmodifiable generic collection - // doesn't provide equals and hashCode implementations. - U.sealList(nodes(part, topSnapshot))); - } - - return res; - } - - /** {@inheritDoc} */ - public Collection<ClusterNode> nodes(int part, Collection<ClusterNode> nodes) { - List<ClusterNode> sorted = new ArrayList<>(nodes); - - Collections.sort(sorted, new Comparator<ClusterNode>() { - @Override public int compare(ClusterNode n1, ClusterNode n2) { - int idx1 = n1.<Integer>attribute(IDX_ATTR); - int idx2 = n2.<Integer>attribute(IDX_ATTR); - - return idx1 < idx2 ? -1 : idx1 == idx2 ? 0 : 1; - } - }); - - int max = 1 + backups; - - if (max > nodes.size()) - max = nodes.size(); - - Collection<ClusterNode> ret = new ArrayList<>(max); - - Iterator<ClusterNode> it = sorted.iterator(); - - for (int i = 0; i < max; i++) { - ClusterNode n = null; - - if (i == 0) { - while (it.hasNext()) { - n = it.next(); - - int nodeIdx = n.<Integer>attribute(IDX_ATTR); - - if (part <= nodeIdx) - break; - else - n = null; - } - } - else { - if (it.hasNext()) - n = it.next(); - else { - it = sorted.iterator(); - - assert it.hasNext(); - - n = it.next(); - } - } - - assert n != null || nodes.size() < parts; - - if (n == null) - n = (it = sorted.iterator()).next(); - - ret.add(n); - } - - return ret; - } - - /** {@inheritDoc} */ - @Override public void reset() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public int partitions() { - return parts; - } - - /** {@inheritDoc} */ - @Override public int partition(Object key) { - return key instanceof Integer ? 0 == key ? 0 : 1 : 1; - } - - /** {@inheritDoc} - * @param nodeId*/ - @Override public void removeNode(UUID nodeId) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(GridExternalAffinityFunction.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityKeyMapper.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityKeyMapper.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityKeyMapper.java deleted file mode 100644 index 9823795..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridExternalAffinityKeyMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.cache.affinity.*; - -/** - * Test mapper for P2P class loading tests. - */ -public class GridExternalAffinityKeyMapper implements GridCacheAffinityKeyMapper { - /** {@inheritDoc} */ - @Override public Object affinityKey(Object key) { - if (key instanceof Integer) - return 1 == (Integer)key ? key : 0; - - return key; - } - - /** {@inheritDoc} */ - @Override public void reset() { - // This mapper is stateless and needs no initialization logic. - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java deleted file mode 100644 index b7752cb..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PAwareTestUserResource.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.resources.*; - -/** - * User resource, that increases node-local counters - * on deploy and undeploy. - */ -public class GridP2PAwareTestUserResource { - /** Deploy counter key. */ - private static final String DEPLOY_CNT_KEY = "deployCnt"; - - /** Undeploy counter key. */ - private static final String UNDEPLOY_CNT_KEY = "undeployCnt"; - - /** Grid instance. */ - @IgniteInstanceResource - private Ignite ignite; - - /** Grid logger. */ - @IgniteLoggerResource - private IgniteLogger log; - - /** - * Concurrently increments numeric cache value. - * - * @param key Key for the value to be incremented. - */ - private <T> void concurrentIncrement(T key) { - ClusterNodeLocalMap<T, Integer> nodeLoc = ignite.cluster().nodeLocalMap(); - - Integer cntr = nodeLoc.get(key); - - if (cntr == null) - cntr = nodeLoc.putIfAbsent(key, 1); - - if (cntr != null) { - while (!nodeLoc.replace(key, cntr, cntr + 1)) { - cntr = nodeLoc.get(key); - - assert cntr != null; - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask1.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask1.java deleted file mode 100644 index 1c8e613..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask1.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.typedef.*; -import org.jetbrains.annotations.*; - -import java.util.*; - -/** - * Test task for {@code GridP2PContinuousDeploymentSelfTest}. - */ -public class GridP2PContinuousDeploymentTask1 extends ComputeTaskSplitAdapter<Object, Object> { - /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException { - return Collections.singleton(new ComputeJobAdapter() { - @IgniteInstanceResource - private Ignite ignite; - - @Override public Object execute() throws IgniteCheckedException { - X.println(">>> Executing GridP2PContinuousDeploymentTask1 job."); - - ignite.cache(null).putx("key", new GridTestUserResource()); - - return null; - } - }); - } - - /** {@inheritDoc} */ - @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - return null; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask2.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask2.java deleted file mode 100644 index 08e474d..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PContinuousDeploymentTask2.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.internal.util.typedef.*; -import org.jetbrains.annotations.*; - -import java.util.*; - -/** - * Test task for {@code GridP2PContinuousDeploymentSelfTest}. - */ -public class GridP2PContinuousDeploymentTask2 extends ComputeTaskSplitAdapter<Object, Object> { - /** {@inheritDoc} */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) throws IgniteCheckedException { - return Collections.singleton(new ComputeJobAdapter() { - @Override public Object execute() { - X.println(">>> Executing GridP2PContinuousDeploymentTask2 job."); - - return null; - } - }); - } - - /** {@inheritDoc} */ - @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - return null; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java deleted file mode 100644 index 628e4ce..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath1.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.events.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.resources.*; -import org.gridgain.grid.*; - -/** - * Simple event filter - */ -@SuppressWarnings({"ProhibitedExceptionThrown"}) -public class GridP2PEventFilterExternalPath1 implements IgnitePredicate<IgniteEvent> { - /** Instance of grid. Used for save class loader and injected resource. */ - @IgniteInstanceResource - private Ignite ignite; - - /** {@inheritDoc} */ - @Override public boolean apply(IgniteEvent evt) { - try { - int[] res = new int[] { - System.identityHashCode(getClass().getClassLoader()) - }; - - ignite.message(ignite.cluster().forRemotes()).send(null, res); - } - catch (IgniteCheckedException e) { - throw new RuntimeException(e); - } - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java deleted file mode 100644 index 4dcf01c..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PEventFilterExternalPath2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.events.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.resources.*; -import org.gridgain.grid.*; - -/** - * Simple event filter - */ -@SuppressWarnings({"ProhibitedExceptionThrown"}) -public class GridP2PEventFilterExternalPath2 implements IgnitePredicate<IgniteEvent> { - /** Instance of grid. Used for save class loader and injected resource. */ - @IgniteInstanceResource - private Ignite ignite; - - /** {@inheritDoc} */ - @Override public boolean apply(IgniteEvent evt) { - try { - int[] res = new int[] { - System.identityHashCode(getClass().getClassLoader()) - }; - - ignite.message(ignite.cluster().forRemotes()).send(null, res); - } - catch (IgniteCheckedException e) { - throw new RuntimeException(e); - } - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java deleted file mode 100644 index f44d715..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath1.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.util.*; - -/** - * Test P2P task. - */ -public class GridP2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer> { - /** */ - @IgniteLoggerResource - private IgniteLogger log; - - /** - * {@inheritDoc} - */ - @SuppressWarnings({"unchecked"}) - @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) throws IgniteCheckedException { - if (log.isInfoEnabled()) { - log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) + - ", arg=" + arg + ']'); - } - - Set<UUID> nodeIds; - - boolean sleep; - - if (arg instanceof Object[]) { - nodeIds = Collections.singleton((UUID)(((Object[])arg)[0])); - - sleep = (Boolean)((Object[])arg)[1]; - } - else if (arg instanceof List) { - nodeIds = new HashSet<>((Collection<UUID>)arg); - - sleep = false; - } - else { - nodeIds = Collections.singleton((UUID)arg); - - sleep = false; - } - - Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size()); - - for (ClusterNode node : subgrid) { - if (nodeIds.contains(node.id())) - jobs.put(new TestJob(node.id(), sleep), node); - } - - if (!jobs.isEmpty()) - return jobs; - - throw new IgniteCheckedException("Failed to find target node: " + arg); - } - - /** - * {@inheritDoc} - */ - @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - return results.get(0).getData(); - } - - /** - * Simple job class - */ - @SuppressWarnings({"PublicInnerClass"}) - public static class TestJob extends ComputeJobAdapter { - /** Task session. */ - @IgniteTaskSessionResource - private ComputeTaskSession ses; - - /** */ - @IgniteLoggerResource - private IgniteLogger log; - - /** */ - @IgniteInstanceResource - private Ignite g; - - /** */ - private boolean sleep; - - /** - * - */ - public TestJob() { - // No-op. - } - - /** - * @param nodeId Node ID for node this job is supposed to execute on. - * @param sleep Sleep flag. - */ - public TestJob(UUID nodeId, boolean sleep) { - super(nodeId); - - this.sleep = sleep; - } - - /** {@inheritDoc} */ - @Override public Integer execute() throws IgniteCheckedException { - assert g.configuration().getNodeId().equals(argument(0)); - - log.info("Running job on node: " + g.cluster().localNode().id()); - - if (sleep) { - try { - Thread.sleep(Long.MAX_VALUE); - } - catch (InterruptedException e) { - log.info("Job has been cancelled. Caught exception: " + e); - - Thread.currentThread().interrupt(); - } - } - - return System.identityHashCode(ses.getClassLoader()); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java deleted file mode 100644 index 309020b..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridP2PTestTaskExternalPath2.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.util.*; - -/** - * Simple test task. - */ -public class GridP2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer> { - /** */ - @IgniteLoggerResource - private IgniteLogger log; - - /** - * {@inheritDoc} - */ - @SuppressWarnings({"unchecked"}) - @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) throws IgniteCheckedException { - if (log.isInfoEnabled()) { - log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) + - ", arg=" + arg + ']'); - } - - Set<UUID> nodeIds; - - boolean sleep; - - if (arg instanceof Object[]) { - nodeIds = Collections.singleton((UUID)(((Object[])arg)[0])); - - sleep = (Boolean)((Object[])arg)[1]; - } - else if (arg instanceof List) { - nodeIds = new HashSet<>((Collection<UUID>)arg); - - sleep = false; - } - else { - nodeIds = Collections.singleton((UUID)arg); - - sleep = false; - } - - Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size()); - - for (ClusterNode node : subgrid) { - if (nodeIds.contains(node.id())) - jobs.put(new TestJob(node.id(), sleep), node); - } - - if (!jobs.isEmpty()) - return jobs; - - throw new IgniteCheckedException("Failed to find target node: " + arg); - } - - /** - * {@inheritDoc} - */ - @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - return results.get(0).getData(); - } - - /** - * Simple job class - */ - @SuppressWarnings("PublicInnerClass") - public static class TestJob extends ComputeJobAdapter { - /** Ignite instance. */ - @IgniteInstanceResource - private Ignite ignite; - - /** Task session. */ - @IgniteTaskSessionResource - private ComputeTaskSession ses; - - /** */ - @IgniteLoggerResource - private IgniteLogger log; - - /** */ - private boolean sleep; - - /** - * @param nodeId Node ID for node this job is supposed to execute on. - * @param sleep Sleep flag. - */ - public TestJob(UUID nodeId, boolean sleep) { - super(nodeId); - - this.sleep = sleep; - } - - /** - * {@inheritDoc} - */ - @Override public Integer execute() throws IgniteCheckedException { - assert ignite.configuration().getNodeId().equals(argument(0)); - - if (sleep) { - try { - Thread.sleep(Long.MAX_VALUE); - } - catch (InterruptedException e) { - log.info("Job has been cancelled. Caught exception: " + e); - - Thread.currentThread().interrupt(); - } - } - - return System.identityHashCode(ses.getClassLoader()); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestJobTarget.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestJobTarget.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestJobTarget.java deleted file mode 100644 index 3d2e380..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestJobTarget.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -/** - * Test class for p2p chained deployment. - */ -public class GridSingleSplitTestJobTarget { - /** - * @param level Test argument. - * @return Always 1. - */ - @SuppressWarnings("unused") - public int executeLoadTestJob(int level) { - assert level > 0; - - return 1; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestTask.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestTask.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestTask.java deleted file mode 100644 index 64cdbeb..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridSingleSplitTestTask.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.compute.*; -import org.gridgain.grid.*; - -import java.io.*; -import java.util.*; - -/** - * Test task for P2P deployment tests. - */ -public class GridSingleSplitTestTask extends ComputeTaskSplitAdapter<Integer, Integer> { - /** - * {@inheritDoc} - */ - @Override protected Collection<? extends ComputeJob> split(int gridSize, Integer arg) throws IgniteCheckedException { - assert gridSize > 0 : "Subgrid cannot be empty."; - - Collection<ComputeJobAdapter> jobs = new ArrayList<>(gridSize); - - for (int i = 0; i < arg; i++) - jobs.add(new GridSingleSplitTestJob(1)); - - return jobs; - } - - /** - * {@inheritDoc} - */ - @Override public Integer reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - int retVal = 0; - - for (ComputeJobResult res : results) { - assert res.getException() == null : "Load test jobs can never fail: " + res; - - retVal += (Integer)res.getData(); - } - - return retVal; - } - - /** - * Test job for P2P deployment tests. - */ - @SuppressWarnings("PublicInnerClass") - public static final class GridSingleSplitTestJob extends ComputeJobAdapter { - /** - * @param args Job arguments. - */ - public GridSingleSplitTestJob(Integer args) { - super(args); - } - - /** {@inheritDoc} */ - @Override public Serializable execute() { - return new GridSingleSplitTestJobTarget().executeLoadTestJob((Integer)argument(0)); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageListener.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageListener.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageListener.java deleted file mode 100644 index 555b999..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageListener.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.typedef.*; - -import java.util.*; -import java.util.concurrent.atomic.*; - -/** - * Test message listener. - */ -public class GridTestMessageListener implements P2<UUID, Object> { - /** */ - @IgniteInstanceResource - private Ignite ignite; - - /** {@inheritDoc} */ - @Override public boolean apply(UUID nodeId, Object msg) { - ignite.log().info("Received message [nodeId=" + nodeId + ", locNodeId=" + ignite.cluster().localNode().id() + - ", msg=" + msg + ']'); - - ClusterNodeLocalMap<String, AtomicInteger> map = ignite.cluster().nodeLocalMap(); - - AtomicInteger cnt = map.get("msgCnt"); - - if (cnt == null) { - AtomicInteger old = map.putIfAbsent("msgCnt", cnt = new AtomicInteger(0)); - - if (old != null) - cnt = old; - } - - cnt.incrementAndGet(); - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageTopic.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageTopic.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageTopic.java deleted file mode 100644 index 4571eff..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestMessageTopic.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import java.io.*; - -/** - * Test message topic. - */ -public class GridTestMessageTopic implements Serializable { - /** {@inheritDoc} */ - @Override public boolean equals(Object o) { - return this != o && getClass() == o.getClass(); - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - return 123; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestUserResource.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestUserResource.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestUserResource.java deleted file mode 100644 index b8e16de..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/GridTestUserResource.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import java.io.*; - -/** - * Test user resource. - */ -public class GridTestUserResource implements Serializable { - // No-op. -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/JobStealingTask.java ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/JobStealingTask.java b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/JobStealingTask.java deleted file mode 100644 index 9914724..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/JobStealingTask.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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.gridgain.grid.tests.p2p; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.compute.*; -import org.apache.ignite.resources.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.jetbrains.annotations.*; - -import java.io.*; -import java.util.*; - -/** - * Task for testing job stealing. - */ -public class JobStealingTask extends ComputeTaskAdapter<Object, Map<UUID, Integer>> { - /** Number of jobs to spawn from task. */ - private static final int N_JOBS = 4; - - /** Grid. */ - @IgniteInstanceResource - private Ignite ignite; - - /** Logger. */ - @IgniteLoggerResource - private IgniteLogger log; - - /** {@inheritDoc} */ - @SuppressWarnings("ForLoopReplaceableByForEach") - @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, - @Nullable Object arg) throws IgniteCheckedException { - assert !subgrid.isEmpty(); - - Map<ComputeJobAdapter, ClusterNode> map = U.newHashMap(subgrid.size()); - - // Put all jobs onto one node. - for (int i = 0; i < N_JOBS; i++) - map.put(new GridJobStealingJob(5000L), subgrid.get(0)); - - return map; - } - - /** {@inheritDoc} */ - @SuppressWarnings("SuspiciousMethodCalls") - @Override public Map<UUID, Integer> reduce(List<ComputeJobResult> results) throws IgniteCheckedException { - Map<UUID, Integer> ret = U.newHashMap(results.size()); - - for (ComputeJobResult res : results) { - log.info("Job result: " + res.getData()); - - UUID resUuid = (UUID)res.getData(); - - ret.put(resUuid, - ret.containsKey(resUuid) ? ret.get(resUuid) + 1 : 1); - } - - return ret; - } - - /** - * Job stealing job. - */ - private static final class GridJobStealingJob extends ComputeJobAdapter { - /** Injected grid. */ - @IgniteInstanceResource - private Ignite ignite; - - /** Logger. */ - @IgniteLoggerResource - private IgniteLogger log; - - /** - * @param arg Job argument. - */ - GridJobStealingJob(Long arg) { - super(arg); - } - - /** {@inheritDoc} */ - @Override public Serializable execute() throws IgniteCheckedException { - log.info("Started job on node: " + ignite.cluster().localNode().id()); - - try { - Long sleep = argument(0); - - assert sleep != null; - - Thread.sleep(sleep); - } - catch (InterruptedException e) { - log.info("Job got interrupted on node: " + ignite.cluster().localNode().id()); - - throw new IgniteCheckedException("Job got interrupted.", e); - } - finally { - log.info("Job finished on node: " + ignite.cluster().localNode().id()); - } - - return ignite.cluster().localNode().id(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/package.html ---------------------------------------------------------------------- diff --git a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/package.html b/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/package.html deleted file mode 100644 index 1f85ff2..0000000 --- a/modules/extdata/p2p/src/main/java/org/gridgain/grid/tests/p2p/package.html +++ /dev/null @@ -1,23 +0,0 @@ -<!-- - 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. - --> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<body> - <!-- Package description. --> - Contains internal tests or test related classes and interfaces. -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3402cd49/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/p2p-gridgain.xml ---------------------------------------------------------------------- diff --git a/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/p2p-gridgain.xml b/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/p2p-gridgain.xml index a3c436a..e9c94d6 100644 --- a/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/p2p-gridgain.xml +++ b/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/META-INF/p2p-gridgain.xml @@ -36,7 +36,7 @@ Test tasks specification. --> <util:list id="tasks"> - <value>org.gridgain.grid.tests.p2p.GridP2PTestTaskExternalPath1</value> - <value>org.gridgain.grid.tests.p2p.GridP2PTestTaskExternalPath2</value> + <value>org.apache.ignite.tests.p2p.GridP2PTestTaskExternalPath1</value> + <value>org.apache.ignite.tests.p2p.GridP2PTestTaskExternalPath2</value> </util:list> </beans>