You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/03/04 21:55:42 UTC
[01/16] incubator-ignite git commit: # IGNITE-344 Fixed cache clear
and cache load sizes + minor cleanup of Visor-console code.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-51 832d1eeef -> 4f1568d75
# IGNITE-344 Fixed cache clear and cache load sizes + minor cleanup of Visor-console code.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4348d9ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4348d9ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4348d9ca
Branch: refs/heads/ignite-51
Commit: 4348d9ca8a0e6e95817ec90b43bc4f39847e1d9e
Parents: 47539d8
Author: AKuznetsov <ak...@gridgain.com>
Authored: Fri Feb 27 10:07:51 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Fri Feb 27 10:07:51 2015 +0700
----------------------------------------------------------------------
.../visor/cache/VisorCacheClearTask.java | 3 +-
.../visor/cache/VisorCacheLoadTask.java | 3 +-
.../scala/org/apache/ignite/visor/Packet.scala | 38 ------
.../ignite/visor/commands/VisorConsole.scala | 2 -
.../ignite/visor/commands/ack/Packet.scala | 55 --------
.../visor/commands/ack/VisorAckCommand.scala | 2 +-
.../ignite/visor/commands/alert/Packet.scala | 108 ----------------
.../ignite/visor/commands/cache/Packet.scala | 127 -------------------
.../commands/cache/VisorCacheCommand.scala | 2 +-
.../ignite/visor/commands/config/Packet.scala | 55 --------
.../ignite/visor/commands/deploy/Packet.scala | 76 -----------
.../ignite/visor/commands/disco/Packet.scala | 72 -----------
.../ignite/visor/commands/events/Packet.scala | 97 --------------
.../ignite/visor/commands/gc/Packet.scala | 61 ---------
.../ignite/visor/commands/kill/Packet.scala | 78 ------------
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
.../ignite/visor/commands/node/Packet.scala | 60 ---------
.../ignite/visor/commands/ping/Packet.scala | 50 --------
.../visor/commands/ping/VisorPingCommand.scala | 2 +-
.../ignite/visor/commands/start/Packet.scala | 90 -------------
.../ignite/visor/commands/tasks/Packet.scala | 116 -----------------
.../commands/tasks/VisorTasksCommand.scala | 26 +---
.../ignite/visor/commands/top/Packet.scala | 87 -------------
.../ignite/visor/commands/vvm/Packet.scala | 61 ---------
24 files changed, 15 insertions(+), 1258 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
index f425d75..f341a04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.visor.cache;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.internal.processors.task.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -147,7 +148,7 @@ public class VisorCacheClearTask extends VisorOneNodeTask<String, IgniteBiTuple<
/** {@inheritDoc} */
@Override public Integer call() throws Exception {
- return cache.size();
+ return cache.size(CachePeekMode.PRIMARY);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
index 329772c..189a07d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.visor.cache;
import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
import org.apache.ignite.internal.processors.task.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -80,7 +81,7 @@ public class VisorCacheLoadTask extends
cache.loadCache(null, ldrArgs);
- res.put(cacheName, cache.size());
+ res.put(cacheName, cache.size(CachePeekMode.PRIMARY));
}
return res;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/Packet.scala
deleted file mode 100644
index bee86ae..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/Packet.scala
+++ /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.apache.ignite
-
-/**
- * {{{
- * ___ _________________________ ________
- * __ | / /____ _/__ ___/__ __ \___ __ \
- * __ | / / __ / _____ \ _ / / /__ /_/ /
- * __ |/ / __/ / ____/ / / /_/ / _ _, _/
- * _____/ /___/ /____/ \____/ /_/ |_|
- *
- * }}}
- *
- * ==Overview==
- * Visor console provides monitoring capabilities for Ignite.
- *
- * ==Usage==
- * Ignite ships with `IGNITE_HOME/bin/ignitevisorcmd.{sh|bat}` script that starts Visor console.
- *
- * Just type:<ex>help</ex> in Visor console to get help and get started.
- */
-package object visor
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index 62f590e..f8c5e19 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -304,8 +304,6 @@ private[commands] class VisorFileNameCompleter extends Completer {
if (files.size == 1) {
val candidate = files(0)
- if (candidate.isDirectory) separator else " "
-
candidates.add(candidate.getName + (if (candidate.isDirectory) separator else " "))
}
else
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/Packet.scala
deleted file mode 100644
index 1529d71..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/Packet.scala
+++ /dev/null
@@ -1,55 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'ack' command implementation.
- *
- * ==Help==
- * {{{
- * +-------------------------------------------+
- * | ack | Acks arguments on all remote nodes. |
- * +-------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * ack {"s"}
- * ack ("s", f)
- * }}}
- *
- * ====Arguments====
- * {{{
- * s
- * Optional string to print on each remote node.
- * f
- * Optional Scala predicate on 'ScalarRichNodePimp' filtering nodes in the topology.
- * }}}
- *
- * ====Examples====
- * {{{
- * ack "Howdy!"
- * Prints 'Howdy!' on all nodes in the topology.
- * ack("Howdy!", _.id8.startsWith("123"))
- * Prints 'Howdy!' on all nodes satisfying this predicate.
- * ack
- * Prints local node ID on all nodes in the topology.
- * }}}
- */
-package object ack
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/VisorAckCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/VisorAckCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/VisorAckCommand.scala
index 760edde..25d4ad7 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/VisorAckCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ack/VisorAckCommand.scala
@@ -157,5 +157,5 @@ object VisorAckCommand {
*
* @param vs Visor tagging trait.
*/
- implicit def fromAck2Visor(vs: VisorTag) = cmd
+ implicit def fromAck2Visor(vs: VisorTag): VisorAckCommand = cmd
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/Packet.scala
deleted file mode 100644
index 8322228..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/Packet.scala
+++ /dev/null
@@ -1,108 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'alert' command implementation.
- *
- * ==Help==
- * {{{
- * +---------------------------------------------------------------------+
- * | alert | Generates email alerts for user-defined events. |
- * | | Node events and grid-wide events are defined via mnemonics. |
- * +---------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * alert
- * alert "-u {-id=<alert-id>|-a}"
- * alert "-r {-t=<sec>} -c1=e1<num> -c2=e2<num> ... -ck=ek<num>"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -u
- * Unregisters alert(s). Either '-a' flag or '-id' parameter is required.
- * Note that only one of the '-u' or '-r' is allowed.
- * If neither '-u' or '-r' provided - all alerts will be printed.
- * -a
- * When provided with '-u' - all alerts will be unregistered.
- * -id=<alert-id>
- * When provided with '-u' - alert with matching ID will be unregistered.
- * -r
- * Register new alert with mnemonic predicate(s).
- * Note that only one of the '-u' or '-r' is allowed.
- * If neither '-u' or '-r' provided - all alerts will be printed.
- * -t
- * Defines notification frequency in seconds. Default is 15 minutes.
- * This parameter can only appear with '-r'.
- * -ck=ek<num>
- * This defines a mnemonic for the metric that will be measured:
- * Grid-wide metrics (not node specific):
- * -cc Total number of available CPUs in the grid.
- * -nc Total number of nodes in the grid.
- * -hc Total number of physical hosts in the grid.
- * -cl Current average CPU load (in %) in the grid.
- *
- * Per-node current metrics:
- * -aj Active jobs on the node.
- * -cj Cancelled jobs on the node.
- * -tc Thread count on the node.
- * -it Idle time on the node.
- * Note: <num> can have 's', 'm', or 'h' suffix indicating
- * seconds, minutes, and hours. By default (no suffix provided)
- * value is assumed to be in milliseconds.
- * -ut Up time on the node.
- * Note: <num> can have 's', 'm', or 'h' suffix indicating
- * seconds, minutes, and hours. By default (no suffix provided)
- * value is assumed to be in milliseconds.
- * -je Job execute time on the node.
- * -jw Job wait time on the node.
- * -wj Waiting jobs count on the node.
- * -rj Rejected jobs count on the node.
- * -hu Heap memory used (in MB) on the node.
- * -cd Current CPU load on the node.
- * -hm Heap memory maximum (in MB) on the node.
- *
- * Comparison part of the mnemonic predicate:
- * =eq<num> Equal '=' to '<num>' number.
- * =neq<num> Not equal '!=' to '<num>' number.
- * =gt<num> Greater than '>' to '<num>' number.
- * =gte<num> Greater than or equal '>=' to '<num>' number.
- * =lt<num> Less than '<' to 'NN' number.
- * =lte<num> Less than or equal '<=' to '<num>' number.
- *
- * NOTE: Email notification will be sent for the alert only when all
- * provided mnemonic predicates evaluate to 'true'.
- * }}}
- *
- * ====Examples====
- * {{{
- * alert
- * Prints all currently registered alerts.
- * alert "-u -a"
- * Unregisters all currently registered alerts.
- * alert "-u -id=12345678"
- * Unregisters alert with provided ID.
- * alert "-r -t=900 -cc=gte4 -cl=gt50"
- * Notify every 15 min if grid has >= 4 CPUs and > 50% CPU load.
- * }}}
- */
-package object alert
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/Packet.scala
deleted file mode 100644
index 443c4ce..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/Packet.scala
+++ /dev/null
@@ -1,127 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'cache' command implementation.
- *
- * ==Help==
- * {{{
- * +-----------------------------------------------------------------------------------------+
- * | cache | Prints statistics about caches from specified node on the entire grid. |
- * | | Output sorting can be specified in arguments. |
- * | | |
- * | | Output abbreviations: |
- * | | # Number of nodes. |
- * | | H/h Number of cache hits. |
- * | | M/m Number of cache misses. |
- * | | R/r Number of cache reads. |
- * | | W/w Number of cache writes. |
- * +-----------------------------------------------------------------------------------------+
- * | cache -compact | Compacts all entries in cache on all nodes. |
- * +-----------------------------------------------------------------------------------------+
- * | cache -clear | Clears all entries from cache on all nodes. |
- * +-----------------------------------------------------------------------------------------+
- * | cache -scan | List all entries in cache with specified name. |
- * +-----------------------------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * cache
- * cache -i
- * cache {-c=<cache-name>} {-id=<node-id>|id8=<node-id8>} {-s=lr|lw|hi|mi|re|wr} {-a} {-r}
- * cache -clear {-c=<cache-name>}
- * cache -compact {-c=<cache-name>}
- * cache -scan -c=<cache-name> {-id=<node-id>|id8=<node-id8>} {-p=<page size>}
- * }}}
- *
- * ====Arguments====
- * {{{
- * -id=<node-id>
- * Full ID of the node to get cache statistics from.
- * Either '-id8' or '-id' can be specified.
- * If neither is specified statistics will be gathered from all nodes.
- * -id8=<node-id>
- * ID8 of the node to get cache statistics from.
- * Either '-id8' or '-id' can be specified.
- * If neither is specified statistics will be gathered from all nodes.
- * -c=<cache-name>
- * Name of the cache.
- * -s=lr|lw|hi|mi|re|wr|cn
- * Defines sorting type. Sorted by:
- * lr Last read.
- * lw Last write.
- * hi Hits.
- * mi Misses.
- * rd Reads.
- * wr Writes.
- * If not specified - default sorting is 'lr'.
- * -i
- * Interactive mode.
- * User can interactively select node for cache statistics.
- * -r
- * Defines if sorting should be reversed.
- * Can be specified only with '-s' argument.
- * -a
- * Prints details statistics about each cache.
- * By default only aggregated summary is printed.
- * -compact
- * Compacts entries in cache.
- * -clear
- * Clears cache.
- * -scan
- * Prints list of all entries from cache.
- * -p=<page size>
- * Number of object to fetch from cache at once.
- * Valid range from 1 to 100.
- * By default page size is 25.
- * }}}
- *
- * ====Examples====
- * {{{
- * cache
- * Prints summary statistics about all caches.
- * cache -id8=12345678 -s=hi -r
- * Prints summary statistics about caches from node with specified id8
- * sorted by number of hits in reverse order.
- * cache -i
- * Prints cache statistics for interactively selected node.
- * cache -s=hi -r -a
- * Prints detailed statistics about all caches sorted by number of hits in reverse order.
- * cache -compact
- * Compacts entries in interactively selected cache.
- * cache -compact -c=cache
- * Compacts entries in cache with name 'cache'.
- * cache -clear
- * Clears interactively selected cache.
- * cache -clear -c=cache
- * Clears cache with name 'cache'.
- * cache -scan
- * Prints list entries from interactively selected cache.
- * cache -scan -c=cache
- * Prints list entries from cache with name 'cache' from all nodes with this cache.
- * cache -scan -c=@c0 -p=50
- * Prints list entries from cache with name taken from 'c0' memory variable
- * with page of 50 items from all nodes with this cache.
- * cache -scan -c=cache -id8=12345678
- * Prints list entries from cache with name 'cache' and node '12345678' ID8.
- * }}}
- */
-package object cache
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 3c1aa01..dbbdbbc 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -581,7 +581,7 @@ class VisorCacheCommand {
val sumT = VisorTextTable()
- sumT #= ("#", "Name(@),", "Nodes", "Size")
+ sumT #= ("#", "Name(@)", "Nodes", "Size")
(0 until sortedAggrData.size) foreach (i => {
val ad = sortedAggrData(i)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/Packet.scala
deleted file mode 100644
index c99dd98..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/Packet.scala
+++ /dev/null
@@ -1,55 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'config' command implementation.
- *
- * ==Help==
- * {{{
- * +-------------------------------------+
- * | config | Prints node configuration. |
- * +-------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * config
- * config "{-id=<node-id>|id8=<node-id8>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -id=<node-id>
- * Full node ID. Either '-id8' or '-id' can be specified.
- * If neither is specified - command starts in interactive mode.
- * -id8=<node-id8>
- * Node ID8. Either '-id8' or '-id' can be specified.
- * If neither is specified - command starts in interactive mode.
- * }}}
- *
- * ====Examples====
- * {{{
- * config "-id8=12345678"
- * Prints configuration for node with '12345678' ID8.
- * config
- * Starts command in interactive mode.
- * }}}
- */
-package object config
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/deploy/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/deploy/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/deploy/Packet.scala
deleted file mode 100644
index 5e5f285..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/deploy/Packet.scala
+++ /dev/null
@@ -1,76 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'deploy' command implementation.
- *
- * ==Help==
- * {{{
- * +---------------------------------------------------+
- * | deploy | Copies file or directory to remote host. |
- * | | Command relies on SFTP protocol. |
- * +---------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * deploy "-h={<username>{:<password>}@}<host>{:<port>} {-u=<username>}
- * {-p=<password>} {-k=<path>} -s=<path> {-d<path>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -h={<username>{:<password>}@}<host>{:<port>}
- * Host specification.
- *
- * <host> can be a hostname, IP or range of IPs.
- * Example of range is 192.168.1.100~150,
- * which means all IPs from 192.168.1.100 to 192.168.1.150 inclusively.
- *
- * Default port number is 22.
- *
- * This option can be provided multiple times.
- * -u=<username>
- * Default username.
- * Used if specification doesn't contain username.
- * If default is not provided as well, current local username will be used.
- * -p=<password>
- * Default password.
- * Used if specification doesn't contain password.
- * If default is not provided as well, it will be asked interactively.
- * -k=<path>
- * Path to private key file.
- * If provided, it will be used for all specifications that doesn't contain password.
- * -s=<path>
- * Source path.
- * -d=<path>
- * Destination path (relative to IGNITE_HOME).
- * If not provided, files will be copied to the root of IGNITE_HOME.
- * }}}
- *
- * ====Examples====
- * {{{
- * deploy "-h=uname:passwd@host -s=/local/path -d=/remote/path"
- * Copies file or directory to remote host (password authentication).
- * deploy "-h=uname@host -k=ssh-key.pem -s=/local/path -d=/remote/path"
- * Copies file or directory to remote host (private key authentication).
- * }}}
- */
-package object deploy
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/Packet.scala
deleted file mode 100644
index b6257d7..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/disco/Packet.scala
+++ /dev/null
@@ -1,72 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'disco' command implementation.
- *
- * ==Help==
- * {{{
- * +---------------------------------------------------------------------------------------+
- * | disco | Prints topology change log as seen from the oldest node. |
- * | | Timeframe for quering events can be specified in arguments. |
- * | | |
- * | | Note that this command depends on Ignite events. |
- * | | |
- * | | Ignite events can be individually enabled and disabled and disabled events |
- * | | can affect the results produced by this command. Note also that configuration |
- * | | of Event Storage SPI that is responsible for temporary storage of generated |
- * | | events on each node can also affect the functionality of this command. |
- * | | |
- * | | By default - all events are enabled and Ignite stores last 10,000 local |
- * | | events on each node. Both of these defaults can be changed in configuration. |
- * +---------------------------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * disco
- * disco "{-t=<num>s|m|h|d} {-r} {-c=<n>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -t=<num>s|m|h|d
- * Defines timeframe for querying events:
- * =<num>s Events fired during last <num> seconds.
- * =<num>m Events fired during last <num> minutes.
- * =<num>h Events fired during last <num> hours.
- * =<num>d Events fired during last <num> days.
- * -r
- * Defines whether sorting should be reversed.
- * -c=<n>
- * Defines the maximum events count that can be shown.
- * }}}
- *
- * ====Examples====
- * {{{
- * disco
- * Prints all discovery events sorted chronologically (oldest first).
- * disco "-r"
- * Prints all discovery events sorted chronologically in reversed order (newest first).
- * disco "-t=2m"
- * Prints discovery events fired during last two minutes sorted chronologically.
- * }}}
- */
-package object disco
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/Packet.scala
deleted file mode 100644
index b4f0546..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/Packet.scala
+++ /dev/null
@@ -1,97 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'events' commands implementation.
- *
- * ==Help==
- * {{{
- * +----------------------------------------------------------------------------------------+
- * | events | Print events from a node. |
- * | | |
- * | | Note that this command depends on Ignite events. |
- * | | |
- * | | Ignite events can be individually enabled and disabled and disabled events |
- * | | can affect the results produced by this command. Note also that configuration |
- * | | of Event Storage SPI that is responsible for temporary storage of generated |
- * | | events on each node can also affect the functionality of this command. |
- * | | |
- * | | By default - all events are enabled and Ignite stores last 10,000 local |
- * | | events on each node. Both of these defaults can be changed in configuration. |
- * +----------------------------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * events
- * events "{-id=<node-id>|-id8=<node-id8>} {-e=<ch,cp,de,di,jo,ta,cl,ca,sw>}
- * {-t=<num>s|m|h|d} {-s=e|t} {-r} {-c=<n>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -id=<node-id>
- * Full node ID.
- * Either '-id' or '-id8' can be specified.
- * If called without the arguments - starts in interactive mode.
- * -id8
- * Node ID8.
- * Either '-id' or '-id8' can be specified.
- * If called without the arguments - starts in interactive mode.
- * -e=<ch,de,di,jo,ta,cl,ca,sw>
- * Comma separated list of event types that should be queried:
- * ch Checkpoint events.
- * de Deployment events.
- * di Discovery events.
- * jo Job execution events.
- * ta Task execution events.
- * ca Cache events.
- * cp Cache pre-loader events.
- * sw Swapspace events.
- * -t=<num>s|m|h|d
- * Defines time frame for querying events:
- * =<num>s Queries events fired during last <num> seconds.
- * =<num>m Queries events fired during last <num> minutes.
- * =<num>h Queries events fired during last <num> hours.
- * =<num>d Queries events fired during last <num> days.
- * -s=e|t
- * Defines sorting of queried events:
- * =e Sorted by event type.
- * =t Sorted chronologically.
- * Only one '=e' or '=t' can be specified.
- * -r
- * Defines if sorting should be reversed.
- * Can be specified only with -s argument.
- * -c=<n>
- * Defines the maximum events count that can be shown.
- * Values in summary tables are calculated over the whole list of events.
- * }}}
- *
- * ====Examples====
- * {{{
- * events "-id8=12345678"
- * Queries all events from node with '12345678' ID8.
- * events "-id8=12345678 -e=di,ca"
- * Queries discovery and cache events from node with '12345678' ID8.
- * events
- * Starts command in interactive mode.
- * }}}
- */
-package object events
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/gc/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/gc/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/gc/Packet.scala
deleted file mode 100644
index 6bcfca8..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/gc/Packet.scala
+++ /dev/null
@@ -1,61 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `gc` implementation.
- *
- * ==Help==
- * {{{
- * +---------------------------------------------------------------------------+
- * | gc | Runs garbage collector on remote nodes. |
- * | | If specific node is provided, garbage collector is run on that node. |
- * | | Otherwise, it will be run on all nodes in topology. |
- * +---------------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * gc
- * gc "{-id8=<node-id8>|-id=<node-id>} {-c}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -id8=<node-id8>
- * ID8 of the node.
- * Note that either '-id8' or '-id' can be specified.
- * -id=<node-id>
- * ID of the node.
- * Note that either '-id8' or '-id' can be specified.
- * -c
- * Run DGC procedure on all caches.
- * }}}
- *
- * ====Examples====
- * {{{
- * gc "-id8=12345678"
- * Runs garbage collector on specified node.
- * gc
- * Runs garbage collector on all nodes in topology.
- * gc "-id8=12345678 -c"
- * Runs garbage collector and DGC procedure on all caches.
- * }}}
- */
-package object gc
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/Packet.scala
deleted file mode 100644
index 7029a4b..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/Packet.scala
+++ /dev/null
@@ -1,78 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `kill` implementation.
- *
- * ==Help==
- * {{{
- * +--------------------------------+
- * | kill | Kills or restarts node. |
- * +--------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * kill
- * kill "-in|-ih"
- * kill "{-r|-k} {-id8=<node-id8>|-id=<node-id>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -in
- * Run command in interactive mode with ability to
- * choose a node to kill or restart.
- * Note that either '-in' or '-ih' can be specified.
- *
- * This mode is used by default.
- * -ih
- * Run command in interactive mode with ability to
- * choose a host where to kill or restart nodes.
- * Note that either '-in' or '-ih' can be specified.
- * -r
- * Restart node mode.
- * Note that either '-r' or '-k' can be specified.
- * If no parameters provided - command starts in interactive mode.
- * -k
- * Kill (stop) node mode.
- * Note that either '-r' or '-k' can be specified.
- * If no parameters provided - command starts in interactive mode.
- * -id8=<node-id8>
- * ID8 of the node to kill or restart.
- * Note that either '-id8' or '-id' can be specified.
- * If no parameters provided - command starts in interactive mode.
- * -id=<node-id>
- * ID of the node to kill or restart.
- * Note that either '-id8' or '-id' can be specified.
- * If no parameters provided - command starts in interactive mode.
- * }}}
- *
- * ====Examples====
- * {{{
- * kill
- * Starts command in interactive mode.
- * kill "-id8=12345678 -r"
- * Restart node with '12345678' ID8.
- * kill "-k"
- * Kill (stop) all nodes.
- * }}}
- */
-package object kill
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/VisorKillCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/VisorKillCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/VisorKillCommand.scala
index 3c9b3d6..a8263e4 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/VisorKillCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/kill/VisorKillCommand.scala
@@ -352,5 +352,5 @@ object VisorKillCommand {
*
* @param vs Visor tagging trait.
*/
- implicit def fromKill2Visor(vs: VisorTag) = cmd
+ implicit def fromKill2Visor(vs: VisorTag): VisorKillCommand = cmd
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/Packet.scala
deleted file mode 100644
index e070322..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/Packet.scala
+++ /dev/null
@@ -1,60 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `node` implementation.
- *
- * ==Help==
- * {{{
- * +--------------------------------+
- * | node | Prints node statistics. |
- * +--------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * node "{-id8=<node-id8>|-id=<node-id>} {-a}"
- * node
- * }}}
- *
- * ====Arguments====
- * {{{
- * -id8=<node-id8>
- * ID8 of node. Either '-id8' or '-id' can be specified.
- * If neither specified - command starts in interactive mode.
- * -id=<node-id>
- * Full ID of node. Either '-id8' or '-id' can be specified.
- * If neither specified - command starts in interactive mode.
- * -a
- * Print extended information.
- * By default - only abbreviated statistics is printed.
- * }}}
- *
- * ====Examples====
- * {{{
- * node
- * Starts command in interactive mode.
- * node "-id8=12345678"
- * Prints statistics for specified node.
- * node "-id8=12345678 -a"
- * Prints full statistics for specified node.
- * }}}
- */
-package object node
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/Packet.scala
deleted file mode 100644
index eb824e8..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/Packet.scala
+++ /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.apache.ignite.visor.commands
-
-/**
- * ==Command==
- * Visor 'ping' command implementation.
- *
- * ==Help==
- * {{{
- * +--------------------+
- * | ping | Pings node. |
- * +--------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * ping {"id81 id82 ... id8k"}
- * }}}
- *
- * ====Arguments====
- * {{{
- * id8k
- * ID8 of the node to ping.
- * }}}
- *
- * ====Examples====
- * {{{
- * ping "12345678"
- * Pings node with '12345678' ID8.
- * ping
- * Pings all nodes in the topology.
- * }}}
- */
-package object ping
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/VisorPingCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/VisorPingCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/VisorPingCommand.scala
index e19dba2..7027354 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/VisorPingCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/ping/VisorPingCommand.scala
@@ -224,5 +224,5 @@ object VisorPingCommand {
*
* @param vs Visor tagging trait.
*/
- implicit def fromPing2Visor(vs: VisorTag) = cmd
+ implicit def fromPing2Visor(vs: VisorTag): VisorPingCommand = cmd
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/start/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/start/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/start/Packet.scala
deleted file mode 100644
index 55eb836..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/start/Packet.scala
+++ /dev/null
@@ -1,90 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `start` implementation.
- *
- * ==Help==
- * {{{
- * +-----------------------------------------------------+
- * | start | Starts one or more nodes on remote host(s). |
- * | | Uses SSH protocol to execute commands. |
- * +-----------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * start "-f=<path> {-m=<num>} {-r}"
- * start "-h=<hostname> {-p=<num>} {-u=<username>} {-pw=<password>} {-k=<path>}
- * {-n=<num>} {-g=<path>} {-c=<path>} {-s=<path>} {-m=<num>} {-r}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -f=<path>
- * Path to INI file that contains topology specification.
- * -h=<hostname>
- * Hostname where to start nodes.
- *
- * Can define several hosts if their IPs are sequential.
- * Example of range is 192.168.1.100~150,
- * which means all IPs from 192.168.1.100 to 192.168.1.150 inclusively.
- * -p=<num>
- * Port number (default is 22).
- * -u=<username>
- * Username (if not defined, current local username will be used).
- * -pw=<password>
- * Password (if not defined, private key file must be defined).
- * -k=<path>
- * Path to private key file. Define if key authentication is used.
- * -n=<num>
- * Expected number of nodes on the host.
- * If some nodes are started already, then only remaining nodes will be started.
- * If current count of nodes is equal to this number and '-r' flag is not set, then nothing will happen.
- * -g=<path>
- * Path to Ignite installation folder.
- * If not defined, IGNITE_HOME environment variable must be set on remote hosts.
- * -c=<path>
- * Path to configuration file (relative to Ignite home).
- * If not provided, default Ignite configuration is used.
- * -s=<path>
- * Path to start script (relative to Ignite home).
- * Default is "bin/ignite.sh" for Unix or
- * "bin\ignite.bat" for Windows.
- * -m=<num>
- * Defines maximum number of nodes that can be started in parallel on one host.
- * This actually means number of parallel SSH connections to each SSH server.
- * Default is 5.
- * -r
- * Indicates that existing nodes on the host will be restarted.
- * By default, if flag is not present, existing nodes will be left as is.
- * }}}
- *
- * ====Examples====
- * {{{
- * start "-h=10.1.1.10 -u=uname -pw=passwd -n=3"
- * Starts three nodes with default configuration (password authentication).
- * start "-h=192.168.1.100~104 -u=uname -k=/home/uname/.ssh/is_rsa -n=5"
- * Starts 25 nodes on 5 hosts (5 nodes per host) with default configuration (key-based authentication).
- * start "-f=start-nodes.ini -r"
- * Starts topology defined in 'start-nodes.ini' file. Existing nodes are stopped.
- * }}}
- */
-package object start
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/Packet.scala
deleted file mode 100644
index ad35e06..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/Packet.scala
+++ /dev/null
@@ -1,116 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Visor 'tasks' command implementation.
- *
- * ==Help==
- * {{{
- * +---------------------------------------------------------------------------------------+
- * | tasks | Prints statistics about tasks and executions. |
- * | | |
- * | | Note that this command depends on Ignite events. |
- * | | |
- * | | Ignite events can be individually enabled and disabled and disabled events |
- * | | can affect the results produced by this command. Note also that configuration |
- * | | of Event Storage SPI that is responsible for temporary storage of generated |
- * | | events on each node can also affect the functionality of this command. |
- * | | |
- * | | By default - all events are enabled and Ignite stores last 10,000 local |
- * | | events on each node. Both of these defaults can be changed in configuration. |
- * +---------------------------------------------------------------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * tasks
- * tasks "-l {-t=<num>s|m|h|d} {-r}"
- * tasks "-s=<substring> {-t=<num>s|m|h|d} {-r}"
- * tasks "-g {-t=<num>s|m|h|d} {-r}"
- * tasks "-h {-t=<num>s|m|h|d} {-r}"
- * tasks "-n=<task-name> {-r}"
- * tasks "-e=<exec-id>"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -l
- * List all tasks and executions for a given time period.
- * Executions sorted chronologically (see '-r'), and tasks alphabetically
- * See '-t=<num>s|m|h|d' on how to specify the time limit.
- * Default time period is one hour, i.e '-t=1h'
- *
- * This is a default mode when command is called without parameters.
- * -s=<substring>
- * List all tasks and executions for a given task name substring.
- * Executions sorted chronologically (see '-r'), and tasks alphabetically
- * See '-t=<num>s|m|h|d' on how to specify the time limit.
- * Default time period is one hour, i.e '-t=1h'
- * -g
- * List all tasks grouped by nodes for a given time period.
- * Tasks sorted alphabetically
- * See '-t=<num>s|m|h|d' on how to specify the time limit.
- * Default time period is one hour, i.e '-t=1h'
- * -h
- * List all tasks grouped by hosts for a given time period.
- * Tasks sorted alphabetically
- * See '-t=<num>s|m|h|d' on how to specify the time limit.
- * Default time period is one hour, i.e '-t=1h'
- * -t=<num>s|m|h|d
- * Defines time frame for '-l' parameter:
- * =<num>s Last <num> seconds.
- * =<num>m Last <num> minutes.
- * =<num>h Last <num> hours.
- * =<num>d Last <num> days.
- * -r
- * Reverse sorting of executions.
- * -n=<task-name>
- * Prints aggregated statistic for named task.
- * -e=<exec-id>
- * Prints aggregated statistic for given task execution.
- * }}}
- *
- * ====Examples====
- * {{{
- * tasks "-l"
- * Prints list of all tasks and executions for the last hour (default).
- * tasks
- * Prints list of all tasks and executions for the last hour (default).
- * tasks "-l -t=5m"
- * Prints list of tasks and executions that started during last 5 minutes.
- * tasks "-s=Task"
- * Prints list of all tasks and executions that have 'Task' in task name.
- * tasks "-g"
- * Prints list of tasks grouped by nodes.
- * tasks "-g -t=5m"
- * Prints list of tasks that started during last 5 minutes grouped by nodes.
- * tasks "-h"
- * Prints list of tasks grouped by hosts.
- * tasks "-h -t=5m"
- * Prints list of tasks that started during last 5 minutes grouped by hosts.
- * tasks "-n=GridTask"
- * Prints summary for task named 'GridTask'.
- * tasks "-e=7D5CB773-225C-4165-8162-3BB67337894B"
- * Traces task execution with ID '7D5CB773-225C-4165-8162-3BB67337894B'.
- * tasks "-e=@e1"
- * Traces task execution with ID taken from 'e1' memory variable.
- * }}}
- */
-package object tasks
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommand.scala
index 4185d0c..723c135 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/tasks/VisorTasksCommand.scala
@@ -638,14 +638,10 @@ class VisorTasksCommand {
execsT.maxCellWidth = 35
execsT #=(
- (
- "ID8(@ID), Start/End,",
- "State & Duration"
- ),
+ ("ID8(@ID), Start/End,", "State & Duration"),
"Task Name(@)",
"Nodes IP, ID8(@)",
- "Jobs"
- )
+ "Jobs")
var sortedExecs = if (!reverse) eLst.sortBy(_.startTs).reverse else eLst.sortBy(_.startTs)
@@ -900,14 +896,10 @@ class VisorTasksCommand {
execsT.maxCellWidth = 35
execsT #= (
- (
- "ID8(@ID), Start/End,",
- "State & Duration"
- ),
+ ("ID8(@ID), Start/End,", "State & Duration"),
"Task Name(@)",
"Nodes IP, ID8(@)",
- "Jobs"
- )
+ "Jobs")
var sorted = if (!reverse) eLst.sortBy(_.startTs).reverse else eLst.sortBy(_.startTs)
@@ -1025,14 +1017,10 @@ class VisorTasksCommand {
execT.maxCellWidth = 35
execT #= (
- (
- "ID8(@ID), Start/End,",
- "State & Duration"
- ),
+ ("ID8(@ID), Start/End,", "State & Duration"),
"Task Name(@)",
"Nodes IP, ID8(@)",
- "Jobs"
- )
+ "Jobs")
val e = eLst.head
@@ -1480,5 +1468,5 @@ object VisorTasksCommand {
*
* @param vs Visor tagging trait.
*/
- implicit def fromTrace2Visor(vs: VisorTag) = cmd
+ implicit def fromTrace2Visor(vs: VisorTag): VisorTasksCommand = cmd
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/Packet.scala
deleted file mode 100644
index b34d4a9..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/Packet.scala
+++ /dev/null
@@ -1,87 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `top` implementation.
- *
- * ==Help==
- * {{{
- * +--------------------------------+
- * | top | Prints current topology. |
- * +--------------------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * top "{-c1=e1<num> -c2=e2<num> ... -ck=ek<num>} {-h=<host1> ... -h=<hostk>} {-a}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -ck=ek<num>
- * This defines a mnemonic for node filter:
- * -cc Number of available CPUs on the node.
- * -cl Average CPU load (in %) on the node.
- * -aj Active jobs on the node.
- * -cj Cancelled jobs on the node.
- * -tc Thread count on the node.
- * -it Idle time on the node.
- * Note: <num> can have 's', 'm', or 'h' suffix indicating
- * seconds, minutes, and hours. By default (no suffix provided)
- * value is assumed to be in milliseconds.
- * -ut Up time on the node.
- * Note: <num> can have 's', 'm', or 'h' suffix indicating
- * seconds, minutes, and hours. By default (no suffix provided)
- * value is assumed to be in milliseconds.
- * -je Job execute time on the node.
- * -jw Job wait time on the node.
- * -wj Waiting jobs count on the node.
- * -rj Rejected jobs count on the node.
- * -hu Heap memory used (in MB) on the node.
- * -hm Heap memory maximum (in MB) on the node.
- *
- * Comparison part of the mnemonic predicate:
- * =eq<num> Equal '=' to '<num>' number.
- * =neq<num> Not equal '!=' to '<num>' number.
- * =gt<num> Greater than '>' to '<num>' number.
- * =gte<num> Greater than or equal '>=' to '<num>' number.
- * =lt<num> Less than '<' to '<num>' number.
- * =lte<num> Less than or equal '<=' to '<num>' number.
- * -h=<host>
- * This defines a host to show nodes from.
- * Multiple hosts can be provided.
- * -a
- * This defines whether to show a separate table of nodes
- * with detail per-node information.
- * }}}
- *
- * ====Examples====
- * {{{
- * top "-cc=eq2"
- * Prints topology for all nodes with two CPUs.
- * top "-cc=eq2 -a"
- * Prints full information for all nodes with two CPUs.
- * top "-h=10.34.2.122 -h=10.65.3.11"
- * Prints topology for provided hosts.
- * top
- * Prints full topology.
- * }}}
- */
-package object top
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4348d9ca/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/vvm/Packet.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/vvm/Packet.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/vvm/Packet.scala
deleted file mode 100644
index b01fbcc..0000000
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/vvm/Packet.scala
+++ /dev/null
@@ -1,61 +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.apache.ignite.visor.commands
-
-/**
- * ==Overview==
- * Contains Visor command `vvm` implementation.
- *
- * ==Help==
- * {{{
- * +-----------------------+
- * | vvm | Opens VisualVM. |
- * +-----------------------+
- * }}}
- *
- * ====Specification====
- * {{{
- * vvm "{-home=dir} {-id8=<node-id8>} {-id=<node-id>}"
- * }}}
- *
- * ====Arguments====
- * {{{
- * -home=dir
- * VisualVM home directory.
- * If not specified, PATH and JAVA_HOME will be searched
- * -id8=<node-id8>
- * ID8 of node.
- * Either '-id8' or '-id' can be specified.
- * -id=<node-id>
- * Full ID of node.
- * Either '-id8' or '-id' can be specified.
- * }}}
- *
- * ====Examples====
- * {{{
- * vvm "-id8=12345678"
- * Opens VisualVM connected to JVM for node with '12345678' ID8.
- * vvm "-id=5B923966-85ED-4C90-A14C-96068470E94D"
- * Opens VisualVM connected to JVM for node with given full node ID.
- * vvm "-home=C:\VisualVM -id8=12345678"
- * Opens VisualVM installed in 'C:\VisualVM' directory for specified node.
- * vvm
- * Opens VisualVM connected to all nodes.
- * }}}
- */
-package object vvm
[03/16] incubator-ignite git commit: # IGNITE-298 Show "UNLIMITED" if
off-heap size configuration == 0.
Posted by sb...@apache.org.
# IGNITE-298 Show "UNLIMITED" if off-heap size configuration == 0.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/656ee473
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/656ee473
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/656ee473
Branch: refs/heads/ignite-51
Commit: 656ee473e2299c16a0f59dc1aa37bbed04ee656e
Parents: be3c24c
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Mar 4 16:31:49 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Mar 4 16:31:49 2015 +0700
----------------------------------------------------------------------
.../apache/ignite/visor/commands/cache/VisorCacheCommand.scala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/656ee473/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 69da6f5..1c52676 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -856,7 +856,11 @@ object VisorCacheCommand {
cacheT += ("Concurrent Asynchronous Operations Number", cfg.maxConcurrentAsyncOperations())
cacheT += ("Memory Mode", cfg.memoryMode())
cacheT += ("Keep Values Bytes", cfg.valueBytes())
- cacheT += ("Off-Heap Size", if (cfg.offsetHeapMaxMemory() >= 0) cfg.offsetHeapMaxMemory() else NA)
+ cacheT += ("Off-Heap Size", cfg.offsetHeapMaxMemory() match {
+ case 0 => "UNLIMITED"
+ case size if size < 0 => NA
+ case size => size
+ })
cacheT += ("Loader Factory Class Name", safe(cfg.loaderFactory()))
cacheT += ("Writer Factory Class Name", safe(cfg.writerFactory()))
[13/16] incubator-ignite git commit: # ignite-51
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
index 3b2d073..4b381fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
@@ -147,14 +147,8 @@ public class GridCacheAffinityImpl<K, V> implements CacheAffinity<K> {
@Override public Object affinityKey(K key) {
A.notNull(key, "key");
- if (cctx.portableEnabled()) {
- try {
- key = (K)cctx.marshalToPortable(key);
- }
- catch (IgniteException e) {
- U.error(log, "Failed to marshal key to portable: " + key, e);
- }
- }
+ if (key instanceof CacheObject)
+ key = ((CacheObject)key).value(cctx.cacheObjectContext(), false);
return cctx.config().getAffinityMapper().affinityKey(key);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index ba4d44c..8ca8689 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -247,7 +247,7 @@ public class CacheDataStructuresManager<K, V> extends GridCacheManagerAdapter<K,
* @param rmv {@code True} if entry was removed.
*/
public void onEntryUpdated(KeyCacheObject key, boolean rmv) {
- Object key0 = key.value(cctx, false);
+ Object key0 = key.value(cctx.cacheObjectContext(), false);
if (key0 instanceof GridCacheSetItemKey)
onSetItemUpdated((GridCacheSetItemKey)key0, rmv);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index dfdda3a..6136e5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -438,7 +438,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
long topVer,
boolean replicate,
@Nullable ExpiryPolicy plc) {
- if (p != null && !p.apply(key.<K>value(ctx, false), (V)val))
+ if (p != null && !p.apply(key.<K>value(ctx.cacheObjectContext(), false), (V)val))
return;
try {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index fb4e0e1..4740e10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -318,7 +318,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
Object procRes = null;
Exception err = null;
- Object keyVal = key.value(cacheCtx, false);
+ Object keyVal = key.value(cacheCtx.cacheObjectContext(), false);
Object val0 = CU.value(val, cacheCtx, false);
for (T2<EntryProcessor<Object, Object, Object>, Object[]> t : txEntry.entryProcessors()) {
@@ -340,7 +340,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
}
if (err != null || procRes != null)
- ret.addEntryProcessResult(key.value(cacheCtx, false),
+ ret.addEntryProcessResult(key.value(cacheCtx.cacheObjectContext(), false),
err == null ? new CacheInvokeResult<>(procRes) : new CacheInvokeResult<>(err));
else
ret.invokeResult(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 103f3a7..ef5e7cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1323,7 +1323,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
taskName,
null);
- Object keyVal = entry.key().value(ctx, false);
+ Object keyVal = entry.key().value(ctx.cacheObjectContext(), false);
Object oldVal = CU.value(old, ctx, false);
Object updatedVal = null;
@@ -1464,9 +1464,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
taskName,
null);
- Object val = ctx.config().getInterceptor().onBeforePut(entry.key().value(ctx, false),
+ Object val = ctx.config().getInterceptor().onBeforePut(
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(old, ctx, false),
- updated.value(ctx, false));
+ updated.value(ctx.cacheObjectContext(), false));
if (val == null)
continue;
@@ -1500,7 +1501,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
null);
IgniteBiTuple<Boolean, ?> interceptorRes = ctx.config().getInterceptor().onBeforeRemove(
- entry.key().value(ctx, false),
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(old, ctx, false));
if (ctx.cancelRemove(interceptorRes))
@@ -1970,14 +1971,15 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (intercept) {
if (op == UPDATE) {
ctx.config().getInterceptor().onAfterPut(
- entry.key().value(ctx, false),
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(updRes.newValue(), ctx, false));
}
else {
assert op == DELETE : op;
// Old value should be already loaded for 'CacheInterceptor.onBeforeRemove'.
- ctx.config().getInterceptor().onAfterRemove(entry.key().value(ctx, false),
+ ctx.config().getInterceptor().onAfterRemove(
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(updRes.oldValue(), ctx, false));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index e1d6afb..45e9455 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -901,7 +901,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
CacheInvokeResult<?> res0 = res.error() == null ?
new CacheInvokeResult<>(CU.value(res.result(), cctx, false)) : new CacheInvokeResult<>(res.error());
- map0.put(res.key().value(cctx, false), res0);
+ map0.put(res.key().value(cctx.cacheObjectContext(), false), res0);
}
if (opRes != null) {
@@ -933,7 +933,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
List<Object> keys = new ArrayList<>(failedKeys.size());
for (KeyCacheObject key : failedKeys)
- keys.add(key.value(cctx, false));
+ keys.add(key.value(cctx.cacheObjectContext(), false));
err0.add(keys, err);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index 5f8038a..5dfc075 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -420,7 +420,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
finishUnmarshalCacheObjects(nearVals, cctx, ldr);
if (retVal != null)
- retVal.finishUnmarshal(cctx, ldr);
+ retVal.finishUnmarshal(cctx.cacheObjectContext(), ldr);
if (invokeRes != null) {
for (CacheInvokeDirectResult res : invokeRes)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/CacheVersionedValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/CacheVersionedValue.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/CacheVersionedValue.java
new file mode 100644
index 0000000..08b43e0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/CacheVersionedValue.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.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+
+import java.nio.*;
+
+/**
+ * Cache object and version.
+ */
+public class CacheVersionedValue implements Message {
+ /** Cache version. */
+ private GridCacheVersion vers;
+
+ /** Cache object. */
+ private CacheObject obj;
+
+ /** */
+ public CacheVersionedValue() {
+ // No-op.
+ }
+
+ /**
+ * @param vers Cache version.
+ * @param obj Cache object.
+ */
+ CacheVersionedValue(GridCacheVersion vers, CacheObject obj) {
+ this.vers = vers;
+ this.obj = obj;
+ }
+
+ /**
+ * @return Cache version.
+ */
+ public GridCacheVersion version() {
+ return vers;
+ }
+
+ /**
+ * @return Cache object.
+ */
+ public CacheObject cacheObject() {
+ return obj;
+ }
+
+ /**
+ * This method is called before the whole message is sent
+ * and is responsible for pre-marshalling state.
+ *
+ * @param ctx Cache object context.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void prepareMarshal(CacheObjectContext ctx) throws IgniteCheckedException {
+ if (obj != null)
+ obj.prepareMarshal(ctx);
+ }
+
+ /**
+ * This method is called after the whole message is recived
+ * and is responsible for unmarshalling state.
+ *
+ * @param ctx Context.
+ * @param ldr Class loader.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
+ if (obj != null)
+ obj.finishUnmarshal(ctx.cacheObjectContext(), ldr);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
+ writer.setBuffer(buf);
+
+ if (!writer.isHeaderWritten()) {
+ if (!writer.writeHeader(directType(), fieldsCount()))
+ return false;
+
+ writer.onHeaderWritten();
+ }
+
+ switch (writer.state()) {
+ case 0:
+ if (!writer.writeMessage("obj", obj))
+ return false;
+
+ writer.incrementState();
+
+ case 1:
+ if (!writer.writeMessage("vers", vers))
+ return false;
+
+ writer.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
+ reader.setBuffer(buf);
+
+ if (!reader.beforeMessageRead())
+ return false;
+
+ switch (reader.state()) {
+ case 0:
+ obj = reader.readMessage("obj");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 1:
+ vers = reader.readMessage("vers");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte directType() {
+ return 102;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte fieldsCount() {
+ return 2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index d06ca5b..b5cbe69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -315,7 +315,7 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
taskName,
true,
null,
- false).get().get(key.value(cctx, false));
+ false).get().get(key.value(cctx.cacheObjectContext(), false));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index 31481f2..b26c1ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -490,8 +490,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma
}
if (v != null && !reload) {
- K key0 = key.value(cctx, false);
- V val0 = v.value(cctx, true);
+ K key0 = key.value(cctx.cacheObjectContext(), false);
+ V val0 = v.value(cctx.cacheObjectContext(), true);
if (cctx.portableEnabled()) {
val0 = (V)cctx.unwrapPortableIfNeeded(val0, !deserializePortable);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 6b16aa4..8057922 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -302,7 +302,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
// Must loop through keys, not map entries,
// as map entries may not have all the keys.
for (KeyCacheObject key : keys)
- c.apply(key, map.get(key.value(cacheCtx, false)));
+ c.apply(key, map.get(key.value(cacheCtx.cacheObjectContext(), false)));
return true;
}
@@ -332,7 +332,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
// Must loop through keys, not map entries,
// as map entries may not have all the keys.
for (KeyCacheObject key : keys)
- c.apply(key, map.get(key.value(cacheCtx, false)));
+ c.apply(key, map.get(key.value(cacheCtx.cacheObjectContext(), false)));
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index 2a6cddb..557331c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -934,7 +934,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
else {
assert F.isEmpty(res.invalidPartitions());
- for (Map.Entry<IgniteTxKey, NearTxPrepareResponseOwnedValue> entry : res.ownedValues().entrySet()) {
+ for (Map.Entry<IgniteTxKey, CacheVersionedValue> entry : res.ownedValues().entrySet()) {
IgniteTxEntry txEntry = tx.entry(entry.getKey());
assert txEntry != null;
@@ -946,7 +946,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
if (cacheCtx.isNear()) {
GridNearCacheEntry nearEntry = (GridNearCacheEntry)txEntry.cached();
- NearTxPrepareResponseOwnedValue tup = entry.getValue();
+ CacheVersionedValue tup = entry.getValue();
nearEntry.resetFromPrimary(tup.cacheObject(), tx.xidVersion(),
tup.version(), m.node().id());
@@ -954,7 +954,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
else if (txEntry.cached().detached()) {
GridDhtDetachedCacheEntry detachedEntry = (GridDhtDetachedCacheEntry)txEntry.cached();
- NearTxPrepareResponseOwnedValue tup = entry.getValue();
+ CacheVersionedValue tup = entry.getValue();
detachedEntry.resetFromPrimary(tup.cacheObject(), tx.xidVersion());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index 6cf80ef..f88d363 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -61,7 +61,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/** Map of owned values to set on near node. */
@GridToStringInclude
@GridDirectTransient
- private Map<IgniteTxKey, NearTxPrepareResponseOwnedValue> ownedVals;
+ private Map<IgniteTxKey, CacheVersionedValue> ownedVals;
/** OwnedVals' keys for marshalling. */
@GridToStringExclude
@@ -70,8 +70,8 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/** OwnedVals' values for marshalling. */
@GridToStringExclude
- @GridDirectCollection(NearTxPrepareResponseOwnedValue.class)
- private Collection<NearTxPrepareResponseOwnedValue> ownedValVals;
+ @GridDirectCollection(CacheVersionedValue.class)
+ private Collection<CacheVersionedValue> ownedValVals;
/** Cache return value. */
@GridDirectTransient
@@ -174,7 +174,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
if (ownedVals == null)
ownedVals = new HashMap<>();
- NearTxPrepareResponseOwnedValue oVal = new NearTxPrepareResponseOwnedValue(ver, val);
+ CacheVersionedValue oVal = new CacheVersionedValue(ver, val);
ownedVals.put(key, oVal);
}
@@ -182,9 +182,9 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/**
* @return Owned values map.
*/
- public Map<IgniteTxKey, NearTxPrepareResponseOwnedValue> ownedValues() {
+ public Map<IgniteTxKey, CacheVersionedValue> ownedValues() {
return ownedVals == null ?
- Collections.<IgniteTxKey, NearTxPrepareResponseOwnedValue>emptyMap() :
+ Collections.<IgniteTxKey, CacheVersionedValue>emptyMap() :
Collections.unmodifiableMap(ownedVals);
}
@@ -234,7 +234,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
ownedValVals = ownedVals.values();
- for (Map.Entry<IgniteTxKey, NearTxPrepareResponseOwnedValue> entry : ownedVals.entrySet()) {
+ for (Map.Entry<IgniteTxKey, CacheVersionedValue> entry : ownedVals.entrySet()) {
GridCacheContext cacheCtx = ctx.cacheContext(entry.getKey().cacheId());
entry.getKey().prepareMarshal(cacheCtx);
@@ -266,14 +266,14 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
Iterator<IgniteTxKey> keyIter = ownedValKeys.iterator();
- Iterator<NearTxPrepareResponseOwnedValue> valueIter = ownedValVals.iterator();
+ Iterator<CacheVersionedValue> valueIter = ownedValVals.iterator();
while (keyIter.hasNext()) {
IgniteTxKey key = keyIter.next();
GridCacheContext cctx = ctx.cacheContext(key.cacheId());
- NearTxPrepareResponseOwnedValue value = valueIter.next();
+ CacheVersionedValue value = valueIter.next();
key.finishUnmarshal(cctx, ldr);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/NearTxPrepareResponseOwnedValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/NearTxPrepareResponseOwnedValue.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/NearTxPrepareResponseOwnedValue.java
deleted file mode 100644
index 87f936e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/NearTxPrepareResponseOwnedValue.java
+++ /dev/null
@@ -1,157 +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.apache.ignite.internal.processors.cache.distributed.near;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-
-import java.nio.*;
-
-/**
- * Message for owned values to set on near node.
- */
-public class NearTxPrepareResponseOwnedValue implements Message {
- /** Cache version. */
- private GridCacheVersion vers;
-
- /** Cache object. */
- private CacheObject obj;
-
- /** */
- public NearTxPrepareResponseOwnedValue() {
- // No-op.
- }
-
- /**
- * @param vers Cache version.
- * @param obj Cache object.
- */
- NearTxPrepareResponseOwnedValue(GridCacheVersion vers, CacheObject obj) {
- this.vers = vers;
- this.obj = obj;
- }
-
- /**
- * @return Cache version.
- */
- public GridCacheVersion version() {
- return vers;
- }
-
- /**
- * @return Cache object.
- */
- public CacheObject cacheObject() {
- return obj;
- }
-
- /**
- * This method is called before the whole message is sent
- * and is responsible for pre-marshalling state.
- *
- * @param ctx Cache object context.
- * @throws org.apache.ignite.IgniteCheckedException If failed.
- */
- public void prepareMarshal(CacheObjectContext ctx) throws IgniteCheckedException {
- if (obj != null)
- obj.prepareMarshal(ctx);
- }
-
- /**
- * This method is called after the whole message is recived
- * and is responsible for unmarshalling state.
- *
- * @param ctx Context.
- * @param ldr Class loader.
- * @throws org.apache.ignite.IgniteCheckedException If failed.
- */
- public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
- if (obj != null)
- obj.finishUnmarshal(ctx, ldr);
- }
-
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType(), fieldsCount()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 0:
- if (!writer.writeMessage("obj", obj))
- return false;
-
- writer.incrementState();
-
- case 1:
- if (!writer.writeMessage("vers", vers))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
-
- if (!reader.beforeMessageRead())
- return false;
-
- switch (reader.state()) {
- case 0:
- obj = reader.readMessage("obj");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 1:
- vers = reader.readMessage("vers");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public byte directType() {
- return 102;
- }
-
- /** {@inheritDoc} */
- @Override public byte fieldsCount() {
- return 2;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index f0a17f2..cffe3c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -1138,7 +1138,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
taskName,
null);
- Object keyVal = entry.key().value(ctx, false);
+ Object keyVal = entry.key().value(ctx.cacheObjectContext(), false);
Object oldVal = CU.value(old, ctx, false);
CacheInvokeEntry<Object, Object> invokeEntry = new CacheInvokeEntry<>(ctx, keyVal, oldVal);
@@ -1250,7 +1250,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
null);
Object interceptorVal = ctx.config().getInterceptor().onBeforePut(
- entry.key().value(ctx, false),
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(old, ctx, false),
val);
@@ -1283,7 +1283,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
null);
IgniteBiTuple<Boolean, ?> interceptorRes = ctx.config().getInterceptor().onBeforeRemove(
- entry.key().value(ctx, false),
+ entry.key().value(ctx.cacheObjectContext(), false),
CU.value(old, ctx, false));
if (ctx.cancelRemove(interceptorRes))
@@ -1432,11 +1432,12 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
if (intercept) {
if (op == UPDATE) {
- ctx.config().getInterceptor().onAfterPut(entry.key().value(ctx, false),
- writeVal.value(ctx, false));
+ ctx.config().getInterceptor().onAfterPut(entry.key().value(ctx.cacheObjectContext(), false),
+ writeVal.value(ctx.cacheObjectContext(), false));
}
else
- ctx.config().getInterceptor().onAfterRemove(entry.key().value(ctx, false), t.get2());
+ ctx.config().getInterceptor().onAfterRemove(entry.key().value(ctx.cacheObjectContext(), false),
+ t.get2());
}
}
catch (GridCacheEntryRemovedException ignore) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 260cff1..2472867 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -2334,7 +2334,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
if (key != null)
return key;
- key = cctx.toCacheKeyObject(null, keyBytes(), false).value(cctx, false);
+ key = cctx.toCacheKeyObject(null, keyBytes(), false).value(cctx.cacheObjectContext(), false);
return key;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java
index 43aaec3..7a77dc6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java
@@ -130,13 +130,13 @@ public class CacheContinuousQueryEntry implements GridCacheDeployable, Message {
* @throws IgniteCheckedException In case of error.
*/
void unmarshal(GridCacheContext cctx, @Nullable ClassLoader ldr) throws IgniteCheckedException {
- key.finishUnmarshal(cctx, ldr);
+ key.finishUnmarshal(cctx.cacheObjectContext(), ldr);
if (newVal != null)
- newVal.finishUnmarshal(cctx, ldr);
+ newVal.finishUnmarshal(cctx.cacheObjectContext(), ldr);
if (oldVal != null)
- oldVal.finishUnmarshal(cctx, ldr);
+ oldVal.finishUnmarshal(cctx.cacheObjectContext(), ldr);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
index 1bdadaf..f24fc8f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
@@ -56,7 +56,7 @@ class CacheContinuousQueryEvent<K, V> extends CacheEntryEvent<K, V> {
/** {@inheritDoc} */
@Override public K getKey() {
- return e.key().value(cctx, false);
+ return e.key().value(cctx.cacheObjectContext(), false);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index c336d00..37f4494 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -167,11 +167,11 @@ public class CacheContinuousQueryManager<K, V> extends GridCacheManagerAdapter<K
oldVal = cctx.unwrapTemporary(oldVal);
if (oldVal != null)
- oldVal.finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ oldVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
}
if (newVal != null)
- newVal.finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ newVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
initialized = true;
}
@@ -221,7 +221,7 @@ public class CacheContinuousQueryManager<K, V> extends GridCacheManagerAdapter<K
oldVal = cctx.unwrapTemporary(oldVal);
if (oldVal != null)
- oldVal.finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ oldVal.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
initialized = true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 31a8d69..0e37349 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1225,7 +1225,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
boolean modified = false;
- Object key = txEntry.key().value(txEntry.context(), false);
+ Object key = txEntry.key().value(txEntry.context().cacheObjectContext(), false);
Object val = CU.value(cacheVal, txEntry.context(), false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 87ab46b..323ba15 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -738,7 +738,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
}
}
- key.finishUnmarshal(context(), clsLdr);
+ key.finishUnmarshal(context().cacheObjectContext(), clsLdr);
val.unmarshal(this.ctx, clsLdr);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
index eb0fee8..2237d63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
@@ -84,7 +84,7 @@ public class IgniteTxKey implements Message {
public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
assert key != null;
- key.finishUnmarshal(ctx, ldr);
+ key.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 5651d0f..342ebd0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -539,7 +539,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
Object oldVal = CU.value(e.cached().rawGetOrUnmarshal(true), cacheCtx, false);
Object interceptorVal = cacheCtx.config().getInterceptor().onBeforePut(
- key.value(cacheCtx, false),
+ key.value(cacheCtx.cacheObjectContext(), false),
oldVal,
CU.value(val, cacheCtx, false));
@@ -582,7 +582,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
Object oldVal = CU.value(e.cached().rawGetOrUnmarshal(true), cacheCtx, false);
IgniteBiTuple<Boolean, Object> t = cacheCtx.config().getInterceptor()
- .onBeforeRemove(key.value(cacheCtx, false), oldVal);
+ .onBeforeRemove(key.value(cacheCtx.cacheObjectContext(), false), oldVal);
if (cacheCtx.cancelRemove(t))
continue;
@@ -1647,7 +1647,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// Load keys only after the locks have been acquired.
for (KeyCacheObject cacheKey : lockKeys) {
- K keyVal = (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx, false));
+ K keyVal =
+ (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx.cacheObjectContext(), false));
if (retMap.containsKey(keyVal))
// We already have a return value.
@@ -1790,7 +1791,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
for (Iterator<KeyCacheObject> it = missed.keySet().iterator(); it.hasNext(); ) {
KeyCacheObject cacheKey = it.next();
- K keyVal = (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx, false));
+ K keyVal =
+ (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx.cacheObjectContext(), false));
if (retMap.containsKey(keyVal))
it.remove();
@@ -2463,7 +2465,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
private void addInvokeResult(IgniteTxEntry txEntry, CacheObject cacheVal, GridCacheReturn<?> ret) {
GridCacheContext ctx = txEntry.context();
- Object keyVal = txEntry.key().value(ctx, false);
+ Object keyVal = txEntry.key().value(ctx.cacheObjectContext(), false);
Object val = CU.value(cacheVal, ctx, false);
try {
@@ -2598,21 +2600,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
// Loose all skipped.
final Set<KeyCacheObject> loaded = loadFut.get();
- final Collection<KeyCacheObject> keys;
-
- if (keySet != null ) {
- keys = new ArrayList<>(keySet.size());
-
- // TODO IGNITE-51.
- for (K k : keySet) {
- KeyCacheObject cacheKey = cacheCtx.toCacheKeyObject(k);
-
- if (k != null && (loaded == null || !loaded.contains(cacheKey)))
- keys.add(cacheKey);
- }
- }
- else
- keys = Collections.emptyList();
+ final Collection<KeyCacheObject> keys = F.view(enlisted, F0.notIn(loaded));
if (log.isDebugEnabled())
log.debug("Before acquiring transaction lock for put on keys: " + keys);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxEntryValueHolder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxEntryValueHolder.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxEntryValueHolder.java
index cce97b1..b6b724f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxEntryValueHolder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TxEntryValueHolder.java
@@ -137,7 +137,7 @@ public class TxEntryValueHolder implements Message {
*/
public void unmarshal(GridCacheContext<?, ?> ctx, ClassLoader ldr) throws IgniteCheckedException {
if (hasWriteVal && val != null)
- val.finishUnmarshal(ctx, ldr);
+ val.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadUpdateJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadUpdateJob.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadUpdateJob.java
index c19d9e6..7d46e23 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadUpdateJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadUpdateJob.java
@@ -109,12 +109,12 @@ class GridDataLoadUpdateJob implements GridPlainCallable<Object> {
final GridCacheContext cctx = cache.context();
for (IgniteDataLoaderEntry e : col) {
- e.getKey().finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
CacheObject val = e.getValue();
if (val != null)
- val.finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ val.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
}
if (unwrapEntries()) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderEntry.java
index b6efc9f..89bebe4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderEntry.java
@@ -79,7 +79,7 @@ public class IgniteDataLoaderEntry implements Map.Entry<KeyCacheObject, CacheObj
public <K, V> Map.Entry<K, V> toEntry(final GridCacheContext ctx) {
return new Map.Entry<K, V>() {
@Override public K getKey() {
- return key.value(ctx, false);
+ return key.value(ctx.cacheObjectContext(), false);
}
@Override public V setValue(V val) {
@@ -87,7 +87,7 @@ public class IgniteDataLoaderEntry implements Map.Entry<KeyCacheObject, CacheObj
}
@Override public V getValue() {
- return val != null ? val.<V>value(ctx, false) : null;
+ return val != null ? val.<V>value(ctx.cacheObjectContext(), false) : null;
}
};
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index 35a79be..b6ec07e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@ -446,9 +446,12 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
return new IgniteFutureImpl<>(resFut);
}
- catch (IgniteException e) {
+ catch (Throwable e) {
resFut.onDone(e);
+ if (e instanceof Error)
+ throw e;
+
return new IgniteFinishedFutureImpl<>(ctx, e);
}
finally {
@@ -505,8 +508,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
assert key != null;
if (initPda) {
- jobPda = new DataLoaderPda(key.value(null, false),
- CU.value(entry.getValue(), null, false),
+ jobPda = new DataLoaderPda(key.value(cacheObjCtx, false),
+ entry.getValue() != null ? entry.getValue().value(cacheObjCtx, false) : null,
updater);
initPda = false;
@@ -1343,7 +1346,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay
for (Map.Entry<KeyCacheObject, CacheObject> e : entries) {
try {
- e.getKey().finishUnmarshal(cctx, cctx.deploy().globalLoader());
+ e.getKey().finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
GridCacheEntryEx entry = internalCache.entryEx(e.getKey(), topVer);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index 91c69ff..6befea6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -1005,7 +1005,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
for (IgniteTxEntry entry : entries) {
// Check updated or created GridCacheInternalKey keys.
if ((entry.op() == CREATE || entry.op() == UPDATE) && entry.key().internal()) {
- GridCacheInternal key = entry.key().value(entry.context(), false);
+ GridCacheInternal key = entry.key().value(entry.context().cacheObjectContext(), false);
Object val0 = CU.value(entry.value(), entry.context(), false);
@@ -1038,7 +1038,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
// Check deleted GridCacheInternal keys.
if (entry.op() == DELETE && entry.key().internal()) {
- GridCacheInternal key = entry.key().value(entry.context(), false);
+ GridCacheInternal key = entry.key().value(entry.context().cacheObjectContext(), false);
// Entry's val is null if entry deleted.
GridCacheRemovable obj = dsMap.remove(key);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/IgniteCacheObjectProcessorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/IgniteCacheObjectProcessorAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/IgniteCacheObjectProcessorAdapter.java
index bca8127..9500571 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/IgniteCacheObjectProcessorAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/IgniteCacheObjectProcessorAdapter.java
@@ -20,10 +20,12 @@ package org.apache.ignite.internal.processors.portable;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
@@ -75,7 +77,7 @@ public abstract class IgniteCacheObjectProcessorAdapter extends GridProcessorAda
if (obj == null)
return null;
- return obj.prepareForCache(cctx);
+ return obj.prepareForCache(cctx.cacheObjectContext());
}
/** {@inheritDoc} */
@@ -140,7 +142,20 @@ public abstract class IgniteCacheObjectProcessorAdapter extends GridProcessorAda
/** {@inheritDoc} */
@Override public CacheObjectContext contextForCache(ClusterNode node, @Nullable String cacheName) {
- return new CacheObjectContext(ctx);
+ CacheConfiguration ccfg = null;
+
+ for (CacheConfiguration ccfg0 : ctx.config().getCacheConfiguration()) {
+ if (F.eq(cacheName, ccfg0.getName())) {
+ ccfg = ccfg0;
+
+ break;
+ }
+ }
+
+ return new CacheObjectContext(ctx,
+ new GridCacheDefaultAffinityKeyMapper(),
+ ccfg != null && ccfg.isCopyOnGet(),
+ ccfg != null && ccfg.isQueryIndexEnabled());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index be78585..b8b67cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -3439,7 +3439,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
locKeys.addAll(cache.keySet(new CacheEntryPredicateAdapter() {
@Override public boolean apply(GridCacheEntryEx e) {
- return grid(0).affinity(null).isBackup(grid(0).localNode(), e.key().value(e.context(), false));
+ return grid(0).affinity(null).isBackup(grid(0).localNode(),
+ e.key().value(e.context().cacheObjectContext(), false));
}
}));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
index fdc7e81..ad2a4d2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
@@ -577,7 +577,7 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
CacheValue val = CU.value(entry.rawGet(), entry.context(), false);
assertNotNull("Value null for key: " + i, val);
- assertEquals(entry.key().value(entry.context(), false), (Integer)val.value());
+ assertEquals(entry.key().value(entry.context().cacheObjectContext(), false), (Integer)val.value());
assertEquals(entry.version(), versions.get(i));
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
index 8b240f5..ecfa7f6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
@@ -357,7 +357,7 @@ public abstract class GridCacheAbstractQueueFailoverDataConsistencySelfTest exte
for (int i = 0; i < gridCount(); i++) {
for (GridCacheEntryEx e : ((IgniteKernal)grid(i)).context().cache().internalCache(cctx.name()).map().allEntries0()) {
- if (aff.primary(grid(i).localNode(), e.key(), -1) && e.key().value(cctx, false) instanceof GridCacheQueueHeaderKey)
+ if (aff.primary(grid(i).localNode(), e.key(), -1) && e.key().value(cctx.cacheObjectContext(), false) instanceof GridCacheQueueHeaderKey)
return i;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java
index 7f73726..ec5fc5b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java
@@ -270,7 +270,7 @@ public class GridCachePartitionedMultiNodeCounterSelfTest extends GridCommonAbst
assertNotNull(dhtEntry);
- assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context(), false));
+ assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context().cacheObjectContext(), false));
final AtomicInteger globalCntr = new AtomicInteger(0);
@@ -560,7 +560,7 @@ public class GridCachePartitionedMultiNodeCounterSelfTest extends GridCommonAbst
assertNotNull(dhtEntry);
- assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context(), false));
+ assertEquals(Integer.valueOf(0), dhtEntry.rawGet().value(dhtEntry.context().cacheObjectContext(), false));
startLatchMultiNode = new CountDownLatch(gridCnt);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 3002673..d98da6c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -2086,10 +2086,9 @@ public class IgniteH2Indexing implements GridQueryIndexing {
if (cctx.isNear())
cctx = cctx.near().dht().context();
- // TODO IGNITE-51.
GridCacheSwapEntry e = cctx.swap().read(cctx.toCacheKeyObject(key), true, true);
- return e != null ? e.value().value(cctx, false) : null;
+ return e != null ? e.value().value(cctx.cacheObjectContext(), false) : null;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
index 28f7ce0..952651a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
@@ -271,10 +271,10 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest {
assert entry != null;
assert entry.key() != null;
- Long val = entry.rawGet().value(entry.context(), false);
+ Long val = entry.rawGet().value(entry.context().cacheObjectContext(), false);
assertNotNull("Value null for key: " + i, val);
- assertEquals(entry.key().value(entry.context(), false), val);
+ assertEquals(entry.key().value(entry.context().cacheObjectContext(), false), val);
assertEquals(entry.version(), versions.get(i));
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringDynamicCacheManager.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringDynamicCacheManager.java b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringDynamicCacheManager.java
index 0a538a0..f5af8b8 100644
--- a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringDynamicCacheManager.java
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringDynamicCacheManager.java
@@ -316,7 +316,7 @@ public class SpringDynamicCacheManager extends SpringCacheManager {
/** {@inheritDoc} */
@Override public boolean apply(GridCacheEntryEx e) {
- DataKey key = e.key().value(e.context(), false);
+ DataKey key = e.key().value(e.context().cacheObjectContext(), false);
return name != null ? name.equals(key.name) : key.name == null;
}
[16/16] incubator-ignite git commit: # ignite-51
Posted by sb...@apache.org.
# ignite-51
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4f1568d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4f1568d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4f1568d7
Branch: refs/heads/ignite-51
Commit: 4f1568d75bd0e8182317b09b29016eeb1fec2f04
Parents: 9537359
Author: sboikov <sb...@gridgain.com>
Authored: Wed Mar 4 23:52:56 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Mar 4 23:54:30 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 37 +++-----------------
.../local/atomic/GridLocalAtomicCache.java | 5 +--
2 files changed, 5 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f1568d7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index c897477..44890f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -621,10 +621,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
@Override public IgniteInternalFuture<Boolean> containsKeyAsync(K key) {
A.notNull(key, "key");
- final K key0 = ctx.portableEnabled() ? (K)ctx.marshalToPortable(key) : key;
-
return getAllAsync(
- Collections.singletonList(key0),
+ Collections.singletonList(key),
/*force primary*/false,
/*skip tx*/false,
/*entry*/null,
@@ -638,10 +636,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
assert map.isEmpty() || map.size() == 1 : map.size();
- if (ctx.portableEnabled())
- return map.isEmpty() ? false : map.values().iterator().next() != null;
- else
- return map.get(key0) != null;
+ return map.isEmpty() ? false : map.values().iterator().next() != null;
}
});
}
@@ -660,14 +655,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
@Override public IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends K> keys) {
A.notNull(keys, "keys");
- if (ctx.portableEnabled() && !F.isEmpty(keys)) {
- keys = F.viewReadOnly(keys, new C1<K, K>() {
- @Override public K apply(K k) {
- return (K)ctx.marshalToPortable(k);
- }
- });
- }
-
return getAllAsync(
keys,
/*force primary*/false,
@@ -3687,12 +3674,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (ctx.deploymentEnabled())
ctx.deploy().registerClass(val);
- K key0 = key;
-
- if (ctx.portableEnabled())
- key0 = (K)ctx.marshalToPortable(key);
-
- return tx.removeAllAsync(ctx, Collections.singletonList(key0), null, false,
+ return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
ctx.equalsValArray(val)).get().success();
}
@@ -3734,18 +3716,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
}
}
- K key0 = key;
-
- if (ctx.portableEnabled()) {
- try {
- key0 = (K)ctx.marshalToPortable(key);
- }
- catch (IgniteException e) {
- return new GridFinishedFuture<>(ctx.kernalContext(), e);
- }
- }
-
- return tx.removeAllAsync(ctx, Collections.singletonList(key0), null, false,
+ return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
ctx.equalsValArray(val)).chain(
(IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f1568d7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index cffe3c2..130fbe4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -500,10 +500,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
assert m.isEmpty() || m.size() == 1 : m.size();
- if (ctx.portableEnabled())
- return m.isEmpty() ? null : m.values().iterator().next();
- else
- return m.get(key);
+ return m.isEmpty() ? null : m.values().iterator().next();
}
/** {@inheritDoc} */
[14/16] incubator-ignite git commit: # ignite-51
Posted by sb...@apache.org.
# ignite-51
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b876320e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b876320e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b876320e
Branch: refs/heads/ignite-51
Commit: b876320ecac810f592920a3c7a2b6b7c781565b4
Parents: 832d1ee
Author: sboikov <sb...@gridgain.com>
Authored: Wed Mar 4 23:12:24 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Mar 4 23:23:40 2015 +0300
----------------------------------------------------------------------
.../communication/GridIoMessageFactory.java | 2 +-
.../affinity/GridAffinityAssignmentCache.java | 11 +-
.../affinity/GridAffinityProcessor.java | 35 +++--
.../cache/CacheEntryPredicateContainsValue.java | 5 +-
.../processors/cache/CacheEvictionEntry.java | 2 +-
.../cache/CacheInvokeDirectResult.java | 4 +-
.../internal/processors/cache/CacheObject.java | 8 +-
.../processors/cache/CacheObjectAdapter.java | 4 +-
.../processors/cache/CacheObjectContext.java | 42 ++++-
.../processors/cache/CacheObjectImpl.java | 18 +--
.../processors/cache/EvictableEntryImpl.java | 10 +-
.../processors/cache/GridCacheAdapter.java | 22 +--
.../cache/GridCacheConcurrentMap.java | 2 +-
.../processors/cache/GridCacheContext.java | 28 ++--
.../GridCacheDefaultAffinityKeyMapper.java | 44 +++---
.../cache/GridCacheDeploymentManager.java | 2 +-
.../processors/cache/GridCacheEntryInfo.java | 4 +-
.../processors/cache/GridCacheEventManager.java | 6 +-
.../cache/GridCacheEvictionRequest.java | 2 +-
.../processors/cache/GridCacheMapEntry.java | 58 ++++---
.../processors/cache/GridCacheMessage.java | 10 +-
.../processors/cache/GridCacheProcessor.java | 29 ++--
.../processors/cache/GridCacheStoreManager.java | 20 +--
.../processors/cache/GridCacheSwapManager.java | 65 +++++---
.../processors/cache/GridCacheUtils.java | 7 +-
.../processors/cache/KeyCacheObjectImpl.java | 14 +-
.../cache/KeyCacheObjectTransferImpl.java | 8 +-
.../processors/cache/UserCacheObjectImpl.java | 4 +-
.../cache/UserKeyCacheObjectImpl.java | 12 +-
.../cache/affinity/GridCacheAffinityImpl.java | 10 +-
.../CacheDataStructuresManager.java | 2 +-
.../distributed/dht/GridDhtCacheAdapter.java | 2 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 4 +-
.../dht/atomic/GridDhtAtomicCache.java | 14 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 4 +-
.../atomic/GridNearAtomicUpdateResponse.java | 2 +-
.../distributed/near/CacheVersionedValue.java | 157 +++++++++++++++++++
.../distributed/near/GridNearCacheEntry.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 4 +-
.../cache/distributed/near/GridNearTxLocal.java | 4 +-
.../near/GridNearTxPrepareFuture.java | 6 +-
.../near/GridNearTxPrepareResponse.java | 18 +--
.../near/NearTxPrepareResponseOwnedValue.java | 157 -------------------
.../local/atomic/GridLocalAtomicCache.java | 13 +-
.../cache/query/GridCacheQueryManager.java | 2 +-
.../continuous/CacheContinuousQueryEntry.java | 6 +-
.../continuous/CacheContinuousQueryEvent.java | 2 +-
.../continuous/CacheContinuousQueryManager.java | 6 +-
.../cache/transactions/IgniteTxAdapter.java | 2 +-
.../cache/transactions/IgniteTxEntry.java | 2 +-
.../cache/transactions/IgniteTxKey.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 28 +---
.../cache/transactions/TxEntryValueHolder.java | 2 +-
.../dataload/GridDataLoadUpdateJob.java | 4 +-
.../dataload/IgniteDataLoaderEntry.java | 4 +-
.../dataload/IgniteDataLoaderImpl.java | 11 +-
.../datastructures/DataStructuresProcessor.java | 4 +-
.../IgniteCacheObjectProcessorAdapter.java | 19 ++-
.../cache/GridCacheAbstractFullApiSelfTest.java | 3 +-
.../cache/GridCacheOffHeapSelfTest.java | 2 +-
...actQueueFailoverDataConsistencySelfTest.java | 2 +-
...achePartitionedMultiNodeCounterSelfTest.java | 4 +-
.../processors/query/h2/IgniteH2Indexing.java | 3 +-
.../cache/GridCacheOffHeapAndSwapSelfTest.java | 4 +-
.../cache/spring/SpringDynamicCacheManager.java | 2 +-
65 files changed, 526 insertions(+), 465 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index 7c4f949..05679ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -560,7 +560,7 @@ public class GridIoMessageFactory implements MessageFactory {
break;
case 102:
- msg = new NearTxPrepareResponseOwnedValue();
+ msg = new CacheVersionedValue();
break;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 40fa43a..316aefc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -93,6 +93,10 @@ public class GridAffinityAssignmentCache {
CacheAffinityKeyMapper affMapper,
int backups)
{
+ assert ctx != null;
+ assert aff != null;
+ assert affMapper != null;
+
this.ctx = ctx;
this.aff = aff;
this.affMapper = affMapper;
@@ -296,10 +300,6 @@ public class GridAffinityAssignmentCache {
* @return Partition.
*/
public int partition(Object key) {
- // TODO IGNITE-51.
- if (key instanceof CacheObject)
- key = ((CacheObject)key).value(ctx, false);
-
return aff.partition(affinityKey(key));
}
@@ -311,6 +311,9 @@ public class GridAffinityAssignmentCache {
* @return Affinity key.
*/
private Object affinityKey(Object key) {
+ if (key instanceof CacheObject)
+ key = ((CacheObject)key).value(ctx.cacheObjectContext(), false);
+
return (key instanceof GridCacheInternal ? ctx.defaultAffMapper() : affMapper).affinityKey(key);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
index d7d0391..7458078 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
@@ -225,8 +225,8 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
if (affInfo == null || affInfo.mapper == null)
return null;
- if (affInfo.portableEnabled)
- key = ctx.portable().marshalToPortable(key);
+ if (key instanceof CacheObject)
+ key = ((CacheObject)key).value(affInfo.cacheObjCtx, false);
return affInfo.mapper.affinityKey(key);
}
@@ -282,6 +282,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
/**
* @param cacheName Cache name.
+ * @param topVer Topology version.
* @return Affinity cache.
* @throws IgniteCheckedException In case of error.
*/
@@ -304,7 +305,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
cctx.config().getAffinity(),
cctx.config().getAffinityMapper(),
new GridAffinityAssignment(topVer, cctx.affinity().assignments(topVer)),
- cctx.portableEnabled());
+ cctx.cacheObjectContext());
IgniteInternalFuture<AffinityInfo> old = affMap.putIfAbsent(key, new GridFinishedFuture<>(ctx, info));
@@ -402,6 +403,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
* {@link CacheAffinityKeyMapper} from remote node.
*
* @param cacheName Name of cache on which affinity is requested.
+ * @param topVer Topology version.
* @param n Node from which affinity is requested.
* @return Affinity cached function.
* @throws IgniteCheckedException If either local or remote node cannot get deployment for affinity objects.
@@ -420,9 +422,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
f.reset();
m.reset();
- Boolean portableEnabled = ctx.portable().portableEnabled(n, cacheName);
-
- return new AffinityInfo(f, m, t.get3(), portableEnabled != null && portableEnabled);
+ return new AffinityInfo(f, m, t.get3(), ctx.portable().contextForCache(n, cacheName));
}
/**
@@ -471,6 +471,9 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException In case of error.
*/
private <K> ClusterNode primary(AffinityInfo aff, K key) throws IgniteCheckedException {
+ if (key instanceof CacheObject)
+ key = ((CacheObject)key).value(aff.cacheObjCtx, false);
+
int part = aff.affFunc.partition(aff.mapper.affinityKey(key));
Collection<ClusterNode> nodes = aff.assignment.get(part);
@@ -487,6 +490,9 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
* @return Primary and backup nodes.
*/
private <K> List<ClusterNode> primaryAndBackups(AffinityInfo aff, K key) {
+ if (key instanceof CacheObject)
+ key = ((CacheObject) key).value(aff.cacheObjCtx, false);
+
int part = aff.affFunc.partition(aff.mapper.affinityKey(key));
return aff.assignment.get(part);
@@ -512,21 +518,23 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
/** Assignment. */
private GridAffinityAssignment assignment;
- /** Portable enabled flag. */
- private boolean portableEnabled;
+ /** */
+ private CacheObjectContext cacheObjCtx;
/**
* @param affFunc Affinity function.
* @param mapper Affinity key mapper.
* @param assignment Partition assignment.
- * @param portableEnabled Portable enabled flag.
+ * @param cacheObjCtx Cache objects context.
*/
- private AffinityInfo(CacheAffinityFunction affFunc, CacheAffinityKeyMapper mapper,
- GridAffinityAssignment assignment, boolean portableEnabled) {
+ private AffinityInfo(CacheAffinityFunction affFunc,
+ CacheAffinityKeyMapper mapper,
+ GridAffinityAssignment assignment,
+ CacheObjectContext cacheObjCtx) {
this.affFunc = affFunc;
this.mapper = mapper;
this.assignment = assignment;
- this.portableEnabled = portableEnabled;
+ this.cacheObjCtx = cacheObjCtx;
}
/**
@@ -745,6 +753,9 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
ctx.gateway().readLock();
try {
+ if (key instanceof CacheObject)
+ key = ((CacheObject)key).value(cache().cacheObjCtx, false);
+
return cache().keyMapper().affinityKey(key);
}
catch (IgniteCheckedException e) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateContainsValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateContainsValue.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateContainsValue.java
index 412b685..0765930 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateContainsValue.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateContainsValue.java
@@ -55,7 +55,8 @@ public class CacheEntryPredicateContainsValue implements CacheEntryPredicate {
try {
CacheObject val = entry.rawGetOrUnmarshal(true);
- return F.eq(this.val.value(entry.context(), false), CU.value(val, entry.context(), false));
+ return F.eq(this.val.value(entry.context().cacheObjectContext(), false),
+ CU.value(val, entry.context(), false));
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -64,7 +65,7 @@ public class CacheEntryPredicateContainsValue implements CacheEntryPredicate {
/** {@inheritDoc} */
@Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
- val.finishUnmarshal(ctx, ldr);
+ val.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictionEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictionEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictionEntry.java
index a5576f9..da3d975 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictionEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictionEntry.java
@@ -97,7 +97,7 @@ public class CacheEvictionEntry implements Message {
* @throws IgniteCheckedException If failed.
*/
public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
- key.finishUnmarshal(ctx, ldr);
+ key.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
index 02a297f..3c5c5c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
@@ -105,13 +105,13 @@ public class CacheInvokeDirectResult implements Message {
/** {@inheritDoc} */
public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
- key.finishUnmarshal(ctx, ldr);
+ key.finishUnmarshal(ctx.cacheObjectContext(), ldr);
if (errBytes != null)
err = ctx.marshaller().unmarshal(errBytes, ldr);
if (res != null)
- res.finishUnmarshal(ctx, ldr);
+ res.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObject.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObject.java
index ba5a1fe..b231d89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObject.java
@@ -30,7 +30,7 @@ public interface CacheObject extends Message {
* @param cpy If {@code true} need to copy value.
* @return Value.
*/
- @Nullable public <T> T value(GridCacheContext ctx, boolean cpy);
+ @Nullable public <T> T value(CacheObjectContext ctx, boolean cpy);
/**
* @param name Field name.
@@ -54,19 +54,19 @@ public interface CacheObject extends Message {
* @return Value bytes.
* @throws IgniteCheckedException If failed.
*/
- public byte[] valueBytes(GridCacheContext ctx) throws IgniteCheckedException;
+ public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException;
/**
* @param ctx Context.
* @param ldr Class loader.
* @throws IgniteCheckedException If failed.
*/
- public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+ public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException;
/**
* @param ctx Cache context.
*
* @return Instance to store in cache.
*/
- public CacheObject prepareForCache(GridCacheContext ctx);
+ public CacheObject prepareForCache(CacheObjectContext ctx);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
index b8ca690..4d8572a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
@@ -46,8 +46,8 @@ public abstract class CacheObjectAdapter implements CacheObject, Externalizable
* @param ctx Context.
* @return {@code True} need to copy value returned to user.
*/
- protected boolean needCopy(GridCacheContext ctx) {
- return ctx.config().isCopyOnGet() && val != null && !ctx.portable().immutable(val);
+ protected boolean needCopy(CacheObjectContext ctx) {
+ return ctx.copyOnGet() && val != null && !ctx.processor().immutable(val);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index b2a79f2..a61be98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache;
+import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.portable.*;
@@ -30,16 +31,55 @@ public class CacheObjectContext {
/** */
private GridPortableProcessor proc;
+ /** */
+ private CacheAffinityKeyMapper dfltAffMapper;
+
+ /** */
+ private boolean cpyOnGet;
+
+ /** */
+ private boolean unmarshalVals;
+
/**
* @param kernalCtx Kernal context.
+ * @param dfltAffMapper Default affinity mapper.
+ * @param cpyOnGet Copy on get flag.
+ * @param unmarshalVals Unmarshal values flag.
*/
- public CacheObjectContext(GridKernalContext kernalCtx) {
+ public CacheObjectContext(GridKernalContext kernalCtx,
+ CacheAffinityKeyMapper dfltAffMapper,
+ boolean cpyOnGet,
+ boolean unmarshalVals) {
this.kernalCtx = kernalCtx;
+ this.dfltAffMapper = dfltAffMapper;
+ this.cpyOnGet = cpyOnGet;
+ this.unmarshalVals = unmarshalVals;
proc = kernalCtx.portable();
}
/**
+ * @return Copy on get flag.
+ */
+ public boolean copyOnGet() {
+ return cpyOnGet;
+ }
+
+ /**
+ * @return Unmarshal values flag.
+ */
+ public boolean unmarshalValues() {
+ return unmarshalVals;
+ }
+
+ /**
+ * @return Default affinity mapper.
+ */
+ public CacheAffinityKeyMapper defaultAffMapper() {
+ return dfltAffMapper;
+ }
+
+ /**
* @return Kernal context.
*/
public GridKernalContext kernalContext() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
index 87ff779..ebc5de7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
@@ -49,7 +49,7 @@ public class CacheObjectImpl extends CacheObjectAdapter {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
- @Nullable @Override public <T> T value(GridCacheContext ctx, boolean cpy) {
+ @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy) {
cpy = cpy && needCopy(ctx);
try {
@@ -59,7 +59,7 @@ public class CacheObjectImpl extends CacheObjectAdapter {
if (byteArray())
return (T)Arrays.copyOf(bytes, bytes.length);
else
- return (T)ctx.portable().unmarshal(ctx.cacheObjectContext(), valBytes, U.gridClassLoader());
+ return (T)ctx.processor().unmarshal(ctx, valBytes, ctx.kernalContext().config().getClassLoader());
}
if (val != null)
@@ -67,7 +67,7 @@ public class CacheObjectImpl extends CacheObjectAdapter {
assert valBytes != null;
- val = ctx.portable().unmarshal(ctx.cacheObjectContext(), valBytes, U.gridClassLoader());
+ val = ctx.processor().unmarshal(ctx, valBytes, ctx.kernalContext().config().getClassLoader());
}
catch (IgniteCheckedException e) {
throw new IgniteException("Failed to unmarshal object.", e);
@@ -82,12 +82,12 @@ public class CacheObjectImpl extends CacheObjectAdapter {
}
/** {@inheritDoc} */
- @Override public byte[] valueBytes(GridCacheContext ctx) throws IgniteCheckedException {
+ @Override public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException {
if (byteArray())
return (byte[])val;
if (valBytes == null)
- valBytes = ctx.portable().marshal(ctx.cacheObjectContext(), val);
+ valBytes = ctx.processor().marshal(ctx, val);
return valBytes;
}
@@ -101,11 +101,11 @@ public class CacheObjectImpl extends CacheObjectAdapter {
}
/** {@inheritDoc} */
- @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
+ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException {
assert val != null || valBytes != null;
- if (val == null && ctx.isUnmarshalValues())
- val = ctx.portable().unmarshal(ctx.cacheObjectContext(), valBytes, ldr);
+ if (val == null && ctx.unmarshalValues())
+ val = ctx.processor().unmarshal(ctx, valBytes, ldr);
}
/** {@inheritDoc} */
@@ -201,7 +201,7 @@ public class CacheObjectImpl extends CacheObjectAdapter {
}
/** {@inheritDoc} */
- @Override public CacheObject prepareForCache(GridCacheContext ctx) {
+ @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
return this;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/EvictableEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/EvictableEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/EvictableEntryImpl.java
index 81abb7c..8f451a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/EvictableEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/EvictableEntryImpl.java
@@ -46,7 +46,7 @@ public class EvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
/** {@inheritDoc} */
@Override public K getKey() throws IllegalStateException {
- return cached.key().value(cached.context(), false);
+ return cached.key().value(cached.context().cacheObjectContext(), false);
}
/** {@inheritDoc} */
@@ -79,7 +79,7 @@ public class EvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
try {
CacheObject val = cached.peek(GridCachePeekMode.GLOBAL);
- return val != null ? val.<V>value(cached.context(), false) : null;
+ return val != null ? val.<V>value(cached.context().cacheObjectContext(), false) : null;
}
catch (GridCacheEntryRemovedException e) {
return null;
@@ -96,13 +96,13 @@ public class EvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
GridTuple<CacheObject> peek = tx.peek(cached.context(), false, cached.key(), null);
if (peek != null)
- return peek.get().value(cached.context(), false);
+ return peek.get().value(cached.context().cacheObjectContext(), false);
}
if (cached.detached()) {
CacheObject val = cached.rawGet();
- return val != null ? val.<V>value(cached.context(), false) : null;
+ return val != null ? val.<V>value(cached.context().cacheObjectContext(), false) : null;
}
for (;;) {
@@ -114,7 +114,7 @@ public class EvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
try {
CacheObject val = e.peek(GridCachePeekMode.GLOBAL, CU.empty0());
- return val != null ? val.<V>value(cached.context(), false) : null;
+ return val != null ? val.<V>value(cached.context().cacheObjectContext(), false) : null;
}
catch (GridCacheEntryRemovedException ignored) {
// No-op.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 98a5cb4..c897477 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -839,7 +839,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
else
cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc);
- Object val = cacheVal != null ? cacheVal.value(ctx, true) : null;
+ Object val = CU.value(cacheVal, ctx, true);
if (ctx.portableEnabled())
val = ctx.unwrapPortableIfNeeded(val, ctx.keepPortable());
@@ -948,7 +948,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (peek != null) {
CacheObject v = peek.get();
- Object val0 = v.value(ctx, true);
+ Object val0 = v.value(ctx.cacheObjectContext(), true);
if (ctx.portableEnabled())
val0 = ctx.unwrapPortableIfNeeded(v, ctx.keepPortable());
@@ -1038,7 +1038,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
}
if (val != null)
- return F.t((V)val.get().value(ctx, true));
+ return F.t((V)val.get().value(ctx.cacheObjectContext(), true));
}
}
catch (GridCacheEntryRemovedException ignore) {
@@ -1751,11 +1751,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (map != null) {
if (set || wasNew)
- map.put(key.<K>value(ctx, false), (V)val);
+ map.put(key.<K>value(ctx.cacheObjectContext(), false), (V)val);
else {
try {
// TODO IGNITE-51.
- K k = key.<K>value(ctx, false);
+ K k = key.<K>value(ctx.cacheObjectContext(), false);
GridTuple<V> v = peek0(false, k, GLOBAL);
@@ -4057,7 +4057,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
long topVer,
boolean replicate,
long ttl) {
- if (p != null && !p.apply(key.value(ctx, false), val))
+ if (p != null && !p.apply(key.value(ctx.cacheObjectContext(), false), val))
return;
CacheObject cacheVal = ctx.toCacheObject(val);
@@ -4487,7 +4487,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
CacheObject val = unswapped.value();
- Object val0 = val != null ? val.value(ctx, true) : null;
+ Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null;
if (ctx.portableEnabled())
return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable);
@@ -5302,7 +5302,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
CacheObject val = entryEx(cacheKey).innerReload();
- return (V)(val != null ? val.value(ctx, true) : null);
+ return (V)(val != null ? val.value(ctx.cacheObjectContext(), true) : null);
}
catch (GridCacheEntryRemovedException ignored) {
if (log.isDebugEnabled())
@@ -5535,8 +5535,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
KeyCacheObject key = entry.key();
- Object key0 = key.value(ctx, true);
- Object val0 = val.value(ctx, true);
+ Object key0 = key.value(ctx.cacheObjectContext(), true);
+ Object val0 = val.value(ctx.cacheObjectContext(), true);
if (deserializePortable && ctx.portableEnabled()) {
key0 = ctx.unwrapPortableIfNeeded(key0, true);
@@ -6287,7 +6287,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
{
assert ver != null;
- if (p != null && !p.apply(key.<K>value(ctx, false), (V)val))
+ if (p != null && !p.apply(key.<K>value(ctx.cacheObjectContext(), false), (V)val))
return;
long ttl = 0;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index d9dce4d..eb1124f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -2174,7 +2174,7 @@ public class GridCacheConcurrentMap {
/** {@inheritDoc} */
@Override public K next() {
- return it.next().key().value(it.ctx, true);
+ return it.next().key().value(it.ctx.cacheObjectContext(), true);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index be22b85..0827ef7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -156,9 +156,6 @@ public class GridCacheContext<K, V> implements Externalizable {
/** Cached local rich node. */
private ClusterNode locNode;
- /** Default cache affinity mapper. */
- private CacheAffinityKeyMapper affMapper;
-
/**
* Thread local projection. If it's set it means that method call was initiated
* by child projection of initial cache.
@@ -292,8 +289,6 @@ public class GridCacheContext<K, V> implements Externalizable {
cacheName = cacheCfg.getName();
- cacheObjCtx = ctx.portable().contextForCache(null, cacheName);
-
if (cacheName != null) {
int hash = cacheName.hashCode();
@@ -1003,14 +998,16 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return Default affinity key mapper.
*/
public CacheAffinityKeyMapper defaultAffMapper() {
- return affMapper;
+ return cacheObjCtx.defaultAffMapper();
}
/**
- * Sets default affinity key mapper.
+ * Sets cache object context.
+ *
+ * @param cacheObjCtx Cache object context.
*/
- public void defaultAffMapper(CacheAffinityKeyMapper dfltAffMapper) {
- this.affMapper = dfltAffMapper;
+ public void cacheObjectContext(CacheObjectContext cacheObjCtx) {
+ this.cacheObjCtx = cacheObjCtx;
}
/**
@@ -1421,13 +1418,6 @@ public class GridCacheContext<K, V> implements Externalizable {
}
/**
- * @return {@code True} if values should be always unmarshalled.
- */
- public boolean isUnmarshalValues() {
- return cacheCfg.isQueryIndexEnabled();
- }
-
- /**
* @return {@code True} if deployment enabled.
*/
public boolean deploymentEnabled() {
@@ -1871,8 +1861,8 @@ public class GridCacheContext<K, V> implements Externalizable {
assert val != null;
if (!keepCacheObjects) {
- Object key0 = key.value(this, false);
- Object val0 = skipVals ? true : val.value(this, cpy);
+ Object key0 = key.value(cacheObjCtx, false);
+ Object val0 = skipVals ? true : val.value(cacheObjCtx, cpy);
if (portableEnabled() && deserializePortable) {
key0 = unwrapPortableIfNeeded(key0, false);
@@ -1899,7 +1889,7 @@ public class GridCacheContext<K, V> implements Externalizable {
evictMgr = null;
qryMgr = null;
dataStructuresMgr = null;
- affMapper = null;
+ cacheObjCtx = null;
mgrs.clear();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDefaultAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDefaultAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDefaultAffinityKeyMapper.java
index 2b6bfc9..f52bf46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDefaultAffinityKeyMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDefaultAffinityKeyMapper.java
@@ -46,7 +46,7 @@ public class GridCacheDefaultAffinityKeyMapper implements CacheAffinityKeyMapper
/** Injected ignite instance. */
@IgniteInstanceResource
- private Ignite ignite;
+ protected Ignite ignite;
/** Reflection cache. */
private GridReflectionCache reflectCache = new GridReflectionCache(
@@ -76,7 +76,7 @@ public class GridCacheDefaultAffinityKeyMapper implements CacheAffinityKeyMapper
/** Logger. */
@LoggerResource
- private transient IgniteLogger log;
+ protected transient IgniteLogger log;
/**
* If key class has annotation {@link CacheAffinityKeyMapped},
@@ -89,32 +89,26 @@ public class GridCacheDefaultAffinityKeyMapper implements CacheAffinityKeyMapper
@Override public Object affinityKey(Object key) {
GridArgumentCheck.notNull(key, "key");
- IgniteKernal kernal = (IgniteKernal)ignite;
+ try {
+ Object o = reflectCache.firstFieldValue(key);
- if (kernal.context().portable().isPortableObject(key))
- return kernal.context().portable().affinityKey(key);
- else {
- try {
- Object o = reflectCache.firstFieldValue(key);
-
- if (o != null)
- return o;
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to access affinity field for key [field=" +
- reflectCache.firstField(key.getClass()) + ", key=" + key + ']', e);
- }
+ if (o != null)
+ return o;
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to access affinity field for key [field=" +
+ reflectCache.firstField(key.getClass()) + ", key=" + key + ']', e);
+ }
- try {
- Object o = reflectCache.firstMethodValue(key);
+ try {
+ Object o = reflectCache.firstMethodValue(key);
- if (o != null)
- return o;
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to invoke affinity method for key [mtd=" +
- reflectCache.firstMethod(key.getClass()) + ", key=" + key + ']', e);
- }
+ if (o != null)
+ return o;
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to invoke affinity method for key [mtd=" +
+ reflectCache.firstMethod(key.getClass()) + ", key=" + key + ']', e);
}
return key;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index b365b45..8485f28 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -316,7 +316,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
assert key != null : "Key cannot be null for cache entry: " + e;
- Object key0 = key.value(cache.context(), false);
+ Object key0 = key.value(cache.context().cacheObjectContext(), false);
Object val0 = CU.value(v, cache.context(), false);
ClassLoader keyLdr = U.detectObjectClassLoader(key0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
index 0179ad0..9b08714 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
@@ -351,10 +351,10 @@ public class GridCacheEntryInfo implements Externalizable, Message {
* @throws IgniteCheckedException If unmarshalling failed.
*/
public void unmarshal(GridCacheContext ctx, ClassLoader clsLdr) throws IgniteCheckedException {
- key.finishUnmarshal(ctx, clsLdr);
+ key.finishUnmarshal(ctx.cacheObjectContext(), clsLdr);
if (val != null)
- val.finishUnmarshal(ctx, clsLdr);
+ val.finishUnmarshal(ctx.cacheObjectContext(), clsLdr);
// TODO IGNITE-51
// Marshaller mrsh = ctx.marshaller();
//
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
index d87a224..90ae04b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
@@ -244,12 +244,12 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
type,
part,
cctx.isNear(),
- key.value(cctx, false),
+ key.value(cctx.cacheObjectContext(), false),
xid,
lockId,
- newVal != null ? newVal.value(cctx, false) : null,
+ CU.value(newVal, cctx, false),
hasNewVal,
- oldVal != null ? oldVal.value(cctx, false) : null,
+ CU.value(oldVal, cctx, false),
hasOldVal,
subjId,
cloClsName,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
index 661bb06..c892148 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionRequest.java
@@ -88,7 +88,7 @@ public class GridCacheEvictionRequest extends GridCacheMessage implements GridCa
e.prepareMarshal(cctx);
if (depEnabled)
- prepareObject(e.key().value(cctx, false), ctx);
+ prepareObject(e.key().value(cctx.cacheObjectContext(), false), ctx);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index b2a2e04..0c492d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -186,7 +186,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
assert Thread.holdsLock(this);
// In case we deal with IGFS cache, count updated data
- if (cctx.cache().isIgfsDataCache() && cctx.kernalContext().igfsHelper().isIgfsBlockKey(key.value(cctx, false))) {
+ if (cctx.cache().isIgfsDataCache() &&
+ cctx.kernalContext().igfsHelper().isIgfsBlockKey(key.value(cctx.cacheObjectContext(), false))) {
int newSize = valueLength0(val, null);
int oldSize = valueLength0(this.val, (this.val == null && valPtr != 0) ? valueBytes0() : null);
@@ -207,7 +208,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
Object val0 = null;
if (val != null) {
- val0 = val.value(cctx, false);
+ val0 = val.value(cctx.cacheObjectContext(), false);
if (val0 != null)
cctx.gridDeploy().deploy(val0.getClass(), val0.getClass().getClassLoader());
@@ -226,7 +227,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
if (val != null) {
boolean valIsByteArr = val.byteArray();
- valPtr = mem.putOffHeap(valPtr, val.valueBytes(cctx), valIsByteArr);
+ valPtr = mem.putOffHeap(valPtr, val.valueBytes(cctx.cacheObjectContext()), valIsByteArr);
}
else {
mem.removeOffHeap(valPtr);
@@ -263,7 +264,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
* @return Length of value.
*/
private int valueLength0(@Nullable CacheObject val, @Nullable IgniteBiTuple<byte[], Boolean> valBytes) {
- byte[] bytes = val != null ? (byte[])val.value(cctx, false) : null;
+ byte[] bytes = val != null ? (byte[])val.value(cctx.cacheObjectContext(), false) : null;
return bytes != null ? bytes.length :
(valBytes == null) ? 0 : valBytes.get1().length - (valBytes.get2() ? 0 : 6);
@@ -551,8 +552,10 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
IgniteUuid valClsLdrId = null;
- if (val != null)
- valClsLdrId = cctx.deploy().getClassLoaderId(val.value(cctx, false).getClass().getClassLoader());
+ if (val != null) {
+ valClsLdrId = cctx.deploy().getClassLoaderId(
+ val.value(cctx.cacheObjectContext(), false).getClass().getClassLoader());
+ }
IgniteBiTuple<byte[], Boolean> valBytes = valueBytes0();
@@ -562,7 +565,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
ver,
ttlExtras(),
expireTime,
- cctx.deploy().getClassLoaderId(U.detectObjectClassLoader(key.value(cctx, false))),
+ cctx.deploy().getClassLoaderId(U.detectObjectClassLoader(key.value(cctx.cacheObjectContext(), false))),
valClsLdrId);
if (log.isDebugEnabled())
@@ -585,7 +588,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
assert val != null;
try {
- byte[] bytes = val.valueBytes(cctx);
+ byte[] bytes = val.valueBytes(cctx.cacheObjectContext());
boolean plain = val.byteArray();
@@ -1030,7 +1033,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : this.val;
if (intercept) {
- key0 = key.value(cctx, false);
+ key0 = key.value(cctx.cacheObjectContext(), false);
val0 = CU.value(val, cctx, false);
Object interceptorVal = cctx.config().getInterceptor().onBeforePut(key0,
@@ -1181,7 +1184,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val;
if (intercept) {
- key0 = key.value(cctx, false);
+ key0 = key.value(cctx.cacheObjectContext(), false);
old0 = CU.value(old, cctx, false);
interceptRes = cctx.config().getInterceptor().onBeforeRemove(key0, old0);
@@ -1422,7 +1425,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
assert entryProcessor != null;
- key0 = key.value(cctx, false);
+ key0 = key.value(cctx.cacheObjectContext(), false);
old0 = value(old0, old, false);
CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry<>(cctx, key0, old0);
@@ -1876,7 +1879,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
EntryProcessor<Object, Object, ?> entryProcessor = (EntryProcessor<Object, Object, ?>)writeObj;
- key0 = key.value(cctx, false);
+ key0 = key.value(cctx.cacheObjectContext(), false);
old0 = value(old0, oldVal, false);
CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry<>(cctx, key0, old0);
@@ -2214,7 +2217,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
if (val != null)
return val;
- return cacheObj != null ? cacheObj.value(cctx, cpy) : null;
+ return cacheObj != null ? cacheObj.value(cctx.cacheObjectContext(), cpy) : null;
}
/**
@@ -3720,9 +3723,14 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
try {
GridCacheQueryManager qryMgr = cctx.queries();
- // TODO IGNITE-51.
- if (qryMgr != null)
- qryMgr.store(key.value(cctx, false), null, CU.value(val, cctx, false), null, ver, expireTime);
+ if (qryMgr != null) {
+ qryMgr.store(key.value(cctx.cacheObjectContext(), false),
+ null,
+ CU.value(val, cctx, false),
+ null,
+ ver,
+ expireTime);
+ }
}
catch (IgniteCheckedException e) {
throw new GridCacheIndexUpdateException(e);
@@ -3741,9 +3749,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
try {
GridCacheQueryManager<?, ?> qryMgr = cctx.queries();
- // TODO IGNITE-51.
if (qryMgr != null)
- qryMgr.remove(key().value(cctx, false));
+ qryMgr.remove(key().value(cctx.cacheObjectContext(), false));
}
catch (IgniteCheckedException e) {
throw new GridCacheIndexUpdateException(e);
@@ -3782,7 +3789,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
else
val = rawGetOrUnmarshal(false);
- return new CacheEntryImpl<>(key.<K>value(cctx, false), val != null ? val.<V>value(cctx, false) : null);
+ return new CacheEntryImpl<>(key.<K>value(cctx.cacheObjectContext(), false),
+ CU.<V>value(val, cctx, false));
}
catch (GridCacheFilterFailedException ignored) {
throw new IgniteException("Should never happen.");
@@ -3801,7 +3809,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
@Override public <K, V> Cache.Entry<K, V> wrapFilterLocked() throws IgniteCheckedException {
CacheObject val = rawGetOrUnmarshal(true);
- return new CacheEntryImpl<>(key.<K>value(cctx, false), val != null ? val.<V>value(cctx, false) : null) ;
+ return new CacheEntryImpl<>(key.<K>value(cctx.cacheObjectContext(), false),
+ CU.<V>value(val, cctx, false));
}
/** {@inheritDoc} */
@@ -3811,7 +3820,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
/** {@inheritDoc} */
@Override public synchronized <K, V> CacheVersionedEntryImpl<K, V> wrapVersioned() {
- return new CacheVersionedEntryImpl<>(key.<K>value(cctx, false), null, ver);
+ return new CacheVersionedEntryImpl<>(key.<K>value(cctx.cacheObjectContext(), false), null, ver);
}
/** {@inheritDoc} */
@@ -3923,7 +3932,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
IgniteUuid valClsLdrId = null;
if (val != null)
- valClsLdrId = cctx.deploy().getClassLoaderId(U.detectObjectClassLoader(val.value(cctx, false)));
+ valClsLdrId = cctx.deploy().getClassLoaderId(
+ U.detectObjectClassLoader(val.value(cctx.cacheObjectContext(), false)));
IgniteBiTuple<byte[], Boolean> valBytes = valueBytes0();
@@ -3934,7 +3944,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
ver,
ttlExtras(),
expireTimeExtras(),
- cctx.deploy().getClassLoaderId(U.detectObjectClassLoader(key.value(cctx, false))),
+ cctx.deploy().getClassLoaderId(U.detectObjectClassLoader(key.value(cctx.cacheObjectContext(), false))),
valClsLdrId);
}
@@ -4339,7 +4349,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
/** {@inheritDoc} */
@Override public K getKey() {
- return key.value(cctx, false);
+ return key.value(cctx.cacheObjectContext(), false);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
index ec9ca1a..b67ccc6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
@@ -254,7 +254,7 @@ public abstract class GridCacheMessage implements Message {
info.marshal(ctx);
if (ctx.deploymentEnabled()) {
- prepareObject(info.key().value(ctx, false), ctx.shared());
+ prepareObject(info.key().value(ctx.cacheObjectContext(), false), ctx.shared());
prepareObject(CU.value(info.value(), ctx, false), ctx.shared());
}
}
@@ -457,7 +457,7 @@ public abstract class GridCacheMessage implements Message {
obj.prepareMarshal(ctx.cacheObjectContext());
if (depEnabled)
- prepareObject(obj.value(ctx, false), ctx.shared());
+ prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx.shared());
}
}
}
@@ -479,7 +479,7 @@ public abstract class GridCacheMessage implements Message {
obj.prepareMarshal(ctx.cacheObjectContext());
if (depEnabled)
- prepareObject(obj.value(ctx, false), ctx.shared());
+ prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx.shared());
}
}
}
@@ -505,7 +505,7 @@ public abstract class GridCacheMessage implements Message {
CacheObject obj = col.get(i);
if (obj != null)
- obj.finishUnmarshal(ctx, ldr);
+ obj.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
}
@@ -525,7 +525,7 @@ public abstract class GridCacheMessage implements Message {
for (CacheObject obj : col) {
if (obj != null)
- obj.finishUnmarshal(ctx, ldr);
+ obj.finishUnmarshal(ctx.cacheObjectContext(), ldr);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index d88f83b..122281c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -122,7 +122,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If configuration is not valid.
*/
@SuppressWarnings("unchecked")
- private void initialize(CacheConfiguration cfg) throws IgniteCheckedException {
+ private void initialize(CacheConfiguration cfg, CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
if (cfg.getCacheMode() == null)
cfg.setCacheMode(DFLT_CACHE_MODE);
@@ -164,7 +164,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
cfg.setBackups(Integer.MAX_VALUE);
if (cfg.getAffinityMapper() == null)
- cfg.setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
+ cfg.setAffinityMapper(cacheObjCtx.defaultAffMapper());
ctx.igfsHelper().preProcessCacheConfiguration(cfg);
@@ -580,8 +580,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
for (int i = 0; i < cfgs.length; i++) {
CacheConfiguration<?, ?> cfg = new CacheConfiguration(cfgs[i]);
+ CacheObjectContext cacheObjCtx = ctx.portable().contextForCache(null, cfg.getName());
+
// Initialize defaults.
- initialize(cfg);
+ initialize(cfg, cacheObjCtx);
CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
@@ -599,6 +601,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
toPrepare.add(jta.tmLookup());
toPrepare.add(cfgStore);
+ toPrepare.add(cfg.getAffinityMapper());
+
+ if (cfg.getAffinityMapper() != cacheObjCtx.defaultAffMapper())
+ toPrepare.add(cacheObjCtx.defaultAffMapper());
if (cfgStore instanceof GridCacheLoaderWriterStore) {
toPrepare.add(((GridCacheLoaderWriterStore)cfgStore).loader());
@@ -609,17 +615,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
U.startLifecycleAware(lifecycleAwares(cfg, jta.tmLookup(), cfgStore));
- // Init default key mapper.
- CacheAffinityKeyMapper dfltAffMapper;
-
- if (cfg.getAffinityMapper().getClass().equals(GridCacheDefaultAffinityKeyMapper.class))
- dfltAffMapper = cfg.getAffinityMapper();
- else {
- dfltAffMapper = new GridCacheDefaultAffinityKeyMapper();
-
- prepare(cfg, dfltAffMapper, false);
- }
-
cfgs[i] = cfg; // Replace original configuration value.
GridCacheAffinityManager affMgr = new GridCacheAffinityManager();
@@ -657,7 +652,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
drMgr,
jta);
- cacheCtx.defaultAffMapper(dfltAffMapper);
+ cacheCtx.cacheObjectContext(cacheObjCtx);
GridCacheAdapter cache = null;
@@ -797,7 +792,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
drMgr,
jta);
- cacheCtx.defaultAffMapper(dfltAffMapper);
+ cacheCtx.cacheObjectContext(cacheObjCtx);
GridDhtCacheAdapter dht = null;
@@ -1492,7 +1487,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
try {
KeyCacheObject key = cctx.toCacheKeyObject(null, keyBytes, false);
- qryMgr.remove(key.value(cctx, false));
+ qryMgr.remove(key.value(cctx.cacheObjectContext(), false));
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to unmarshal key evicted from swap [swapSpaceName=" + spaceName + ']', e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
index 0933c48..a6dd765 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
@@ -266,7 +266,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
// Never load internal keys from store as they are never persisted.
return null;
- Object storeKey = key.value(cctx, false);
+ Object storeKey = key.value(cctx.cacheObjectContext(), false);
if (convertPortable)
storeKey = cctx.unwrapPortableIfNeeded(storeKey, false);
@@ -411,14 +411,14 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
if (convertPortable) {
keys0 = F.viewReadOnly(keys, new C1<KeyCacheObject, Object>() {
@Override public Object apply(KeyCacheObject key) {
- return cctx.unwrapPortableIfNeeded(key.value(cctx, false), false);
+ return cctx.unwrapPortableIfNeeded(key.value(cctx.cacheObjectContext(), false), false);
}
});
}
else {
keys0 = F.viewReadOnly(keys, new C1<KeyCacheObject, Object>() {
@Override public Object apply(KeyCacheObject key) {
- return key.value(cctx, false);
+ return key.value(cctx.cacheObjectContext(), false);
}
});
}
@@ -561,8 +561,8 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
if (key.internal())
return true;
- Object storeKey = key.value(cctx, false);
- Object storeVal = val.value(cctx, false);
+ Object storeKey = key.value(cctx.cacheObjectContext(), false);
+ Object storeVal = val.value(cctx.cacheObjectContext(), false);
if (convertPortable) {
storeKey = cctx.unwrapPortableIfNeeded(storeKey, false);
@@ -677,7 +677,7 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
if (key.internal())
return false;
- Object storeKey = key.value(cctx, false);
+ Object storeKey = key.value(cctx.cacheObjectContext(), false);
if (convertPortable)
storeKey = cctx.unwrapPortableIfNeeded(storeKey, false);
@@ -737,14 +737,14 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
if (convertPortable) {
keys0 = F.viewReadOnly(keys, new C1<KeyCacheObject, Object>() {
@Override public Object apply(KeyCacheObject key) {
- return cctx.unwrapPortableIfNeeded(key.value(cctx, false), false);
+ return cctx.unwrapPortableIfNeeded(key.value(cctx.cacheObjectContext(), false), false);
}
});
}
else {
keys0 = F.viewReadOnly(keys, new C1<KeyCacheObject, Object>() {
@Override public Object apply(KeyCacheObject key) {
- return key.value(cctx, false);
+ return key.value(cctx.cacheObjectContext(), false);
}
});
}
@@ -1053,8 +1053,8 @@ public class GridCacheStoreManager extends GridCacheManagerAdapter {
if (rmvd != null && rmvd.contains(k))
continue;
- Object storeKey = e.getKey().value(cctx, false);
- Object storeVal = e.getValue().get1().value(cctx, false);
+ Object storeKey = e.getKey().value(cctx.cacheObjectContext(), false);
+ Object storeVal = CU.value(e.getValue().get1(), cctx, false);
if (convertPortable) {
storeKey = cctx.unwrapPortableIfNeeded(storeKey, false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 6d1ae6f..36d33ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -458,14 +458,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First check off-heap store.
if (offheapEnabled)
- if (offheap.contains(spaceName, part, key, key.valueBytes(cctx)))
+ if (offheap.contains(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext())))
return true;
if (swapEnabled) {
assert key != null;
byte[] valBytes = swapMgr.read(spaceName,
- new SwapKey(key.value(cctx, false), part, key.valueBytes(cctx)),
+ new SwapKey(key.value(cctx.cacheObjectContext(), false), part, key.valueBytes(cctx.cacheObjectContext())),
cctx.deploy().globalLoader());
return valBytes != null;
@@ -523,7 +523,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
assert key != null;
byte[] bytes = swapMgr.read(spaceName,
- new SwapKey(key.value(cctx, false), part, keyBytes),
+ new SwapKey(key.value(cctx.cacheObjectContext(), false), part, keyBytes),
cctx.deploy().globalLoader());
if (bytes == null && lsnr != null)
@@ -554,7 +554,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First try removing from offheap.
if (offheapEnabled) {
- byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx));
+ byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
if (entryBytes != null) {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
@@ -608,7 +608,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
final GridTuple<GridCacheSwapEntry> t = F.t1();
final GridTuple<IgniteCheckedException> err = F.t1();
- swapMgr.remove(spaceName, new SwapKey(key.value(cctx, false), part, key.valueBytes(cctx)), new CI1<byte[]>() {
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
+ part,
+ key.valueBytes(cctx.cacheObjectContext()));
+
+ swapMgr.remove(spaceName, swapKey, new CI1<byte[]>() {
@Override public void apply(byte[] rmv) {
if (rmv != null) {
try {
@@ -678,7 +682,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
return null;
return read(entry.key(),
- entry.key().valueBytes(cctx),
+ entry.key().valueBytes(cctx.cacheObjectContext()),
entry.partition(),
locked,
readOffheap,
@@ -698,7 +702,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- IgniteBiTuple<Long, Integer> ptr = offheap.valuePointer(spaceName, part, key, key.valueBytes(cctx));
+ IgniteBiTuple<Long, Integer> ptr =
+ offheap.valuePointer(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
if (ptr != null) {
assert ptr.get1() != null;
@@ -727,7 +732,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- return read(key, key.valueBytes(cctx), part, false, readOffheap, readSwap);
+ return read(key, key.valueBytes(cctx.cacheObjectContext()), part, false, readOffheap, readSwap);
}
/**
@@ -764,7 +769,8 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
for (KeyCacheObject key : keys) {
int part = cctx.affinity().partition(key);
- byte[] entryBytes = offheap.remove(spaceName, part, key, key.valueBytes(cctx));
+ byte[] entryBytes =
+ offheap.remove(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
if (entryBytes != null) {
GridCacheSwapEntry entry = swapEntry(unmarshalSwapEntry(entryBytes));
@@ -801,9 +807,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
if (unprocessedKeys == null)
unprocessedKeys = new ArrayList<>(keys.size());
- SwapKey swapKey = new SwapKey(key.value(cctx, false),
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
cctx.affinity().partition(key),
- key.valueBytes(cctx));
+ key.valueBytes(cctx.cacheObjectContext()));
unprocessedKeys.add(swapKey);
}
@@ -816,9 +822,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
unprocessedKeys = new ArrayList<>(keys.size());
for (KeyCacheObject key : keys) {
- SwapKey swapKey = new SwapKey(key.value(cctx, false),
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
cctx.affinity().partition(key),
- key.valueBytes(cctx));
+ key.valueBytes(cctx.cacheObjectContext()));
unprocessedKeys.add(swapKey);
}
@@ -906,7 +912,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- return offheap.removex(spaceName, part, key, key.valueBytes(cctx));
+ return offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
/**
@@ -930,7 +936,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.enableEviction(spaceName, part, key, key.valueBytes(cctx));
+ offheap.enableEviction(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
/**
@@ -968,7 +974,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
// First try offheap.
if (offheapEnabled) {
- byte[] val = offheap.remove(spaceName, part, key.value(cctx, false), key.valueBytes(cctx));
+ byte[] val = offheap.remove(spaceName,
+ part,
+ key.value(cctx.cacheObjectContext(), false),
+ key.valueBytes(cctx.cacheObjectContext()));
if (val != null) {
if (c != null)
@@ -979,8 +988,12 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
if (swapEnabled) {
+ SwapKey swapKey = new SwapKey(key.value(cctx.cacheObjectContext(), false),
+ part,
+ key.valueBytes(cctx.cacheObjectContext()));
+
swapMgr.remove(spaceName,
- new SwapKey(key.value(cctx, false), part, key.valueBytes(cctx)),
+ swapKey,
c,
cctx.deploy().globalLoader());
}
@@ -1024,7 +1037,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
valClsLdrId);
if (offheapEnabled) {
- offheap.put(spaceName, part, key, key.valueBytes(cctx), entry.marshal());
+ offheap.put(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()), entry.marshal());
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_TO_OFFHEAP))
cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null, null,
@@ -1057,7 +1070,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
offheap.put(spaceName,
swapEntry.partition(),
swapEntry.key(),
- swapEntry.key().valueBytes(cctx),
+ swapEntry.key().valueBytes(cctx.cacheObjectContext()),
swapEntry.marshal());
if (cctx.events().isRecordable(EVT_CACHE_OBJECT_TO_OFFHEAP))
@@ -1072,9 +1085,9 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
Map<SwapKey, byte[]> batch = new LinkedHashMap<>();
for (GridCacheBatchSwapEntry entry : swapped) {
- SwapKey swapKey = new SwapKey(entry.key().value(cctx, false),
+ SwapKey swapKey = new SwapKey(entry.key().value(cctx.cacheObjectContext(), false),
entry.partition(),
- entry.key().valueBytes(cctx));
+ entry.key().valueBytes(cctx.cacheObjectContext()));
batch.put(swapKey, entry.marshal());
}
@@ -1109,7 +1122,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
checkIteratorQueue();
swapMgr.write(spaceName,
- new SwapKey(key.value(cctx, false), part, key.valueBytes(cctx)),
+ new SwapKey(key.value(cctx.cacheObjectContext(), false), part, key.valueBytes(cctx.cacheObjectContext())),
entry,
cctx.deploy().globalLoader());
@@ -1295,7 +1308,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.removex(spaceName, part, key, key.valueBytes(cctx));
+ offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
else
it.removeX();
@@ -1421,7 +1434,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
try {
KeyCacheObject key = cctx.toCacheKeyObject(null, cur0.getKey(), false);
- return key.value(cctx, false);
+ return key.value(cctx.cacheObjectContext(), false);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -1434,7 +1447,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
swapEntry(e);
- return e.value().value(cctx, false);
+ return e.value().value(cctx.cacheObjectContext(), false);
}
catch (IgniteCheckedException ex) {
throw new IgniteException(ex);
@@ -1615,7 +1628,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
int part = cctx.affinity().partition(key);
- offheap.removex(spaceName, part, key, key.valueBytes(cctx));
+ offheap.removex(spaceName, part, key, key.valueBytes(cctx.cacheObjectContext()));
}
@Override protected void onClose() throws IgniteCheckedException {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index e4243ab..7700fa4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -906,7 +906,7 @@ public class GridCacheUtils {
return val != null &&
valType.isAssignableFrom(val.getClass()) &&
- keyType.isAssignableFrom(e.key().value(e.context(), false).getClass());
+ keyType.isAssignableFrom(e.key().value(e.context().cacheObjectContext(), false).getClass());
}
catch (IgniteCheckedException err) {
throw new IgniteException(err);
@@ -1825,7 +1825,7 @@ public class GridCacheUtils {
) {
return new CacheEntryPredicateAdapter() {
@Override public boolean apply(GridCacheEntryEx e) {
- return aff.isPrimary(n, e.key().value(e.context(), false));
+ return aff.isPrimary(n, e.key().value(e.context().cacheObjectContext(), false));
}
};
}
@@ -1870,9 +1870,10 @@ public class GridCacheUtils {
/**
* @param cacheObj Cache object.
* @param ctx Cache context.
+ * @param cpy Copy flag.
* @return Cache object value.
*/
@Nullable public static <T> T value(@Nullable CacheObject cacheObj, GridCacheContext ctx, boolean cpy) {
- return cacheObj != null ? cacheObj.<T>value(ctx, cpy) : null;
+ return cacheObj != null ? cacheObj.<T>value(ctx.cacheObjectContext(), cpy) : null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
index 981da1f..91958a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
@@ -65,7 +65,7 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
}
/** {@inheritDoc} */
- @Override public byte[] valueBytes(GridCacheContext ctx) throws IgniteCheckedException {
+ @Override public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException {
assert valBytes != null : this;
return valBytes;
@@ -80,14 +80,14 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
- @Nullable @Override public <T> T value(GridCacheContext ctx, boolean cpy) {
+ @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy) {
cpy = cpy && needCopy(ctx);
if (cpy) {
try {
- return (T)ctx.portable().unmarshal(ctx.cacheObjectContext(),
+ return (T)ctx.processor().unmarshal(ctx,
valBytes,
- ctx.deploy().globalLoader());
+ ctx.kernalContext().config().getClassLoader());
}
catch (IgniteCheckedException e) {
throw new IgniteException("Failed to unmarshal object.", e);
@@ -98,7 +98,7 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
}
/** {@inheritDoc} */
- @Override public CacheObject prepareForCache(GridCacheContext ctx) {
+ @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
return this;
}
@@ -170,11 +170,11 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
}
/** {@inheritDoc} */
- @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
+ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException {
if (val == null) {
assert valBytes != null;
- val = ctx.kernalContext().portable().unmarshal(ctx.cacheObjectContext(), valBytes, ldr);
+ val = ctx.kernalContext().portable().unmarshal(ctx, valBytes, ldr);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectTransferImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectTransferImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectTransferImpl.java
index 267b957..b243e62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectTransferImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectTransferImpl.java
@@ -45,7 +45,7 @@ public class KeyCacheObjectTransferImpl implements KeyCacheObject {
}
/** {@inheritDoc} */
- @Nullable @Override public <T> T value(GridCacheContext ctx, boolean cpy) {
+ @Nullable @Override public <T> T value(CacheObjectContext ctx, boolean cpy) {
throw new IllegalStateException();
}
@@ -65,17 +65,17 @@ public class KeyCacheObjectTransferImpl implements KeyCacheObject {
}
/** {@inheritDoc} */
- @Override public byte[] valueBytes(GridCacheContext ctx) throws IgniteCheckedException {
+ @Override public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException {
throw new IllegalStateException();
}
/** {@inheritDoc} */
- @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
+ @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException {
throw new IllegalStateException();
}
/** {@inheritDoc} */
- @Override public CacheObject prepareForCache(GridCacheContext ctx) {
+ @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
throw new IllegalStateException();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
index 41d47db..4c38f18 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
@@ -41,7 +41,7 @@ public class UserCacheObjectImpl extends CacheObjectImpl {
}
/** {@inheritDoc} */
- @Override public CacheObject prepareForCache(GridCacheContext ctx) {
+ @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
if (needCopy(ctx)) {
if (val instanceof byte[]) {
byte[] byteArr = (byte[])val;
@@ -51,7 +51,7 @@ public class UserCacheObjectImpl extends CacheObjectImpl {
else {
try {
if (valBytes == null)
- valBytes = ctx.portable().marshal(ctx.cacheObjectContext(), val);
+ valBytes = ctx.processor().marshal(ctx, val);
return new CacheObjectImpl(null, valBytes);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b876320e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserKeyCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserKeyCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserKeyCacheObjectImpl.java
index eb5d748..d052f94 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserKeyCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserKeyCacheObjectImpl.java
@@ -40,23 +40,23 @@ public class UserKeyCacheObjectImpl extends KeyCacheObjectImpl {
}
/** {@inheritDoc} */
- @Override public byte[] valueBytes(GridCacheContext ctx) throws IgniteCheckedException {
+ @Override public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException {
if (valBytes == null)
- valBytes = ctx.portable().marshal(ctx.cacheObjectContext(), val);
+ valBytes = ctx.processor().marshal(ctx, val);
return valBytes;
}
/** {@inheritDoc} */
- @Override public CacheObject prepareForCache(GridCacheContext ctx) {
+ @Override public CacheObject prepareForCache(CacheObjectContext ctx) {
try {
if (valBytes == null)
- valBytes = ctx.portable().marshal(ctx.cacheObjectContext(), val);
+ valBytes = ctx.processor().marshal(ctx, val);
if (needCopy(ctx)) {
- Object val = ctx.portable().unmarshal(ctx.cacheObjectContext(),
+ Object val = ctx.processor().unmarshal(ctx,
valBytes,
- ctx.deploy().globalLoader());
+ ctx.kernalContext().config().getClassLoader());
return new KeyCacheObjectImpl(val, valBytes);
}
[12/16] incubator-ignite git commit: # IGNITE-70 remove "todo
IGNITE-70".
Posted by sb...@apache.org.
# IGNITE-70 remove "todo IGNITE-70".
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d6cf7b46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d6cf7b46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d6cf7b46
Branch: refs/heads/ignite-51
Commit: d6cf7b4626c41b744493454b0531c24db93a64ae
Parents: 9b2a034
Author: sevdokimov <se...@gridgain.com>
Authored: Wed Mar 4 19:57:37 2015 +0300
Committer: sevdokimov <se...@gridgain.com>
Committed: Wed Mar 4 19:57:37 2015 +0300
----------------------------------------------------------------------
.../internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java | 3 +--
.../apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java | 2 +-
.../external/communication/GridHadoopExternalCommunication.java | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d6cf7b46/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
index 865886c..8c2fcb0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
@@ -42,8 +42,7 @@ import java.util.concurrent.atomic.*;
*/
public class IpcSharedMemoryServerEndpoint implements IpcServerEndpoint {
/** IPC error message. */
- public static final String OUT_OF_RESOURCES_MSG = "Failed to allocate shared memory segment"; // todo IGNITE-70 Add
- // link to documentation
+ public static final String OUT_OF_RESOURCES_MSG = "Failed to allocate shared memory segment";
/** Default endpoint port number. */
public static final int DFLT_IPC_PORT = 10500;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d6cf7b46/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 19fe5c5..cadd75c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -147,7 +147,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
implements CommunicationSpi<Message>, TcpCommunicationSpiMBean {
/** IPC error message. */
public static final String OUT_OF_RESOURCES_TCP_MSG = "Failed to allocate shared memory segment " +
- "(switching to TCP, may be slower)."; // todo IGNITE-70 Add link to documentation
+ "(switching to TCP, may be slower).";
/** Node attribute that is mapped to node IP addresses (value is <tt>comm.tcp.addrs</tt>). */
public static final String ATTR_ADDRS = "comm.tcp.addrs";
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d6cf7b46/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/GridHadoopExternalCommunication.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/GridHadoopExternalCommunication.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/GridHadoopExternalCommunication.java
index f5ddced..e3457a9 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/GridHadoopExternalCommunication.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/GridHadoopExternalCommunication.java
@@ -45,7 +45,7 @@ import java.util.concurrent.*;
public class GridHadoopExternalCommunication {
/** IPC error message. */
public static final String OUT_OF_RESOURCES_TCP_MSG = "Failed to allocate shared memory segment " +
- "(switching to TCP, may be slower)."; // TODO IGNITE-70 Add link to documentation
+ "(switching to TCP, may be slower).";
/** Default port which node sets listener to (value is <tt>47100</tt>). */
public static final int DFLT_PORT = 27100;
[04/16] incubator-ignite git commit: Merge branches 'ignite-344' and
'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
sprint-2
Posted by sb...@apache.org.
Merge branches 'ignite-344' and 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into sprint-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4dd565e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4dd565e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4dd565e2
Branch: refs/heads/ignite-51
Commit: 4dd565e22911b218234d0bd703495d845b11674c
Parents: 656ee47 5b0d7db
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Mar 4 16:34:37 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Mar 4 16:34:37 2015 +0700
----------------------------------------------------------------------
.../visor/cache/VisorCacheClearTask.java | 3 +-
.../visor/cache/VisorCacheLoadTask.java | 3 +-
.../scala/org/apache/ignite/visor/Packet.scala | 38 ------
.../ignite/visor/commands/VisorConsole.scala | 2 -
.../ignite/visor/commands/ack/Packet.scala | 55 --------
.../visor/commands/ack/VisorAckCommand.scala | 2 +-
.../ignite/visor/commands/alert/Packet.scala | 108 ----------------
.../ignite/visor/commands/cache/Packet.scala | 127 -------------------
.../commands/cache/VisorCacheCommand.scala | 2 +-
.../ignite/visor/commands/config/Packet.scala | 55 --------
.../ignite/visor/commands/deploy/Packet.scala | 76 -----------
.../ignite/visor/commands/disco/Packet.scala | 72 -----------
.../ignite/visor/commands/events/Packet.scala | 97 --------------
.../ignite/visor/commands/gc/Packet.scala | 61 ---------
.../ignite/visor/commands/kill/Packet.scala | 78 ------------
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
.../ignite/visor/commands/node/Packet.scala | 60 ---------
.../ignite/visor/commands/ping/Packet.scala | 50 --------
.../visor/commands/ping/VisorPingCommand.scala | 2 +-
.../ignite/visor/commands/start/Packet.scala | 90 -------------
.../ignite/visor/commands/tasks/Packet.scala | 116 -----------------
.../commands/tasks/VisorTasksCommand.scala | 26 +---
.../ignite/visor/commands/top/Packet.scala | 87 -------------
.../ignite/visor/commands/vvm/Packet.scala | 61 ---------
24 files changed, 15 insertions(+), 1258 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4dd565e2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4dd565e2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
[06/16] incubator-ignite git commit: # sprint-2 Fixed typo in snippet
generator.
Posted by sb...@apache.org.
# sprint-2 Fixed typo in snippet generator.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e7f7f57d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e7f7f57d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e7f7f57d
Branch: refs/heads/ignite-51
Commit: e7f7f57d47305ad0c476f91ddcc1a748e17a7e7f
Parents: 5d2a7c6
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Mar 4 21:44:27 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Mar 4 21:44:27 2015 +0700
----------------------------------------------------------------------
.../java/org/apache/ignite/schema/generator/SnippetGenerator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e7f7f57d/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/SnippetGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/SnippetGenerator.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/SnippetGenerator.java
index e54c019..4abd5a6 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/SnippetGenerator.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/generator/SnippetGenerator.java
@@ -113,7 +113,7 @@ public class SnippetGenerator {
src.add("// Key fields for " + tbl + ".");
src.add((first ? "Collection<CacheTypeFieldMetadata> " : "") + "keys = new ArrayList<>();");
- addFields(src, "keys", pojo.valueFields(includeKeys));
+ addFields(src, "keys", pojo.keyFields());
src.add("type.setKeyFields(keys);");
src.add("");
[11/16] incubator-ignite git commit: Merge remote-tracking branch
'origin/sprint-2' into sprint-2
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/sprint-2' into sprint-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9b2a034d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9b2a034d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9b2a034d
Branch: refs/heads/ignite-51
Commit: 9b2a034d5fd1a8c56701fbce99937b0b707927dc
Parents: ff5173d 9af2566
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Mar 4 18:20:10 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Mar 4 18:20:10 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/igfs/IgfsEx.java | 6 +
.../visor/node/VisorIgfsConfiguration.java | 7 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 44 +-
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 48 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 54 +-
.../hadoop/SecondaryFileSystemProvider.java | 111 ++++
...oopSecondaryFileSystemConfigurationTest.java | 541 +++++++++++++++++++
.../testsuites/IgniteHadoopTestSuite.java | 2 +
.../schema/generator/SnippetGenerator.java | 2 +-
.../schema/parser/DatabaseMetadataParser.java | 7 +-
10 files changed, 718 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
[02/16] incubator-ignite git commit: Merge branches 'ignite-344' and
'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-344
Posted by sb...@apache.org.
Merge branches 'ignite-344' and 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-344
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5b0d7db7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5b0d7db7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5b0d7db7
Branch: refs/heads/ignite-51
Commit: 5b0d7db77cdbca9c2d33b3c64f567f61faec8a8f
Parents: 4348d9c b81c6a2
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Mar 3 15:34:35 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Mar 3 15:34:35 2015 +0700
----------------------------------------------------------------------
config/hadoop/default-config.xml | 12 +
config/ignite-log4j.xml | 2 +-
examples/pom-standalone.xml | 2 +-
.../datagrid/CacheContinuousQueryExample.java | 2 +-
.../store/CacheNodeWithStoreStartup.java | 6 +-
.../store/jdbc/CacheJdbcPersonStore.java | 115 +-
ipc/shmem/Makefile.am | 15 +
ipc/shmem/igniteshmem/Makefile.am | 15 +
ipc/shmem/include/Makefile.am | 15 +
modules/clients/src/test/keystore/generate.sh | 15 +-
.../src/main/java/org/apache/ignite/Ignite.java | 4 +-
.../java/org/apache/ignite/IgniteCluster.java | 8 +-
.../ignite/cache/CacheTypeFieldMetadata.java | 2 +-
.../apache/ignite/cache/CacheTypeMetadata.java | 18 +-
.../ignite/cache/query/ContinuousQuery.java | 18 +-
.../apache/ignite/cache/store/CacheStore.java | 4 +-
.../ignite/cache/store/CacheStoreAdapter.java | 2 +-
.../ignite/cache/store/CacheStoreSession.java | 17 +-
.../apache/ignite/cluster/ClusterMetrics.java | 2 +-
.../configuration/IgniteConfiguration.java | 5 +-
.../configuration/QueryConfiguration.java | 37 +-
.../java/org/apache/ignite/igfs/IgfsMode.java | 6 +-
.../ignite/internal/GridKernalContext.java | 10 +-
.../ignite/internal/GridKernalContextImpl.java | 14 +-
.../apache/ignite/internal/GridProperties.java | 78 -
.../ignite/internal/GridUpdateNotifier.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 41 +-
.../ignite/internal/IgniteProperties.java | 79 +
.../ignite/internal/IgniteVersionUtils.java | 8 +-
.../org/apache/ignite/internal/IgnitionEx.java | 592 +++----
.../internal/events/DiscoveryCustomEvent.java | 3 +
.../affinity/GridAffinityAssignmentCache.java | 13 +-
.../processors/cache/CacheMetricsImpl.java | 4 +
.../processors/cache/GridCacheContext.java | 19 +
.../processors/cache/GridCacheMapEntry.java | 9 +
.../processors/cache/GridCacheProcessor.java | 15 +
.../processors/cache/GridCacheStoreManager.java | 18 +-
.../processors/cache/IgniteCacheProxy.java | 6 +-
.../GridDistributedCacheAdapter.java | 2 +
.../distributed/dht/GridDhtCacheEntry.java | 3 +
.../distributed/dht/GridDhtLocalPartition.java | 5 +
.../dht/atomic/GridDhtAtomicCache.java | 2 +-
.../dht/colocated/GridDhtColocatedCache.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 7 +-
.../processors/cluster/ClusterProcessor.java | 46 +
.../dataload/IgniteDataLoaderImpl.java | 29 +-
.../plugin/IgnitePluginProcessor.java | 24 +
.../ignite/internal/util/IgniteUtils.java | 90 +-
.../ignite/internal/visor/cache/VisorCache.java | 190 +--
.../cache/VisorCacheAffinityConfiguration.java | 53 +-
.../visor/cache/VisorCacheConfiguration.java | 484 +-----
.../cache/VisorCacheDefaultConfiguration.java | 27 +-
.../cache/VisorCacheEvictionConfiguration.java | 81 +-
.../cache/VisorCacheNearConfiguration.java | 42 +-
.../cache/VisorCachePreloadConfiguration.java | 54 +-
.../cache/VisorCacheStoreConfiguration.java | 148 +-
.../VisorCacheWriteBehindConfiguration.java | 137 --
.../visor/node/VisorAtomicConfiguration.java | 27 +-
.../visor/node/VisorBasicConfiguration.java | 197 +--
.../node/VisorCacheQueryConfiguration.java | 45 +-
.../node/VisorExecutorServiceConfiguration.java | 54 +-
.../visor/node/VisorGridConfiguration.java | 177 +-
.../visor/node/VisorIgfsConfiguration.java | 244 +--
.../visor/node/VisorLifecycleConfiguration.java | 9 +-
.../visor/node/VisorMetricsConfiguration.java | 29 +-
.../node/VisorPeerToPeerConfiguration.java | 28 +-
.../visor/node/VisorQueryConfiguration.java | 65 +-
.../visor/node/VisorRestConfiguration.java | 80 +-
.../node/VisorSegmentationConfiguration.java | 45 +-
.../visor/node/VisorSpisConfiguration.java | 92 +-
.../node/VisorTransactionConfiguration.java | 62 +-
.../internal/visor/util/VisorTaskUtils.java | 4 +-
.../optimized-classnames.previous.properties | 15 +
.../optimized/optimized-classnames.properties | 1565 +-----------------
.../apache/ignite/plugin/PluginProvider.java | 5 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 137 +-
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 116 ++
.../TcpDiscoveryCustomEventMessage.java | 3 +
.../core/src/main/resources/ignite.properties | 2 +-
.../core/src/test/config/store/jdbc/Ignite.xml | 63 +-
.../internal/GridUpdateNotifierSelfTest.java | 2 +-
.../GridCacheAbstractLocalStoreSelfTest.java | 440 +++++
.../cache/GridCacheAbstractMetricsSelfTest.java | 42 +
...acheAbstractUsersAffinityMapperSelfTest.java | 207 +++
...dCacheAtomicUsersAffinityMapperSelfTest.java | 45 +
.../GridCachePartitionedLocalStoreSelfTest.java | 51 +
...chePartitionedOffHeapLocalStoreSelfTest.java | 56 +
.../GridCacheReplicatedLocalStoreSelfTest.java | 51 +
...heReplicatedUsersAffinityMapperSelfTest.java | 45 +
...ridCacheTxPartitionedLocalStoreSelfTest.java | 51 +
.../GridCacheTxUsersAffinityMapperSelfTest.java | 45 +
.../GridCacheQueueCleanupSelfTest.java | 1 -
.../IgniteCacheExpiryPolicyAbstractTest.java | 38 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 8 +-
.../config/GridTestProperties.java | 10 +-
.../junits/cache/TestCacheSession.java | 5 +
.../cache/TestThreadLocalCacheSession.java | 5 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +
modules/extdata/p2p/pom.xml | 6 -
.../client/hadoop/GridHadoopClientProtocol.java | 6 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 412 +++++
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 3 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 3 +-
.../igfs/hadoop/IgfsHadoopFSProperties.java | 10 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 413 -----
.../internal/igfs/hadoop/IgfsHadoopReader.java | 2 +-
.../internal/igfs/hadoop/IgfsHadoopUtils.java | 4 +-
.../hadoop/GridHadoopClassLoader.java | 12 +-
.../processors/hadoop/GridHadoopSetup.java | 8 +-
.../processors/hadoop/GridHadoopUtils.java | 4 +-
.../collections/GridHadoopHashMultimapBase.java | 2 +-
.../GridHadoopExternalCommunication.java | 14 +-
.../hadoop/v1/GridHadoopV1MapTask.java | 6 +-
.../v2/GridHadoopV2JobResourceManager.java | 2 +-
.../GridHadoopClientProtocolSelfTest.java | 6 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 2 +-
.../IgfsHadoop20FileSystemAbstractSelfTest.java | 2 +-
.../igfs/IgfsHadoopDualAbstractSelfTest.java | 2 +-
.../IgfsHadoopFileSystemAbstractSelfTest.java | 1 +
...fsHadoopFileSystemSecondaryModeSelfTest.java | 2 +-
.../hadoop/GridHadoopGroupingTest.java | 4 +-
.../igfs/IgfsPerformanceBenchmark.java | 9 +-
modules/hibernate/pom.xml | 6 -
.../HibernateReadWriteAccessStrategy.java | 81 +-
modules/indexing/pom.xml | 6 -
modules/jta/pom.xml | 6 -
modules/scalar/pom.xml | 12 +-
.../ignite/schema/generator/PojoGenerator.java | 3 +-
.../schema/generator/SnippetGenerator.java | 138 ++
.../ignite/schema/generator/XmlGenerator.java | 8 +-
.../apache/ignite/schema/model/PojoField.java | 11 +-
.../apache/ignite/schema/ui/SchemaLoadApp.java | 2 +
.../apache/ignite/schema/load/model/Ignite.xml | 133 +-
modules/spring/pom.xml | 6 -
modules/visor-console/pom.xml | 7 -
.../commands/alert/VisorAlertCommand.scala | 8 +-
.../commands/cache/VisorCacheCommand.scala | 116 +-
.../commands/cache/VisorCacheScanCommand.scala | 7 +-
.../config/VisorConfigurationCommand.scala | 141 +-
.../commands/disco/VisorDiscoveryCommand.scala | 2 +-
.../visor/commands/node/VisorNodeCommand.scala | 6 +-
.../scala/org/apache/ignite/visor/visor.scala | 89 +-
.../commands/tasks/VisorTasksCommandSpec.scala | 2 +-
modules/web/pom.xml | 6 -
modules/winservice/IgniteService.sln | 2 +-
.../IgniteService/IgniteService.csproj | 2 +-
.../config/benchmark-atomic-win.properties | 15 +
.../config/benchmark-atomic.properties | 15 +
.../config/benchmark-compute-win.properties | 15 +
.../config/benchmark-compute.properties | 15 +
.../config/benchmark-multicast.properties | 15 +
.../config/benchmark-query-win.properties | 15 +
.../yardstick/config/benchmark-query.properties | 15 +
.../config/benchmark-tx-win.properties | 15 +
.../yardstick/config/benchmark-tx.properties | 15 +
.../yardstick/config/benchmark-win.properties | 15 +
modules/yardstick/config/benchmark.properties | 15 +
.../yardstick/config/ignite-store-config.xml | 15 +-
pom.xml | 152 +-
159 files changed, 3884 insertions(+), 5012 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b0d7db7/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
[08/16] incubator-ignite git commit: # IGNITE-349: Applied patch from
Ivan V..
Posted by sb...@apache.org.
# IGNITE-349: Applied patch from Ivan V..
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/03b966fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/03b966fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/03b966fe
Branch: refs/heads/ignite-51
Commit: 03b966fe01c341a9ff6dcfcbaddaaa8e7f64ec84
Parents: 5d2a7c6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Mar 4 17:50:53 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Mar 4 17:50:53 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/igfs/IgfsEx.java | 6 +
.../visor/node/VisorIgfsConfiguration.java | 7 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 44 +-
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 48 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 54 +-
.../hadoop/SecondaryFileSystemProvider.java | 111 ++++
...oopSecondaryFileSystemConfigurationTest.java | 541 +++++++++++++++++++
.../testsuites/IgniteHadoopTestSuite.java | 2 +
8 files changed, 712 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
index e067e78..a380a6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
@@ -29,6 +29,12 @@ import java.net.*;
* Internal API extension for {@link org.apache.ignite.IgniteFs}.
*/
public interface IgfsEx extends IgniteFs {
+ /** Property name for path to Hadoop configuration. */
+ String SECONDARY_FS_CONFIG_PATH = "SECONDARY_FS_CONFIG_PATH";
+
+ /** Property name for URI of file system. */
+ String SECONDARY_FS_URI = "SECONDARY_FS_URI";
+
/**
* Stops IGFS cleaning all used resources.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index 056ac7f..78943a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -21,6 +21,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.igfs.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;
+import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
import java.io.*;
import java.util.*;
@@ -31,12 +32,6 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*;
* Data transfer object for IGFS configuration properties.
*/
public class VisorIgfsConfiguration implements Serializable {
- /** Property name for path to Hadoop configuration. */
- public static final String SECONDARY_FS_CONFIG_PATH = "SECONDARY_FS_CONFIG_PATH";
-
- /** Property name for URI of file system. */
- public static final String SECONDARY_FS_URI = "SECONDARY_FS_URI";
-
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/IgfsHadoopFileSystemWrapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/IgfsHadoopFileSystemWrapper.java b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/IgfsHadoopFileSystemWrapper.java
index 29dfde5..bdab61d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/IgfsHadoopFileSystemWrapper.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/IgfsHadoopFileSystemWrapper.java
@@ -17,7 +17,6 @@
package org.apache.ignite.igfs.hadoop;
-import org.apache.hadoop.conf.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.permission.*;
@@ -25,10 +24,11 @@ import org.apache.hadoop.ipc.*;
import org.apache.ignite.*;
import org.apache.ignite.igfs.*;
import org.apache.ignite.internal.igfs.hadoop.*;
+import org.apache.ignite.internal.processors.hadoop.*;
import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;
+import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
import java.io.*;
import java.net.*;
@@ -38,11 +38,6 @@ import java.util.*;
* Adapter to use any Hadoop file system {@link org.apache.hadoop.fs.FileSystem} as {@link org.apache.ignite.igfs.Igfs}.
*/
public class IgfsHadoopFileSystemWrapper implements Igfs, AutoCloseable {
- /** Property name for path to Hadoop configuration. */
- public static final String SECONDARY_FS_CONFIG_PATH = "SECONDARY_FS_CONFIG_PATH";
-
- /** Property name for URI of file system. */
- public static final String SECONDARY_FS_URI = "SECONDARY_FS_URI";
/** Hadoop file system. */
private final FileSystem fileSys;
@@ -51,6 +46,16 @@ public class IgfsHadoopFileSystemWrapper implements Igfs, AutoCloseable {
private final Map<String, String> props = new HashMap<>();
/**
+ * Simple constructor that is to be used by default.
+ *
+ * @param uri URI of file system.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public IgfsHadoopFileSystemWrapper(String uri) throws IgniteCheckedException {
+ this(uri, null);
+ }
+
+ /**
* Constructor.
*
* @param uri URI of file system.
@@ -58,25 +63,22 @@ public class IgfsHadoopFileSystemWrapper implements Igfs, AutoCloseable {
* @throws IgniteCheckedException In case of error.
*/
public IgfsHadoopFileSystemWrapper(@Nullable String uri, @Nullable String cfgPath) throws IgniteCheckedException {
- Configuration cfg = new Configuration();
+ try {
+ SecondaryFileSystemProvider secProvider = new SecondaryFileSystemProvider(uri, cfgPath);
- if (cfgPath != null)
- cfg.addResource(U.resolveIgniteUrl(cfgPath));
+ fileSys = secProvider.createFileSystem();
- try {
- fileSys = uri == null ? FileSystem.get(cfg) : FileSystem.get(new URI(uri), cfg);
+ uri = secProvider.uri().toString();
+
+ if (!uri.endsWith("/"))
+ uri += "/";
+
+ props.put(SECONDARY_FS_CONFIG_PATH, cfgPath);
+ props.put(SECONDARY_FS_URI, uri);
}
- catch (IOException | URISyntaxException e) {
+ catch (IOException e) {
throw new IgniteCheckedException(e);
}
-
- uri = fileSys.getUri().toString();
-
- if (!uri.endsWith("/"))
- uri += "/";
-
- props.put(SECONDARY_FS_CONFIG_PATH, cfgPath);
- props.put(SECONDARY_FS_URI, uri);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v1/IgfsHadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v1/IgfsHadoopFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v1/IgfsHadoopFileSystem.java
index 1648bdc..c4d2f5e 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v1/IgfsHadoopFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v1/IgfsHadoopFileSystem.java
@@ -26,9 +26,9 @@ import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.util.*;
import org.apache.ignite.*;
import org.apache.ignite.igfs.*;
-import org.apache.ignite.igfs.hadoop.*;
import org.apache.ignite.internal.igfs.common.*;
import org.apache.ignite.internal.igfs.hadoop.*;
+import org.apache.ignite.internal.processors.hadoop.*;
import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -44,6 +44,7 @@ import static org.apache.ignite.configuration.IgfsConfiguration.*;
import static org.apache.ignite.igfs.IgfsMode.*;
import static org.apache.ignite.igfs.hadoop.IgfsHadoopParameters.*;
import static org.apache.ignite.internal.igfs.hadoop.IgfsHadoopUtils.*;
+import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
/**
* {@code IGFS} Hadoop 1.x file system driver over file system API. To use
@@ -57,7 +58,7 @@ import static org.apache.ignite.internal.igfs.hadoop.IgfsHadoopUtils.*;
*
* <property>
* <name>fs.igfs.impl</name>
- * <value>org.apache.ignite.igfs.hadoop.IgfsHadoopFileSystem</value>
+ * <value>org.apache.ignite.igfs.hadoop.v1.IgfsHadoopFileSystem</value>
* </property>
* </pre>
* You should also add Ignite JAR and all libraries to Hadoop classpath. To
@@ -271,50 +272,29 @@ public class IgfsHadoopFileSystem extends FileSystem {
boolean initSecondary = paths.defaultMode() == PROXY;
- if (paths.pathModes() != null && !paths.pathModes().isEmpty()) {
+ if (!initSecondary && paths.pathModes() != null && !paths.pathModes().isEmpty()) {
for (T2<IgfsPath, IgfsMode> pathMode : paths.pathModes()) {
IgfsMode mode = pathMode.getValue();
- initSecondary |= mode == PROXY;
+ if (mode == PROXY) {
+ initSecondary = true;
+
+ break;
+ }
}
}
if (initSecondary) {
Map<String, String> props = paths.properties();
- String secUri = props.get(IgfsHadoopFileSystemWrapper.SECONDARY_FS_URI);
- String secConfPath = props.get(IgfsHadoopFileSystemWrapper.SECONDARY_FS_CONFIG_PATH);
-
- if (secConfPath == null)
- throw new IOException("Failed to connect to the secondary file system because configuration " +
- "path is not provided.");
-
- if (secUri == null)
- throw new IOException("Failed to connect to the secondary file system because URI is not " +
- "provided.");
+ String secUri = props.get(SECONDARY_FS_URI);
+ String secConfPath = props.get(SECONDARY_FS_CONFIG_PATH);
try {
- secondaryUri = new URI(secUri);
-
- URL secondaryCfgUrl = U.resolveIgniteUrl(secConfPath);
-
- Configuration conf = new Configuration();
-
- if (secondaryCfgUrl != null)
- conf.addResource(secondaryCfgUrl);
+ SecondaryFileSystemProvider secProvider = new SecondaryFileSystemProvider(secUri, secConfPath);
- String prop = String.format("fs.%s.impl.disable.cache", secondaryUri.getScheme());
-
- conf.setBoolean(prop, true);
-
- secondaryFs = FileSystem.get(secondaryUri, conf);
- }
- catch (URISyntaxException ignore) {
- if (!mgmt)
- throw new IOException("Failed to resolve secondary file system URI: " + secUri);
- else
- LOG.warn("Visor failed to create secondary file system (operations on paths with PROXY mode " +
- "will have no effect).");
+ secondaryFs = secProvider.createFileSystem();
+ secondaryUri = secProvider.uri();
}
catch (IOException e) {
if (!mgmt)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v2/IgfsHadoopFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v2/IgfsHadoopFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v2/IgfsHadoopFileSystem.java
index 5475cf4..0759203 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v2/IgfsHadoopFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/igfs/hadoop/v2/IgfsHadoopFileSystem.java
@@ -26,9 +26,9 @@ import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.util.*;
import org.apache.ignite.*;
import org.apache.ignite.igfs.*;
-import org.apache.ignite.igfs.hadoop.*;
import org.apache.ignite.internal.igfs.common.*;
import org.apache.ignite.internal.igfs.hadoop.*;
+import org.apache.ignite.internal.processors.hadoop.*;
import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -44,6 +44,7 @@ import static org.apache.ignite.configuration.IgfsConfiguration.*;
import static org.apache.ignite.igfs.IgfsMode.*;
import static org.apache.ignite.igfs.hadoop.IgfsHadoopParameters.*;
import static org.apache.ignite.internal.igfs.hadoop.IgfsHadoopUtils.*;
+import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
/**
* {@code IGFS} Hadoop 2.x file system driver over file system API. To use
@@ -57,7 +58,7 @@ import static org.apache.ignite.internal.igfs.hadoop.IgfsHadoopUtils.*;
*
* <property>
* <name>fs.igfs.impl</name>
- * <value>org.apache.ignite.igfs.hadoop.IgfsHadoopFileSystem</value>
+ * <value>org.apache.ignite.igfs.hadoop.v2.IgfsHadoopFileSystem</value>
* </property>
* </pre>
* You should also add Ignite JAR and all libraries to Hadoop classpath. To
@@ -266,56 +267,29 @@ public class IgfsHadoopFileSystem extends AbstractFileSystem implements Closeabl
boolean initSecondary = paths.defaultMode() == PROXY;
- if (paths.pathModes() != null) {
+ if (!initSecondary && paths.pathModes() != null) {
for (T2<IgfsPath, IgfsMode> pathMode : paths.pathModes()) {
IgfsMode mode = pathMode.getValue();
- initSecondary |= mode == PROXY;
+ if (mode == PROXY) {
+ initSecondary = true;
+
+ break;
+ }
}
}
if (initSecondary) {
Map<String, String> props = paths.properties();
- String secUri = props.get(IgfsHadoopFileSystemWrapper.SECONDARY_FS_URI);
- String secConfPath = props.get(IgfsHadoopFileSystemWrapper.SECONDARY_FS_CONFIG_PATH);
-
- if (secConfPath == null)
- throw new IOException("Failed to connect to the secondary file system because configuration " +
- "path is not provided.");
-
- if (secUri == null)
- throw new IOException("Failed to connect to the secondary file system because URI is not " +
- "provided.");
-
- if (secConfPath == null)
- throw new IOException("Failed to connect to the secondary file system because configuration " +
- "path is not provided.");
-
- if (secUri == null)
- throw new IOException("Failed to connect to the secondary file system because URI is not " +
- "provided.");
+ String secUri = props.get(SECONDARY_FS_URI);
+ String secConfPath = props.get(SECONDARY_FS_CONFIG_PATH);
try {
- secondaryUri = new URI(secUri);
-
- URL secondaryCfgUrl = U.resolveIgniteUrl(secConfPath);
+ SecondaryFileSystemProvider secProvider = new SecondaryFileSystemProvider(secUri, secConfPath);
- if (secondaryCfgUrl == null)
- throw new IOException("Failed to resolve secondary file system config URL: " + secConfPath);
-
- Configuration conf = new Configuration();
-
- conf.addResource(secondaryCfgUrl);
-
- String prop = String.format("fs.%s.impl.disable.cache", secondaryUri.getScheme());
-
- conf.setBoolean(prop, true);
-
- secondaryFs = AbstractFileSystem.get(secondaryUri, conf);
- }
- catch (URISyntaxException ignore) {
- throw new IOException("Failed to resolve secondary file system URI: " + secUri);
+ secondaryFs = secProvider.createAbstractFileSystem();
+ secondaryUri = secProvider.uri();
}
catch (IOException e) {
throw new IOException("Failed to connect to the secondary file system: " + secUri, e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
new file mode 100644
index 0000000..c1dceba
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/SecondaryFileSystemProvider.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.hadoop;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Encapsulates logic of secondary filesystem creation.
+ */
+public class SecondaryFileSystemProvider {
+ /** Configuration of the secondary filesystem, never null. */
+ private final Configuration cfg = new Configuration();
+
+ /** The secondary filesystem URI, never null. */
+ private final URI uri;
+
+ /**
+ * Creates new provider with given config parameters. The configuration URL is optional. The filesystem URI must be
+ * specified either explicitly or in the configuration provided.
+ *
+ * @param secUri the secondary Fs URI (optional). If not given explicitly, it must be specified as "fs.defaultFS"
+ * property in the provided configuration.
+ * @param secConfPath the secondary Fs path (file path on the local file system, optional).
+ * See {@link IgniteUtils#resolveIgniteUrl(String)} on how the path resolved.
+ * @throws IOException
+ */
+ public SecondaryFileSystemProvider(final @Nullable String secUri,
+ final @Nullable String secConfPath) throws IOException {
+ if (secConfPath != null) {
+ URL url = U.resolveIgniteUrl(secConfPath);
+
+ if (url == null) {
+ // If secConfPath is given, it should be resolvable:
+ throw new IllegalArgumentException("Failed to resolve secondary file system " +
+ "configuration path: " + secConfPath);
+ }
+
+ cfg.addResource(url);
+ }
+
+ // if secondary fs URI is not given explicitly, try to get it from the configuration:
+ if (secUri == null)
+ uri = FileSystem.getDefaultUri(cfg);
+ else {
+ try {
+ uri = new URI(secUri);
+ }
+ catch (URISyntaxException use) {
+ throw new IOException("Failed to resolve secondary file system URI: " + secUri);
+ }
+ }
+
+ if (uri == null)
+ throw new IllegalArgumentException("Failed to get secondary file system URI (it is neither given " +
+ "explicitly nor specified in the configuration): " + secConfPath);
+
+ // Disable caching:
+ String prop = String.format("fs.%s.impl.disable.cache", uri.getScheme());
+
+ cfg.setBoolean(prop, true);
+ }
+
+ /**
+ * @return {@link org.apache.hadoop.fs.FileSystem} instance for this secondary Fs.
+ * @throws IOException
+ */
+ public FileSystem createFileSystem() throws IOException {
+ FileSystem fileSys = FileSystem.get(uri, cfg);
+
+ return fileSys;
+ }
+
+ /**
+ * @return {@link org.apache.hadoop.fs.AbstractFileSystem} instance for this secondary Fs.
+ * @throws IOException
+ */
+ public AbstractFileSystem createAbstractFileSystem() throws IOException {
+ AbstractFileSystem secondaryFs = AbstractFileSystem.get(uri, cfg);
+
+ return secondaryFs;
+ }
+
+ /**
+ * @return the secondary fs URI, never null.
+ */
+ public URI uri() {
+ return uri;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
new file mode 100644
index 0000000..4ad74d0
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
@@ -0,0 +1,541 @@
+package org.apache.ignite.igfs;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.*;
+import org.apache.hadoop.fs.permission.*;
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.igfs.hadoop.*;
+import org.apache.ignite.igfs.hadoop.v1.*;
+import org.apache.ignite.internal.igfs.hadoop.*;
+import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.processors.igfs.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.events.EventType.*;
+import static org.apache.ignite.igfs.IgfsMode.*;
+import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint.*;
+
+/**
+ * Tests secondary file system configuration.
+ */
+public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstractTest {
+ /** IGFS scheme */
+ private static final String IGFS_SCHEME = "igfs";
+
+ /** Primary file system authority. */
+ private static final String PRIMARY_AUTHORITY = "igfs:grid0@";
+
+ /** Autogenerated secondary file system configuration path. */
+ private static final String PRIMARY_CFG_PATH = "/work/core-site-primary-test.xml";
+
+ /** Secondary file system authority. */
+ private static final String SECONDARY_AUTHORITY = "igfs_secondary:grid_secondary@127.0.0.1:11500";
+
+ /** Autogenerated secondary file system configuration path. */
+ private static final String SECONDARY_CFG_PATH = "/work/core-site-test.xml";
+
+ /** Secondary endpoint configuration. */
+ protected static final Map<String, String> SECONDARY_ENDPOINT_CFG = new HashMap<String, String>() {{
+ put("type", "tcp");
+ put("port", "11500");
+ }};
+
+ /** Group size. */
+ public static final int GRP_SIZE = 128;
+
+ /** IP finder. */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Primary file system URI. */
+ protected URI primaryFsUri;
+
+ /** Primary file system. */
+ private FileSystem primaryFs;
+
+ /** Full path of primary Fs configuration */
+ private String primaryConfFullPath;
+
+ /** Input primary Fs uri */
+ private String primaryFsUriStr;
+
+ /** Input URI scheme for configuration */
+ private String primaryCfgScheme;
+
+ /** Input URI authority for configuration */
+ private String primaryCfgAuthority;
+
+ /** if to pass configuration */
+ private boolean passPrimaryConfiguration;
+
+ /** Full path of s Fs configuration */
+ private String secondaryConfFullPath;
+
+ /** /Input URI scheme for configuration */
+ private String secondaryFsUriStr;
+
+ /** Input URI scheme for configuration */
+ private String secondaryCfgScheme;
+
+ /** Input URI authority for configuration */
+ private String secondaryCfgAuthority;
+
+ /** if to pass configuration */
+ private boolean passSecondaryConfiguration;
+
+ /** Default IGFS mode. */
+ protected final IgfsMode mode;
+
+ /** Skip embedded mode flag. */
+ private final boolean skipEmbed;
+
+ /** Skip local shmem flag. */
+ private final boolean skipLocShmem;
+
+ /**
+ * Constructor.
+ *
+ * @param mode Default IGFS mode.
+ * @param skipEmbed Whether to skip embedded mode.
+ * @param skipLocShmem Whether to skip local shmem mode.
+ */
+ protected HadoopSecondaryFileSystemConfigurationTest(IgfsMode mode, boolean skipEmbed, boolean skipLocShmem) {
+ this.mode = mode;
+ this.skipEmbed = skipEmbed;
+ this.skipLocShmem = skipLocShmem;
+ }
+
+ /**
+ * Default constructor.
+ */
+ public HadoopSecondaryFileSystemConfigurationTest() {
+ this(PROXY, true, false);
+ }
+
+ /**
+ * Executes before each test.
+ * @throws Exception
+ */
+ private void before() throws Exception {
+ initSecondary();
+
+ if (passPrimaryConfiguration) {
+ Configuration primaryFsCfg = configuration(primaryCfgScheme, primaryCfgAuthority, skipEmbed, skipLocShmem);
+
+ primaryConfFullPath = writeConfiguration(primaryFsCfg, PRIMARY_CFG_PATH);
+ }
+ else
+ primaryConfFullPath = null;
+
+ SecondaryFileSystemProvider provider =
+ new SecondaryFileSystemProvider(primaryFsUriStr, primaryConfFullPath);
+
+ primaryFs = provider.createFileSystem();
+
+ primaryFsUri = provider.uri();
+ }
+
+ /**
+ * Executes after each test.
+ * @throws Exception
+ */
+ private void after() throws Exception {
+ if (primaryFs != null) {
+ try {
+ primaryFs.delete(new Path("/"), true);
+ }
+ catch (Exception ignore) {
+ // No-op.
+ }
+
+ U.closeQuiet(primaryFs);
+ }
+
+ G.stopAll(true);
+
+ delete(primaryConfFullPath);
+ delete(secondaryConfFullPath);
+ }
+
+ /**
+ * Utility method to delete file.
+ *
+ * @param file the file path to delete.
+ */
+ @SuppressWarnings("ResultOfMethodCallIgnored")
+ private static void delete(String file) {
+ if (file != null) {
+ new File(file).delete();
+
+ assertFalse(new File(file).exists());
+ }
+ }
+
+ /**
+ * Initialize underlying secondary filesystem.
+ *
+ * @throws Exception
+ */
+ private void initSecondary() throws Exception {
+ if (passSecondaryConfiguration) {
+ Configuration secondaryConf = configuration(secondaryCfgScheme, secondaryCfgAuthority, true, true);
+
+ secondaryConf.setInt("fs.igfs.block.size", 1024);
+
+ secondaryConfFullPath = writeConfiguration(secondaryConf, SECONDARY_CFG_PATH);
+ }
+ else
+ secondaryConfFullPath = null;
+
+ startNodes();
+ }
+
+ /**
+ * Starts the nodes for this test.
+ *
+ * @throws Exception If failed.
+ */
+ private void startNodes() throws Exception {
+ if (mode != PRIMARY)
+ startSecondary();
+
+ startGrids(4);
+ }
+
+ /**
+ * Starts secondary IGFS
+ */
+ private void startSecondary() {
+ IgfsConfiguration igfsCfg = new IgfsConfiguration();
+
+ igfsCfg.setDataCacheName("partitioned");
+ igfsCfg.setMetaCacheName("replicated");
+ igfsCfg.setName("igfs_secondary");
+ igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
+ igfsCfg.setBlockSize(512 * 1024);
+ igfsCfg.setPrefetchBlocks(1);
+
+ CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+ cacheCfg.setName("partitioned");
+ cacheCfg.setCacheMode(PARTITIONED);
+ cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+ cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+ cacheCfg.setBackups(0);
+ cacheCfg.setQueryIndexEnabled(false);
+ cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+ metaCacheCfg.setName("replicated");
+ metaCacheCfg.setCacheMode(REPLICATED);
+ metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ metaCacheCfg.setQueryIndexEnabled(false);
+ metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ IgniteConfiguration cfg = new IgniteConfiguration();
+
+ cfg.setGridName("grid_secondary");
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+ cfg.setDiscoverySpi(discoSpi);
+ cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+ cfg.setIgfsConfiguration(igfsCfg);
+ cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+
+ cfg.setCommunicationSpi(communicationSpi());
+
+ G.start(cfg);
+ }
+
+ /**
+ * Get primary IPC endpoint configuration.
+ *
+ * @param gridName Grid name.
+ * @return IPC primary endpoint configuration.
+ */
+ protected Map<String, String> primaryIpcEndpointConfiguration(final String gridName) {
+ return new HashMap<String, String>() {{
+ put("type", "tcp");
+ put("port", String.valueOf(DFLT_IPC_PORT + getTestGridIndex(gridName)));
+ }};
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getTestGridName() {
+ return "grid";
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(discoSpi);
+ cfg.setCacheConfiguration(cacheConfiguration());
+ cfg.setIgfsConfiguration(igfsConfiguration(gridName));
+ cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+ cfg.setCommunicationSpi(communicationSpi());
+
+ return cfg;
+ }
+
+ /**
+ * Gets cache configuration.
+ *
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration[] cacheConfiguration() {
+ CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+ cacheCfg.setName("partitioned");
+ cacheCfg.setCacheMode(PARTITIONED);
+ cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+ cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+ cacheCfg.setBackups(0);
+ cacheCfg.setQueryIndexEnabled(false);
+ cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+ metaCacheCfg.setName("replicated");
+ metaCacheCfg.setCacheMode(REPLICATED);
+ metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ metaCacheCfg.setQueryIndexEnabled(false);
+ metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+ }
+
+ /**
+ * Gets IGFS configuration.
+ *
+ * @param gridName Grid name.
+ * @return IGFS configuration.
+ */
+ protected IgfsConfiguration igfsConfiguration(String gridName) throws IgniteCheckedException {
+ IgfsConfiguration cfg = new IgfsConfiguration();
+
+ cfg.setDataCacheName("partitioned");
+ cfg.setMetaCacheName("replicated");
+ cfg.setName("igfs");
+ cfg.setPrefetchBlocks(1);
+ cfg.setDefaultMode(mode);
+
+ if (mode != PRIMARY)
+ cfg.setSecondaryFileSystem(
+ new IgfsHadoopFileSystemWrapper(secondaryFsUriStr, secondaryConfFullPath));
+
+ cfg.setIpcEndpointConfiguration(primaryIpcEndpointConfiguration(gridName));
+
+ cfg.setManagementPort(-1);
+ cfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups.
+
+ return cfg;
+ }
+
+ /** @return Communication SPI. */
+ private CommunicationSpi communicationSpi() {
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ return commSpi;
+ }
+
+ /**
+ * Case #SecondaryFileSystemProvider(null, path)
+ *
+ * @throws Exception On failure.
+ */
+ public void testFsConfigurationOnly() throws Exception {
+ primaryCfgScheme = IGFS_SCHEME;
+ primaryCfgAuthority = PRIMARY_AUTHORITY;
+ passPrimaryConfiguration = true;
+ primaryFsUriStr = null;
+
+ // wrong secondary URI in the configuration:
+ secondaryCfgScheme = IGFS_SCHEME;
+ secondaryCfgAuthority = SECONDARY_AUTHORITY;
+ passSecondaryConfiguration = true;
+ secondaryFsUriStr = null;
+
+ check();
+ }
+
+ /**
+ * Case #SecondaryFileSystemProvider(uri, path), when 'uri' parameter overrides
+ * the Fs uri set in the configuration.
+ *
+ * @throws Exception On failure.
+ */
+ public void testFsUriOverridesUriInConfiguration() throws Exception {
+ // wrong primary URI in the configuration:
+ primaryCfgScheme = "foo";
+ primaryCfgAuthority = "moo:zoo@bee";
+ passPrimaryConfiguration = true;
+ primaryFsUriStr = mkUri(IGFS_SCHEME, PRIMARY_AUTHORITY);
+
+ // wrong secondary URI in the configuration:
+ secondaryCfgScheme = "foo";
+ secondaryCfgAuthority = "moo:zoo@bee";
+ passSecondaryConfiguration = true;
+ secondaryFsUriStr = mkUri(IGFS_SCHEME, SECONDARY_AUTHORITY);
+
+ check();
+ }
+
+ /**
+ * Perform actual check.
+ *
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("deprecation")
+ private void check() throws Exception {
+ before();
+
+ try {
+ Path fsHome = new Path(primaryFsUri);
+ Path dir = new Path(fsHome, "/someDir1/someDir2/someDir3");
+ Path file = new Path(dir, "someFile");
+
+ assertPathDoesNotExist(primaryFs, file);
+
+ FsPermission fsPerm = new FsPermission((short)644);
+
+ FSDataOutputStream os = primaryFs.create(file, fsPerm, false, 1, (short)1, 1L, null);
+
+ // Try to write something in file.
+ os.write("abc".getBytes());
+
+ os.close();
+
+ // Check file status.
+ FileStatus fileStatus = primaryFs.getFileStatus(file);
+
+ assertFalse(fileStatus.isDir());
+ assertEquals(file, fileStatus.getPath());
+ assertEquals(fsPerm, fileStatus.getPermission());
+ }
+ finally {
+ after();
+ }
+ }
+
+ /**
+ * Create configuration for test.
+ *
+ * @param skipEmbed Whether to skip embedded mode.
+ * @param skipLocShmem Whether to skip local shmem mode.
+ * @return Configuration.
+ */
+ private static Configuration configuration(String scheme, String authority, boolean skipEmbed, boolean skipLocShmem) {
+ final Configuration cfg = new Configuration();
+
+ if (scheme != null && authority != null)
+ cfg.set("fs.defaultFS", scheme + "://" + authority + "/");
+
+ setImplClasses(cfg);
+
+ if (authority != null) {
+ if (skipEmbed)
+ cfg.setBoolean(String.format(IgfsHadoopUtils.PARAM_IGFS_ENDPOINT_NO_EMBED, authority), true);
+
+ if (skipLocShmem)
+ cfg.setBoolean(String.format(IgfsHadoopUtils.PARAM_IGFS_ENDPOINT_NO_LOCAL_SHMEM, authority), true);
+ }
+
+ return cfg;
+ }
+
+ /**
+ * Sets Hadoop Fs implementation classes.
+ *
+ * @param cfg the configuration to set parameters into.
+ */
+ private static void setImplClasses(Configuration cfg) {
+ cfg.set("fs.igfs.impl", IgfsHadoopFileSystem.class.getName());
+
+ cfg.set("fs.AbstractFileSystem.igfs.impl",
+ org.apache.ignite.igfs.hadoop.v2.IgfsHadoopFileSystem.class.getName());
+ }
+
+ /**
+ * Check path does not exist in a given FileSystem.
+ *
+ * @param fs FileSystem to check.
+ * @param path Path to check.
+ */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ private void assertPathDoesNotExist(final FileSystem fs, final Path path) {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fs.getFileStatus(path);
+ }
+ }, FileNotFoundException.class, null);
+ }
+
+ /**
+ * Writes down the configuration to local disk and returns its path.
+ *
+ * @param cfg the configuration to write.
+ * @param pathFromIgniteHome path relatively to Ignite home.
+ * @return Full path of the written configuration.
+ */
+ private static String writeConfiguration(Configuration cfg, String pathFromIgniteHome) throws IOException {
+ if (!pathFromIgniteHome.startsWith("/"))
+ pathFromIgniteHome = "/" + pathFromIgniteHome;
+
+ final String path = U.getIgniteHome() + pathFromIgniteHome;
+
+ delete(path);
+
+ File file = new File(path);
+
+ try (FileOutputStream fos = new FileOutputStream(file)) {
+ cfg.writeXml(fos);
+ }
+
+ assertTrue(file.exists());
+ return path;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 3 * 60 * 1000;
+ }
+
+ /**
+ * Makes URI.
+ *
+ * @param scheme the scheme
+ * @param authority the authority
+ * @return URI String
+ */
+ private static String mkUri(String scheme, String authority) {
+ return scheme + "://" + authority + "/";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03b966fe/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index a03eb81..836cdaa 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -120,6 +120,8 @@ public class IgniteHadoopTestSuite extends TestSuite {
suite.addTest(new TestSuite(ldr.loadClass(GridHadoopCommandLineTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(HadoopSecondaryFileSystemConfigurationTest.class.getName())));
+
return suite;
}
[05/16] incubator-ignite git commit: # sprint-2 Fixed typo.
Posted by sb...@apache.org.
# sprint-2 Fixed typo.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5d2a7c6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5d2a7c6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5d2a7c6c
Branch: refs/heads/ignite-51
Commit: 5d2a7c6ca6dac1d64d1efd4196e5130a117c6ca3
Parents: 4dd565e
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Mar 4 17:16:01 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Mar 4 17:16:01 2015 +0700
----------------------------------------------------------------------
.../apache/ignite/visor/commands/cache/VisorCacheCommand.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5d2a7c6c/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index c39e946..8a2f6e0 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -842,8 +842,8 @@ object VisorCacheCommand {
cacheT += ("Cache Interceptor", safe(cfg.interceptor()))
cacheT += ("Store Enabled", bool2Str(storeCfg.enabled()))
- cacheT += ("Store Сlass", safe(storeCfg.store()))
- cacheT += ("Store Factory Сlass", storeCfg.storeFactory())
+ cacheT += ("Store Class", safe(storeCfg.store()))
+ cacheT += ("Store Factory Class", storeCfg.storeFactory())
cacheT += ("Store Read Through", bool2Str(storeCfg.readThrough()))
cacheT += ("Store Write Through", bool2Str(storeCfg.writeThrough()))
[09/16] incubator-ignite git commit: Merge remote-tracking branch
'origin/sprint-2' into sprint-2
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/sprint-2' into sprint-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9af25666
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9af25666
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9af25666
Branch: refs/heads/ignite-51
Commit: 9af256661cebeb78710d87d273663be39c72a1d8
Parents: 03b966f 882ded5
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Mar 4 17:52:05 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Mar 4 17:52:05 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/schema/generator/SnippetGenerator.java | 2 +-
.../apache/ignite/schema/parser/DatabaseMetadataParser.java | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[10/16] incubator-ignite git commit: sp-2: api cleanup
Posted by sb...@apache.org.
sp-2: api cleanup
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ff5173d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ff5173d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ff5173d8
Branch: refs/heads/ignite-51
Commit: ff5173d8da38df8aaa5d83cad36f6c3d739c3164
Parents: 5d2a7c6
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Mar 4 18:17:40 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Mar 4 18:17:40 2015 +0300
----------------------------------------------------------------------
.../misc/lifecycle/LifecycleExample.java | 4 +-
.../apache/ignite/internal/IgniteKernal.java | 8 +--
.../apache/ignite/lifecycle/LifecycleBean.java | 36 +++++-----
.../ignite/lifecycle/LifecycleEventType.java | 20 +++---
.../internal/GridLifecycleBeanSelfTest.java | 76 ++++++++++----------
.../dht/GridCacheDhtPreloadBigDataSelfTest.java | 2 +-
.../dht/GridCacheDhtPreloadUnloadSelfTest.java | 2 +-
...achePartitionedPreloadLifecycleSelfTest.java | 8 +--
...CacheReplicatedPreloadLifecycleSelfTest.java | 8 +--
.../clock/GridTimeSyncProcessorSelfTest.java | 2 +-
.../colocation/GridTestLifecycleBean.java | 2 +-
.../loadtests/dsi/GridDsiLifecycleBean.java | 8 +--
.../ignite/internal/GridFactorySelfTest.java | 10 +--
13 files changed, 91 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
index f973b18..497872a 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
@@ -76,9 +76,9 @@ public final class LifecycleExample {
System.out.println(">>> Lifecycle event occurred: " + evt);
System.out.println(">>> Ignite name: " + ignite.name());
- if (evt == AFTER_GRID_START)
+ if (evt == AFTER_NODE_START)
isStarted = true;
- else if (evt == AFTER_GRID_STOP)
+ else if (evt == AFTER_NODE_STOP)
isStarted = false;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index cc4efa6..b9abdb5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -699,7 +699,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
}
// Lifecycle notification.
- notifyLifecycleBeans(BEFORE_GRID_START);
+ notifyLifecycleBeans(BEFORE_NODE_START);
// Starts lifecycle aware components.
U.startLifecycleAware(lifecycleAwares(cfg));
@@ -814,7 +814,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
registerExecutorMBeans(execSvc, sysExecSvc, p2pExecSvc, mgmtExecSvc, restExecSvc);
// Lifecycle bean notifications.
- notifyLifecycleBeans(AFTER_GRID_START);
+ notifyLifecycleBeans(AFTER_NODE_START);
}
catch (Throwable e) {
IgniteSpiVersionCheckException verCheckErr = X.cause(e, IgniteSpiVersionCheckException.class);
@@ -1720,7 +1720,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
if (log.isDebugEnabled())
log.debug("Notifying lifecycle beans.");
- notifyLifecycleBeansEx(LifecycleEventType.BEFORE_GRID_STOP);
+ notifyLifecycleBeansEx(LifecycleEventType.BEFORE_NODE_STOP);
}
GridCacheProcessor cacheProcessor = ctx.cache();
@@ -1823,7 +1823,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
U.stopLifecycleAware(log, lifecycleAwares(cfg));
// Lifecycle notification.
- notifyLifecycleBeansEx(LifecycleEventType.AFTER_GRID_STOP);
+ notifyLifecycleBeansEx(LifecycleEventType.AFTER_NODE_STOP);
// Clean internal class/classloader caches to avoid stopped contexts held in memory.
OptimizedMarshaller.clearCache();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleBean.java b/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleBean.java
index effa1b9..4132500 100644
--- a/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleBean.java
@@ -20,34 +20,34 @@ package org.apache.ignite.lifecycle;
import org.apache.ignite.*;
/**
- * A bean that reacts to grid lifecycle events defined in {@link LifecycleEventType}.
+ * A bean that reacts to node lifecycle events defined in {@link LifecycleEventType}.
* Use this bean whenever you need to plug some custom logic before or after
- * grid startup and stopping routines.
+ * node startup and stopping routines.
* <p>
* There are four events you can react to:
* <ul>
* <li>
- * {@link LifecycleEventType#BEFORE_GRID_START} invoked before grid startup
- * routine is initiated. Note that grid is not available during this event,
+ * {@link LifecycleEventType#BEFORE_NODE_START} invoked before node startup
+ * routine is initiated. Note that node is not available during this event,
* therefore if you injected a ignite instance via {@link org.apache.ignite.resources.IgniteInstanceResource}
* annotation, you cannot use it yet.
* </li>
* <li>
- * {@link LifecycleEventType#AFTER_GRID_START} invoked right after grid
- * has started. At this point, if you injected a grid instance via
+ * {@link LifecycleEventType#AFTER_NODE_START} invoked right after node
+ * has started. At this point, if you injected a node instance via
* {@link org.apache.ignite.resources.IgniteInstanceResource} annotation, you can start using it. Note that
- * you should not be using {@link org.apache.ignite.Ignition} to get grid instance from
+ * you should not be using {@link org.apache.ignite.Ignition} to get node instance from
* lifecycle bean.
* </li>
* <li>
- * {@link LifecycleEventType#BEFORE_GRID_STOP} invoked right before grid
- * stop routine is initiated. Grid is still available at this stage, so
+ * {@link LifecycleEventType#BEFORE_NODE_STOP} invoked right before node
+ * stop routine is initiated. Node is still available at this stage, so
* if you injected a ignite instance via {@link org.apache.ignite.resources.IgniteInstanceResource} annotation,
* you can use it.
* </li>
* <li>
- * {@link LifecycleEventType#AFTER_GRID_STOP} invoked right after grid
- * has stopped. Note that grid is not available during this event.
+ * {@link LifecycleEventType#AFTER_NODE_STOP} invoked right after node
+ * has stopped. Note that node is not available during this event.
* </li>
* </ul>
* <h1 class="header">Resource Injection</h1>
@@ -64,23 +64,19 @@ import org.apache.ignite.*;
* <p>
* <h1 class="header">Usage</h1>
* If you need to tie your application logic into Ignition lifecycle,
- * you can configure lifecycle beans via standard grid configuration, add your
+ * you can configure lifecycle beans via standard node configuration, add your
* application library dependencies into {@code IGNITE_HOME/libs} folder, and
* simply start {@code IGNITE_HOME/ignite.{sh|bat}} scripts.
* <p>
* <h1 class="header">Configuration</h1>
- * Grid lifecycle beans can be configured programmatically as follows:
+ * Node lifecycle beans can be configured programmatically as follows:
* <pre name="code" class="java">
- * Collection<GridLifecycleBean> lifecycleBeans = new ArrayList<GridLifecycleBean>();
+ * IgniteConfiguration cfg = new IgniteConfiguration();
*
- * Collections.addAll(lifecycleBeans, new FooBarLifecycleBean1(), new FooBarLifecycleBean2());
- *
- * GridConfiguration cfg = new GridConfiguration();
- *
- * cfg.setLifecycleBeans(lifecycleBeans);
+ * cfg.setLifecycleBeans(new FooBarLifecycleBean1(), new FooBarLifecycleBean2());
*
* // Start grid with given configuration.
- * G.start(cfg);
+ * Ignition.start(cfg);
* </pre>
* or from Spring XML configuration file as follows:
* <pre name="code" class="xml">
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleEventType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleEventType.java b/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleEventType.java
index d7b7478..3bf8379 100644
--- a/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleEventType.java
+++ b/modules/core/src/main/java/org/apache/ignite/lifecycle/LifecycleEventType.java
@@ -20,36 +20,36 @@ package org.apache.ignite.lifecycle;
import org.jetbrains.annotations.*;
/**
- * Grid lifecycle event types. These events are used to notify lifecycle beans
- * about changes in grid lifecycle state.
+ * Node lifecycle event types. These events are used to notify lifecycle beans
+ * about changes in node lifecycle state.
* <p>
* For more information and detailed examples refer to {@link org.apache.ignite.lifecycle.LifecycleBean}
* documentation.
*/
public enum LifecycleEventType {
/**
- * Invoked before grid startup routine. Grid is not
+ * Invoked before node startup routine. Node is not
* initialized and cannot be used.
*/
- BEFORE_GRID_START,
+ BEFORE_NODE_START,
/**
- * Invoked after grid startup is complete. Grid is fully
+ * Invoked after node startup is complete. Node is fully
* initialized and fully functional.
*/
- AFTER_GRID_START,
+ AFTER_NODE_START,
/**
- * Invoked before grid stopping routine. Grid is fully functional
+ * Invoked before node stopping routine. Node is fully functional
* at this point.
*/
- BEFORE_GRID_STOP,
+ BEFORE_NODE_STOP,
/**
- * Invoked after grid had stopped. Grid is stopped and
+ * Invoked after node had stopped. Node is stopped and
* cannot be used.
*/
- AFTER_GRID_STOP;
+ AFTER_NODE_STOP;
/** Enumerated values. */
private static final LifecycleEventType[] VALS = values();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
index 5cbdc66..5821ef6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
@@ -57,10 +57,10 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
try {
assertEquals(IgniteState.STARTED, G.state(getTestGridName()));
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(0, bean.count(BEFORE_GRID_STOP));
- assertEquals(0, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(0, bean.count(BEFORE_NODE_STOP));
+ assertEquals(0, bean.count(AFTER_NODE_STOP));
}
finally {
stopAllGrids();
@@ -69,10 +69,10 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
assertEquals(IgniteState.STOPPED, G.state(getTestGridName()));
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(1, bean.count(BEFORE_GRID_STOP));
- assertEquals(1, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(1, bean.count(BEFORE_NODE_STOP));
+ assertEquals(1, bean.count(AFTER_NODE_STOP));
}
/**
@@ -108,7 +108,7 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
private void checkBeforeStart(boolean gridErr) throws Exception {
- bean = new LifeCycleExceptionBean(BEFORE_GRID_START, gridErr);
+ bean = new LifeCycleExceptionBean(BEFORE_NODE_START, gridErr);
try {
startGrid();
@@ -124,10 +124,10 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
stopAllGrids();
}
- assertEquals(0, bean.count(BEFORE_GRID_START));
- assertEquals(0, bean.count(AFTER_GRID_START));
- assertEquals(0, bean.count(BEFORE_GRID_STOP));
- assertEquals(1, bean.count(AFTER_GRID_STOP));
+ assertEquals(0, bean.count(BEFORE_NODE_START));
+ assertEquals(0, bean.count(AFTER_NODE_START));
+ assertEquals(0, bean.count(BEFORE_NODE_STOP));
+ assertEquals(1, bean.count(AFTER_NODE_STOP));
}
/**
@@ -135,7 +135,7 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
private void checkAfterStart(boolean gridErr) throws Exception {
- bean = new LifeCycleExceptionBean(AFTER_GRID_START, gridErr);
+ bean = new LifeCycleExceptionBean(AFTER_NODE_START, gridErr);
try {
startGrid();
@@ -151,58 +151,58 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
stopAllGrids();
}
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(0, bean.count(AFTER_GRID_START));
- assertEquals(1, bean.count(BEFORE_GRID_STOP));
- assertEquals(1, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(0, bean.count(AFTER_NODE_START));
+ assertEquals(1, bean.count(BEFORE_NODE_STOP));
+ assertEquals(1, bean.count(AFTER_NODE_STOP));
}
/**
* @throws Exception If failed.
*/
public void testGridErrorBeforeStop() throws Exception {
- checkOnStop(BEFORE_GRID_STOP, true);
+ checkOnStop(BEFORE_NODE_STOP, true);
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(0, bean.count(BEFORE_GRID_STOP));
- assertEquals(1, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(0, bean.count(BEFORE_NODE_STOP));
+ assertEquals(1, bean.count(AFTER_NODE_STOP));
}
/**
* @throws Exception If failed.
*/
public void testOtherErrorBeforeStop() throws Exception {
- checkOnStop(BEFORE_GRID_STOP, false);
+ checkOnStop(BEFORE_NODE_STOP, false);
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(0, bean.count(BEFORE_GRID_STOP));
- assertEquals(1, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(0, bean.count(BEFORE_NODE_STOP));
+ assertEquals(1, bean.count(AFTER_NODE_STOP));
}
/**
* @throws Exception If failed.
*/
public void testGridErrorAfterStop() throws Exception {
- checkOnStop(AFTER_GRID_STOP, true);
+ checkOnStop(AFTER_NODE_STOP, true);
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(1, bean.count(BEFORE_GRID_STOP));
- assertEquals(0, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(1, bean.count(BEFORE_NODE_STOP));
+ assertEquals(0, bean.count(AFTER_NODE_STOP));
}
/**
* @throws Exception If failed.
*/
public void testOtherErrorAfterStop() throws Exception {
- checkOnStop(AFTER_GRID_STOP, false);
+ checkOnStop(AFTER_NODE_STOP, false);
- assertEquals(1, bean.count(BEFORE_GRID_START));
- assertEquals(1, bean.count(AFTER_GRID_START));
- assertEquals(1, bean.count(BEFORE_GRID_STOP));
- assertEquals(0, bean.count(AFTER_GRID_STOP));
+ assertEquals(1, bean.count(BEFORE_NODE_START));
+ assertEquals(1, bean.count(AFTER_NODE_START));
+ assertEquals(1, bean.count(BEFORE_NODE_STOP));
+ assertEquals(0, bean.count(AFTER_NODE_STOP));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
index 587dff1..3769f8d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
@@ -166,7 +166,7 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
@Override public void onLifecycleEvent(LifecycleEventType evt) {
- if (evt == LifecycleEventType.AFTER_GRID_START) {
+ if (evt == LifecycleEventType.AFTER_NODE_START) {
IgniteCache<Integer, byte[]> c = ignite.jcache(null);
if (c.putIfAbsent(-1, new byte[1])) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
index 9f6e1a4..d454845 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
@@ -264,7 +264,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
@Override public void onLifecycleEvent(LifecycleEventType evt) {
- if (evt == LifecycleEventType.AFTER_GRID_START) {
+ if (evt == LifecycleEventType.AFTER_NODE_START) {
IgniteCache<Integer, String> c = ignite.jcache(null);
if (c.putIfAbsent(-1, "true")) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
index 2c510c5..1699ed3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
@@ -85,7 +85,7 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
@Override public void onLifecycleEvent(LifecycleEventType evt) {
switch (evt) {
- case AFTER_GRID_START: {
+ case AFTER_NODE_START: {
IgniteCache<Object, MyValue> c1 = ignite.jcache("one");
IgniteCache<Object, MyValue> c2 = ignite.jcache("two");
@@ -118,9 +118,9 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
break;
}
- case BEFORE_GRID_START:
- case BEFORE_GRID_STOP:
- case AFTER_GRID_STOP: {
+ case BEFORE_NODE_START:
+ case BEFORE_NODE_STOP:
+ case AFTER_NODE_STOP: {
info("Lifecycle event: " + evt);
break;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
index 6c417d3..063103b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
@@ -86,7 +86,7 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
@Override public void onLifecycleEvent(LifecycleEventType evt) {
switch (evt) {
- case AFTER_GRID_START: {
+ case AFTER_NODE_START: {
IgniteCache<Object, MyValue> c1 = ignite.jcache("one");
IgniteCache<Object, MyValue> c2 = ignite.jcache("two");
@@ -121,9 +121,9 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
break;
}
- case BEFORE_GRID_START:
- case BEFORE_GRID_STOP:
- case AFTER_GRID_STOP: {
+ case BEFORE_NODE_START:
+ case BEFORE_NODE_STOP:
+ case AFTER_NODE_STOP: {
info("Lifecycle event: " + evt);
break;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/internal/processors/clock/GridTimeSyncProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/clock/GridTimeSyncProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/clock/GridTimeSyncProcessorSelfTest.java
index b625492..9b81717 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/clock/GridTimeSyncProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/clock/GridTimeSyncProcessorSelfTest.java
@@ -196,7 +196,7 @@ public class GridTimeSyncProcessorSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override public void onLifecycleEvent(LifecycleEventType evt) {
- if (evt == LifecycleEventType.BEFORE_GRID_START)
+ if (evt == LifecycleEventType.BEFORE_NODE_START)
((GridKernalContextImpl)((IgniteKernal)g).context()).timeSource(new TimeShiftClockSource(delta));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestLifecycleBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestLifecycleBean.java b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestLifecycleBean.java
index 20f086f..a3ebc32 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestLifecycleBean.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestLifecycleBean.java
@@ -31,7 +31,7 @@ public class GridTestLifecycleBean implements LifecycleBean {
/** {@inheritDoc} */
@Override public void onLifecycleEvent(LifecycleEventType type) {
- if (type == LifecycleEventType.AFTER_GRID_START) {
+ if (type == LifecycleEventType.AFTER_NODE_START) {
IgniteCache<GridTestKey, Long> cache = g.jcache("partitioned");
assert cache != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/core/src/test/java/org/apache/ignite/loadtests/dsi/GridDsiLifecycleBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/dsi/GridDsiLifecycleBean.java b/modules/core/src/test/java/org/apache/ignite/loadtests/dsi/GridDsiLifecycleBean.java
index c0f5443..a70833b 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/dsi/GridDsiLifecycleBean.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/dsi/GridDsiLifecycleBean.java
@@ -43,18 +43,18 @@ public class GridDsiLifecycleBean implements LifecycleBean {
@Override public void onLifecycleEvent(LifecycleEventType evt) {
try {
switch (evt) {
- case BEFORE_GRID_START:
+ case BEFORE_NODE_START:
break;
- case AFTER_GRID_START:
+ case AFTER_NODE_START:
ignite.atomicSequence("ID", 0, true);
break;
- case BEFORE_GRID_STOP:
+ case BEFORE_NODE_STOP:
break;
- case AFTER_GRID_STOP:
+ case AFTER_NODE_STOP:
break;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ff5173d8/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
index 3b09940..ab3d699 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
@@ -177,10 +177,10 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
List<String> gridNames = bean.getGridNames();
- assert evts.get(0) == LifecycleEventType.BEFORE_GRID_START : "Invalid lifecycle event: " + evts.get(0);
- assert evts.get(1) == LifecycleEventType.AFTER_GRID_START : "Invalid lifecycle event: " + evts.get(1);
- assert evts.get(2) == LifecycleEventType.BEFORE_GRID_STOP : "Invalid lifecycle event: " + evts.get(2);
- assert evts.get(3) == LifecycleEventType.AFTER_GRID_STOP : "Invalid lifecycle event: " + evts.get(3);
+ assert evts.get(0) == LifecycleEventType.BEFORE_NODE_START : "Invalid lifecycle event: " + evts.get(0);
+ assert evts.get(1) == LifecycleEventType.AFTER_NODE_START : "Invalid lifecycle event: " + evts.get(1);
+ assert evts.get(2) == LifecycleEventType.BEFORE_NODE_STOP : "Invalid lifecycle event: " + evts.get(2);
+ assert evts.get(3) == LifecycleEventType.AFTER_NODE_STOP : "Invalid lifecycle event: " + evts.get(3);
checkGridNameEquals(gridNames.get(0), gridName);
checkGridNameEquals(gridNames.get(1), gridName);
@@ -645,7 +645,7 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
try {
checkState(ignite.name(),
- evt == LifecycleEventType.AFTER_GRID_START || evt == LifecycleEventType.BEFORE_GRID_STOP);
+ evt == LifecycleEventType.AFTER_NODE_START || evt == LifecycleEventType.BEFORE_NODE_STOP);
}
catch (Throwable e) {
log.error("Lifecycle bean failed state check: " + this, e);
[15/16] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-51
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-51
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9537359b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9537359b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9537359b
Branch: refs/heads/ignite-51
Commit: 9537359b2156f3d055380533674f3897da21725a
Parents: b876320 d6cf7b4
Author: sboikov <sb...@gridgain.com>
Authored: Wed Mar 4 23:37:56 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Mar 4 23:37:56 2015 +0300
----------------------------------------------------------------------
.../misc/lifecycle/LifecycleExample.java | 4 +-
.../apache/ignite/internal/IgniteKernal.java | 8 +-
.../ignite/internal/processors/igfs/IgfsEx.java | 6 +
.../shmem/IpcSharedMemoryServerEndpoint.java | 3 +-
.../visor/cache/VisorCacheClearTask.java | 3 +-
.../visor/cache/VisorCacheLoadTask.java | 3 +-
.../visor/node/VisorIgfsConfiguration.java | 7 +-
.../apache/ignite/lifecycle/LifecycleBean.java | 36 +-
.../ignite/lifecycle/LifecycleEventType.java | 20 +-
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../internal/GridLifecycleBeanSelfTest.java | 76 +--
.../dht/GridCacheDhtPreloadBigDataSelfTest.java | 2 +-
.../dht/GridCacheDhtPreloadUnloadSelfTest.java | 2 +-
...achePartitionedPreloadLifecycleSelfTest.java | 8 +-
...CacheReplicatedPreloadLifecycleSelfTest.java | 8 +-
.../clock/GridTimeSyncProcessorSelfTest.java | 2 +-
.../colocation/GridTestLifecycleBean.java | 2 +-
.../loadtests/dsi/GridDsiLifecycleBean.java | 8 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 44 +-
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 48 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 54 +-
.../hadoop/SecondaryFileSystemProvider.java | 111 ++++
.../GridHadoopExternalCommunication.java | 2 +-
...oopSecondaryFileSystemConfigurationTest.java | 541 +++++++++++++++++++
.../testsuites/IgniteHadoopTestSuite.java | 2 +
.../schema/generator/SnippetGenerator.java | 2 +-
.../schema/parser/DatabaseMetadataParser.java | 7 +-
.../ignite/internal/GridFactorySelfTest.java | 10 +-
.../scala/org/apache/ignite/visor/Packet.scala | 38 --
.../ignite/visor/commands/VisorConsole.scala | 2 -
.../ignite/visor/commands/ack/Packet.scala | 55 --
.../visor/commands/ack/VisorAckCommand.scala | 2 +-
.../ignite/visor/commands/alert/Packet.scala | 108 ----
.../ignite/visor/commands/cache/Packet.scala | 127 -----
.../commands/cache/VisorCacheCommand.scala | 12 +-
.../ignite/visor/commands/config/Packet.scala | 55 --
.../ignite/visor/commands/deploy/Packet.scala | 76 ---
.../ignite/visor/commands/disco/Packet.scala | 72 ---
.../ignite/visor/commands/events/Packet.scala | 97 ----
.../ignite/visor/commands/gc/Packet.scala | 61 ---
.../ignite/visor/commands/kill/Packet.scala | 78 ---
.../visor/commands/kill/VisorKillCommand.scala | 2 +-
.../ignite/visor/commands/node/Packet.scala | 60 --
.../ignite/visor/commands/ping/Packet.scala | 50 --
.../visor/commands/ping/VisorPingCommand.scala | 2 +-
.../ignite/visor/commands/start/Packet.scala | 90 ---
.../ignite/visor/commands/tasks/Packet.scala | 116 ----
.../commands/tasks/VisorTasksCommand.scala | 26 +-
.../ignite/visor/commands/top/Packet.scala | 87 ---
.../ignite/visor/commands/vvm/Packet.scala | 61 ---
50 files changed, 834 insertions(+), 1464 deletions(-)
----------------------------------------------------------------------
[07/16] incubator-ignite git commit: # sprint-2 Refactored to use JUL
logger.
Posted by sb...@apache.org.
# sprint-2 Refactored to use JUL logger.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/882ded50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/882ded50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/882ded50
Branch: refs/heads/ignite-51
Commit: 882ded509d7eac6e24fcc69206fab70c33aed60e
Parents: e7f7f57
Author: AKuznetsov <ak...@gridgain.com>
Authored: Wed Mar 4 21:45:05 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Wed Mar 4 21:45:05 2015 +0700
----------------------------------------------------------------------
.../apache/ignite/schema/parser/DatabaseMetadataParser.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/882ded50/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
index a849bd2..696ca62 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/parser/DatabaseMetadataParser.java
@@ -23,11 +23,15 @@ import org.apache.ignite.schema.parser.dialect.*;
import java.sql.*;
import java.util.*;
+import java.util.logging.*;
/**
* Database metadata parser.
*/
public class DatabaseMetadataParser {
+ /** Logger. */
+ private static final Logger log = Logger.getLogger(DatabaseMetadataParser.class.getName());
+
/**
* Parse database metadata.
*
@@ -50,8 +54,7 @@ public class DatabaseMetadataParser {
dialect = new JdbcMetadataDialect();
}
catch (SQLException e) {
- System.err.println("Failed to resolve dialect (JdbcMetaDataDialect will be used.");
- e.printStackTrace();
+ log.log(Level.SEVERE, "Failed to resolve dialect (JdbcMetaDataDialect will be used.", e);
dialect = new JdbcMetadataDialect();
}