ignite git commit: IGNITE-2105 - Fixed nested collections in direct marshalling

2015-12-11 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 10b83fb85 -> 6c61598bc


IGNITE-2105 - Fixed nested collections in direct marshalling


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6c61598b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6c61598b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6c61598b

Branch: refs/heads/ignite-1.5
Commit: 6c61598bc66594e535af4fb10f34abe6797b72c0
Parents: 10b83fb
Author: Valentin Kulichenko 
Authored: Fri Dec 11 17:00:25 2015 -0800
Committer: Valentin Kulichenko 
Committed: Fri Dec 11 17:00:25 2015 -0800

--
 .../internal/direct/DirectMessageWriter.java| 108 ++-
 .../ignite/util/GridMessageCollectionTest.java  |  34 --
 2 files changed, 111 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/6c61598b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
index ad122ba..085cf68 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
@@ -38,44 +38,29 @@ import org.jetbrains.annotations.Nullable;
  * Message writer implementation.
  */
 public class DirectMessageWriter implements MessageWriter {
-/** Stream. */
-private final DirectByteBufferStream stream;
-
 /** State. */
-private final DirectMessageState state = new 
DirectMessageState<>(StateItem.class,
-new IgniteOutClosure() {
-@Override public StateItem apply() {
-return new StateItem();
-}
-});
+private final DirectMessageState state;
 
 /**
  * @param protoVer Protocol version.
  */
-public DirectMessageWriter(byte protoVer) {
-switch (protoVer) {
-case 1:
-stream = new DirectByteBufferStreamImplV1(null);
-
-break;
-
-case 2:
-stream = new DirectByteBufferStreamImplV2(null);
-
-break;
-
-default:
-throw new IllegalStateException("Invalid protocol version: " + 
protoVer);
-}
+public DirectMessageWriter(final byte protoVer) {
+state = new DirectMessageState<>(StateItem.class, new 
IgniteOutClosure() {
+@Override public StateItem apply() {
+return new StateItem(protoVer);
+}
+});
 }
 
 /** {@inheritDoc} */
 @Override public void setBuffer(ByteBuffer buf) {
-stream.setBuffer(buf);
+state.item().stream.setBuffer(buf);
 }
 
 /** {@inheritDoc} */
 @Override public boolean writeHeader(byte type, byte fieldCnt) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeByte(type);
 
 return stream.lastFinished();
@@ -83,6 +68,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public boolean writeByte(String name, byte val) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeByte(val);
 
 return stream.lastFinished();
@@ -90,6 +77,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public boolean writeShort(String name, short val) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeShort(val);
 
 return stream.lastFinished();
@@ -97,6 +86,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public boolean writeInt(String name, int val) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeInt(val);
 
 return stream.lastFinished();
@@ -104,6 +95,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public boolean writeLong(String name, long val) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeLong(val);
 
 return stream.lastFinished();
@@ -111,6 +104,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public boolean writeFloat(String name, float val) {
+DirectByteBufferStream stream = state.item().stream;
+
 stream.writeFloat(val);
 
 return stream.lastFinished();
@@ -118,6 +113,8 @@ public class DirectMessageWriter implements MessageWriter {
 
 /** {@inheritDoc} */
 @Override public

ignite git commit: Fixed cache store examples

2015-12-17 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 889b26898 -> e1b2cf284


Fixed cache store examples


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e1b2cf28
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e1b2cf28
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e1b2cf28

Branch: refs/heads/ignite-1.5
Commit: e1b2cf2840b1451dbfc0bbef4540e5a9edaf6c35
Parents: 889b268
Author: Valentin Kulichenko 
Authored: Thu Dec 17 16:05:09 2015 -0800
Committer: Valentin Kulichenko 
Committed: Thu Dec 17 16:05:09 2015 -0800

--
 .../hibernate/CacheHibernateStoreExample.java   |   8 +
 .../datagrid/store/hibernate/Person.hbm.xml |   6 +-
 .../datagrid/store/hibernate/hibernate.cfg.xml  |   7 +-
 .../store/spring/CacheSpringPersonStore.java| 118 ++
 .../store/spring/CacheSpringStoreExample.java   | 155 +++
 .../datagrid/store/spring/package-info.java |  22 +++
 6 files changed, 311 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/e1b2cf28/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
--
diff --git 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
index 71c4f68..db34eaf 100644
--- 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
+++ 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
@@ -30,6 +30,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.examples.ExampleNodeStartup;
 import org.apache.ignite.examples.ExamplesUtils;
 import org.apache.ignite.examples.model.Person;
+import org.apache.ignite.examples.util.DbH2ServerStartup;
 import org.apache.ignite.transactions.Transaction;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -39,6 +40,13 @@ import static 
org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
  * 
  * This example uses {@link CacheHibernatePersonStore} as a persistent store.
  * 
+ * To start the example, you should:
+ * 
+ * Start H2 database TCP server using {@link DbH2ServerStartup}.
+ * Start a few nodes using {@link ExampleNodeStartup}.
+ * Start example using {@link CacheHibernateStoreExample}.
+ * 
+ * 
  * Remote nodes can be started with {@link ExampleNodeStartup} in another JVM 
which will
  * start node with {@code examples/config/example-ignite.xml} configuration.
  */

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1b2cf28/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
--
diff --git 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
index 1314b71..0728a03 100644
--- 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
+++ 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/Person.hbm.xml
@@ -23,12 +23,12 @@
 "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
 
 
-
+
 
 
 
 
-
-
+
+
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1b2cf28/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
--
diff --git 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
index 80a43e7..7bf70af 100644
--- 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
+++ 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate/hibernate.cfg.xml
@@ -26,8 +26,11 @@
 -->
 
 
-
-jdbc:h2:mem:example;DB_CLOSE_DELAY=-1
+
+jdbc:h2:tcp://localhost/mem:ExampleDb
+
+
+sa
 
 
 update

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1b2cf28/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring/CacheSpringPersonStore.java
--
diff --git 
a/examples/src/main/java/org/apache/ignite/examples/data

ignite git commit: Fixed CacheEntry toString()

2015-12-17 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 e1b2cf284 -> a4b547bd1


Fixed CacheEntry toString()


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a4b547bd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a4b547bd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a4b547bd

Branch: refs/heads/ignite-1.5
Commit: a4b547bd11ca3bf4a5cdfaac3ad01936cf6e995e
Parents: e1b2cf2
Author: Valentin Kulichenko 
Authored: Thu Dec 17 17:07:26 2015 -0800
Committer: Valentin Kulichenko 
Committed: Thu Dec 17 17:07:26 2015 -0800

--
 .../internal/processors/cache/CacheEntryImpl.java  |  6 +++---
 .../processors/cache/CacheEntryImplEx.java | 17 ++---
 2 files changed, 17 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a4b547bd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
index 71c684a..48649d2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
@@ -81,10 +81,10 @@ public class CacheEntryImpl implements Cache.Entry, Externalizable {
 /** {@inheritDoc} */
 @SuppressWarnings("unchecked")
 @Override public  T unwrap(Class cls) {
-if(cls.isAssignableFrom(getClass()))
+if (cls.isAssignableFrom(getClass()))
 return cls.cast(this);
 
-if (ver != null && cls.isAssignableFrom(CacheEntry.class))
+if (cls.isAssignableFrom(CacheEntry.class))
 return (T)new CacheEntryImplEx<>(key, val, ver);
 
 throw new IllegalArgumentException("Unwrapping to class is not 
supported: " + cls);
@@ -106,4 +106,4 @@ public class CacheEntryImpl implements Cache.Entry, Externalizable {
 public String toString() {
 return "Entry [key=" + key + ", val=" + val + ']';
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a4b547bd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
index f3e6c18..1c7111a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
@@ -78,7 +78,18 @@ public class CacheEntryImplEx extends 
CacheEntryImpl implements Cach
 
 /** {@inheritDoc} */
 public String toString() {
-return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", 
topVer=" + ver.topologyVersion() +
-", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", 
updateTime=" + ver.globalTime() + ']';
+String res = "CacheEntry [key=" + getKey() +
+", val=" + getValue();
+
+if (ver != null) {
+res += ", topVer=" + ver.topologyVersion() +
+", nodeOrder=" + ver.nodeOrder() +
+", order=" + ver.order() +
+", updateTime=" + ver.globalTime();
+}
+else
+res += ", ver=n/a";
+
+return res + ']';
 }
-}
\ No newline at end of file
+}



[3/3] ignite git commit: Merge remote-tracking branch 'apache/ignite-1.5' into ignite-1.5

2015-11-10 Thread vkulichenko
Merge remote-tracking branch 'apache/ignite-1.5' into ignite-1.5


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/388a8921
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/388a8921
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/388a8921

Branch: refs/heads/ignite-1.5
Commit: 388a8921032af9e055a021e6f859c030eaaa5ea8
Parents: dbadb45 cb28819
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:48:14 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:48:14 2015 -0800

--
 .../GridCachePartitionExchangeManager.java  |  34 ++--
 .../dht/preloader/GridDhtPartitionDemander.java |  25 ++-
 .../GridCacheAtomicReferenceImpl.java   |   2 +-
 .../processors/igfs/IgfsMetaManager.java|   2 +-
 .../org/apache/ignite/stream/StreamAdapter.java |   2 +-
 .../store/GridCacheBalancingStoreSelfTest.java  | 181 ++-
 ...CacheAtomicReferenceApiSelfAbstractTest.java |  20 +-
 modules/rest-http/pom.xml   |  11 ++
 .../yardstick/config/ignite-store-config.xml|  31 ++--
 modules/zookeeper/pom.xml   |   2 +-
 10 files changed, 265 insertions(+), 45 deletions(-)
--




[1/3] ignite git commit: Warning is writeThrough==false && writeBehind==true

2015-11-10 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 cb28819fc -> 388a89210


Warning is writeThrough==false && writeBehind==true


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50ede23a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50ede23a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50ede23a

Branch: refs/heads/ignite-1.5
Commit: 50ede23a1079271cd21c338968bf936623416a16
Parents: 3de9d47
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:44:27 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:44:27 2015 -0800

--
 .../store/GridCacheStoreManagerAdapter.java | 26 ++--
 1 file changed, 19 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/50ede23a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
index 174e1ce..dd54da5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
@@ -188,12 +188,24 @@ public abstract class GridCacheStoreManagerAdapter 
extends GridCacheManagerAdapt
 
 CacheConfiguration cfg = cctx.config();
 
-if (cfgStore != null && !cfg.isWriteThrough() && !cfg.isReadThrough()) 
{
-U.quietAndWarn(log,
-"Persistence store is configured, but both read-through and 
write-through are disabled. This " +
-"configuration makes sense if the store implements loadCache 
method only. If this is the " +
-"case, ignore this warning. Otherwise, fix the configuration 
for cache: " + cfg.getName(),
-"Persistence store is configured, but both read-through and 
write-through are disabled.");
+if (cfgStore != null) {
+if (!cfg.isWriteThrough() && !cfg.isReadThrough()) {
+U.quietAndWarn(log,
+"Persistence store is configured, but both read-through 
and write-through are disabled. This " +
+"configuration makes sense if the store implements 
loadCache method only. If this is the " +
+"case, ignore this warning. Otherwise, fix the 
configuration for the cache: " + cfg.getName(),
+"Persistence store is configured, but both read-through 
and write-through are disabled " +
+"for cache: " + cfg.getName());
+}
+
+if (!cfg.isWriteThrough() && cfg.isWriteBehindEnabled()) {
+U.quietAndWarn(log,
+"To enable write-behind mode for the cache store it's also 
required to set " +
+"CacheConfiguration.setWriteThrough(true) property, 
otherwise the persistence " +
+"store will be never updated. Consider fixing 
configuration for the cache: " + cfg.getName(),
+"Write-behind mode for the cache store also requires 
CacheConfiguration.setWriteThrough(true) " +
+"property. Fix configuration for the cache: " + 
cfg.getName());
+}
 }
 
 sesLsnrs = CU.startStoreSessionListeners(cctx.kernalContext(), 
cfg.getCacheStoreSessionListenerFactories());
@@ -1256,4 +1268,4 @@ public abstract class GridCacheStoreManagerAdapter 
extends GridCacheManagerAdapt
 }
 }
 }
-}
\ No newline at end of file
+}



[2/3] ignite git commit: Fixed typos

2015-11-10 Thread vkulichenko
Fixed typos


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dbadb45a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dbadb45a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dbadb45a

Branch: refs/heads/ignite-1.5
Commit: dbadb45a09dd2a8a2e7e153b9862f71419ea5ecc
Parents: 50ede23
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:01:46 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:45:07 2015 -0800

--
 .../ignite/cache/store/CacheStoreSessionListener.java   | 9 +
 .../cache/store/jdbc/CacheJdbcStoreSessionListener.java | 8 
 2 files changed, 9 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/dbadb45a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
index 8215756..9496d20 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
@@ -35,11 +35,12 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * rollback when session is finished.
  * 
  * Cache store session listener allows to implement this and other
- * scenarios providing to callback methods:
+ * scenarios providing two callback methods:
  * 
  * 
  * {@link #onSessionStart(CacheStoreSession)} - called
- * before any store operation within a session is invoked.
+ * when a session is created prior to all operations
+ * within his session.
  * 
  * 
  * {@link #onSessionEnd(CacheStoreSession, boolean)} - called
@@ -47,7 +48,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * 
  * 
  * Implementations
- * Ignites provides several out-of-the-box implementations
+ * Ignite provides several out-of-the-box implementations
  * of session listener (refer to individual JavaDocs for more
  * details):
  * 
@@ -130,4 +131,4 @@ public interface CacheStoreSessionListener {
  *  should commit, {@code false} for rollback.
  */
 public void onSessionEnd(CacheStoreSession ses, boolean commit);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dbadb45a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
index 2c70d26..6be237e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
@@ -37,12 +37,12 @@ import org.apache.ignite.lifecycle.LifecycleAware;
  * back) it when session ends.
  * 
  * The connection is saved as a store session
-  * {@link CacheStoreSession#attachment() attachment}.
+ * {@link CacheStoreSession#attachment() attachment}.
  * The listener guarantees that the connection will be
  * available for any store operation. If there is an
  * ongoing cache transaction, all operations within this
  * transaction will be committed or rolled back only when
- * session ends.
+ * the session ends.
  * 
  * As an example, here is how the {@link CacheStore#write(Cache.Entry)}
  * method can be implemented if {@link CacheJdbcStoreSessionListener}
@@ -133,11 +133,11 @@ public class CacheJdbcStoreSessionListener implements 
CacheStoreSessionListener,
 conn.rollback();
 }
 catch (SQLException e) {
-throw new CacheWriterException("Failed to start store session 
[tx=" + ses.transaction() + ']', e);
+throw new CacheWriterException("Failed to end store session 
[tx=" + ses.transaction() + ']', e);
 }
 finally {
 U.closeQuiet(conn);
 }
 }
 }
-}
\ No newline at end of file
+}



[5/6] ignite git commit: Merge remote-tracking branch 'upstream/master'

2015-11-10 Thread vkulichenko
Merge remote-tracking branch 'upstream/master'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0e1017b3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e1017b3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e1017b3

Branch: refs/heads/master
Commit: 0e1017b35dd4d1b8e4c2f0c6aeed194e87d89203
Parents: 946360a 57ea0ff
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:49:21 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:49:21 2015 -0800

--
 .../java/org/apache/ignite/IgniteCache.java |   1 +
 .../eviction/random/RandomEvictionPolicy.java   |   4 +
 .../processors/cache/GridCacheAdapter.java  |  22 ++-
 .../GridCachePartitionExchangeManager.java  |  34 ++--
 .../processors/cache/IgniteCacheProxy.java  |   6 +
 .../dht/preloader/GridDhtPartitionDemander.java |  25 ++-
 .../GridCacheAtomicReferenceImpl.java   |   2 +-
 .../processors/igfs/IgfsMetaManager.java|   2 +-
 .../org/apache/ignite/stream/StreamAdapter.java |   2 +-
 .../store/GridCacheBalancingStoreSelfTest.java  | 181 ++-
 ...CacheAtomicReferenceApiSelfAbstractTest.java |  20 +-
 modules/rest-http/pom.xml   |  11 ++
 .../yardstick/config/ignite-store-config.xml|  31 ++--
 modules/zookeeper/pom.xml   |   2 +-
 14 files changed, 294 insertions(+), 49 deletions(-)
--




[1/6] ignite git commit: Fixed typos

2015-11-10 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master 57ea0ff54 -> 6a7d079b7


Fixed typos


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/946360aa
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/946360aa
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/946360aa

Branch: refs/heads/master
Commit: 946360aa5438d8fabf0a7df4082ffb83346503ea
Parents: ee5a50f
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:01:46 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:01:46 2015 -0800

--
 .../ignite/cache/store/CacheStoreSessionListener.java   | 9 +
 .../cache/store/jdbc/CacheJdbcStoreSessionListener.java | 8 
 2 files changed, 9 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/946360aa/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
index 8215756..9496d20 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
@@ -35,11 +35,12 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * rollback when session is finished.
  * 
  * Cache store session listener allows to implement this and other
- * scenarios providing to callback methods:
+ * scenarios providing two callback methods:
  * 
  * 
  * {@link #onSessionStart(CacheStoreSession)} - called
- * before any store operation within a session is invoked.
+ * when a session is created prior to all operations
+ * within his session.
  * 
  * 
  * {@link #onSessionEnd(CacheStoreSession, boolean)} - called
@@ -47,7 +48,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * 
  * 
  * Implementations
- * Ignites provides several out-of-the-box implementations
+ * Ignite provides several out-of-the-box implementations
  * of session listener (refer to individual JavaDocs for more
  * details):
  * 
@@ -130,4 +131,4 @@ public interface CacheStoreSessionListener {
  *  should commit, {@code false} for rollback.
  */
 public void onSessionEnd(CacheStoreSession ses, boolean commit);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/946360aa/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
index 2c70d26..6be237e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
@@ -37,12 +37,12 @@ import org.apache.ignite.lifecycle.LifecycleAware;
  * back) it when session ends.
  * 
  * The connection is saved as a store session
-  * {@link CacheStoreSession#attachment() attachment}.
+ * {@link CacheStoreSession#attachment() attachment}.
  * The listener guarantees that the connection will be
  * available for any store operation. If there is an
  * ongoing cache transaction, all operations within this
  * transaction will be committed or rolled back only when
- * session ends.
+ * the session ends.
  * 
  * As an example, here is how the {@link CacheStore#write(Cache.Entry)}
  * method can be implemented if {@link CacheJdbcStoreSessionListener}
@@ -133,11 +133,11 @@ public class CacheJdbcStoreSessionListener implements 
CacheStoreSessionListener,
 conn.rollback();
 }
 catch (SQLException e) {
-throw new CacheWriterException("Failed to start store session 
[tx=" + ses.transaction() + ']', e);
+throw new CacheWriterException("Failed to end store session 
[tx=" + ses.transaction() + ']', e);
 }
 finally {
 U.closeQuiet(conn);
 }
 }
 }
-}
\ No newline at end of file
+}



[3/6] ignite git commit: Fixed typos

2015-11-10 Thread vkulichenko
Fixed typos


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dbadb45a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dbadb45a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dbadb45a

Branch: refs/heads/master
Commit: dbadb45a09dd2a8a2e7e153b9862f71419ea5ecc
Parents: 50ede23
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:01:46 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:45:07 2015 -0800

--
 .../ignite/cache/store/CacheStoreSessionListener.java   | 9 +
 .../cache/store/jdbc/CacheJdbcStoreSessionListener.java | 8 
 2 files changed, 9 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/dbadb45a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
index 8215756..9496d20 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/CacheStoreSessionListener.java
@@ -35,11 +35,12 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * rollback when session is finished.
  * 
  * Cache store session listener allows to implement this and other
- * scenarios providing to callback methods:
+ * scenarios providing two callback methods:
  * 
  * 
  * {@link #onSessionStart(CacheStoreSession)} - called
- * before any store operation within a session is invoked.
+ * when a session is created prior to all operations
+ * within his session.
  * 
  * 
  * {@link #onSessionEnd(CacheStoreSession, boolean)} - called
@@ -47,7 +48,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * 
  * 
  * Implementations
- * Ignites provides several out-of-the-box implementations
+ * Ignite provides several out-of-the-box implementations
  * of session listener (refer to individual JavaDocs for more
  * details):
  * 
@@ -130,4 +131,4 @@ public interface CacheStoreSessionListener {
  *  should commit, {@code false} for rollback.
  */
 public void onSessionEnd(CacheStoreSession ses, boolean commit);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dbadb45a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
index 2c70d26..6be237e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcStoreSessionListener.java
@@ -37,12 +37,12 @@ import org.apache.ignite.lifecycle.LifecycleAware;
  * back) it when session ends.
  * 
  * The connection is saved as a store session
-  * {@link CacheStoreSession#attachment() attachment}.
+ * {@link CacheStoreSession#attachment() attachment}.
  * The listener guarantees that the connection will be
  * available for any store operation. If there is an
  * ongoing cache transaction, all operations within this
  * transaction will be committed or rolled back only when
- * session ends.
+ * the session ends.
  * 
  * As an example, here is how the {@link CacheStore#write(Cache.Entry)}
  * method can be implemented if {@link CacheJdbcStoreSessionListener}
@@ -133,11 +133,11 @@ public class CacheJdbcStoreSessionListener implements 
CacheStoreSessionListener,
 conn.rollback();
 }
 catch (SQLException e) {
-throw new CacheWriterException("Failed to start store session 
[tx=" + ses.transaction() + ']', e);
+throw new CacheWriterException("Failed to end store session 
[tx=" + ses.transaction() + ']', e);
 }
 finally {
 U.closeQuiet(conn);
 }
 }
 }
-}
\ No newline at end of file
+}



[4/6] ignite git commit: Merge remote-tracking branch 'apache/ignite-1.5' into ignite-1.5

2015-11-10 Thread vkulichenko
Merge remote-tracking branch 'apache/ignite-1.5' into ignite-1.5


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/388a8921
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/388a8921
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/388a8921

Branch: refs/heads/master
Commit: 388a8921032af9e055a021e6f859c030eaaa5ea8
Parents: dbadb45 cb28819
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:48:14 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:48:14 2015 -0800

--
 .../GridCachePartitionExchangeManager.java  |  34 ++--
 .../dht/preloader/GridDhtPartitionDemander.java |  25 ++-
 .../GridCacheAtomicReferenceImpl.java   |   2 +-
 .../processors/igfs/IgfsMetaManager.java|   2 +-
 .../org/apache/ignite/stream/StreamAdapter.java |   2 +-
 .../store/GridCacheBalancingStoreSelfTest.java  | 181 ++-
 ...CacheAtomicReferenceApiSelfAbstractTest.java |  20 +-
 modules/rest-http/pom.xml   |  11 ++
 .../yardstick/config/ignite-store-config.xml|  31 ++--
 modules/zookeeper/pom.xml   |   2 +-
 10 files changed, 265 insertions(+), 45 deletions(-)
--




[2/6] ignite git commit: Warning is writeThrough==false && writeBehind==true

2015-11-10 Thread vkulichenko
Warning is writeThrough==false && writeBehind==true


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50ede23a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50ede23a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50ede23a

Branch: refs/heads/master
Commit: 50ede23a1079271cd21c338968bf936623416a16
Parents: 3de9d47
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:44:27 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:44:27 2015 -0800

--
 .../store/GridCacheStoreManagerAdapter.java | 26 ++--
 1 file changed, 19 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/50ede23a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
index 174e1ce..dd54da5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
@@ -188,12 +188,24 @@ public abstract class GridCacheStoreManagerAdapter 
extends GridCacheManagerAdapt
 
 CacheConfiguration cfg = cctx.config();
 
-if (cfgStore != null && !cfg.isWriteThrough() && !cfg.isReadThrough()) 
{
-U.quietAndWarn(log,
-"Persistence store is configured, but both read-through and 
write-through are disabled. This " +
-"configuration makes sense if the store implements loadCache 
method only. If this is the " +
-"case, ignore this warning. Otherwise, fix the configuration 
for cache: " + cfg.getName(),
-"Persistence store is configured, but both read-through and 
write-through are disabled.");
+if (cfgStore != null) {
+if (!cfg.isWriteThrough() && !cfg.isReadThrough()) {
+U.quietAndWarn(log,
+"Persistence store is configured, but both read-through 
and write-through are disabled. This " +
+"configuration makes sense if the store implements 
loadCache method only. If this is the " +
+"case, ignore this warning. Otherwise, fix the 
configuration for the cache: " + cfg.getName(),
+"Persistence store is configured, but both read-through 
and write-through are disabled " +
+"for cache: " + cfg.getName());
+}
+
+if (!cfg.isWriteThrough() && cfg.isWriteBehindEnabled()) {
+U.quietAndWarn(log,
+"To enable write-behind mode for the cache store it's also 
required to set " +
+"CacheConfiguration.setWriteThrough(true) property, 
otherwise the persistence " +
+"store will be never updated. Consider fixing 
configuration for the cache: " + cfg.getName(),
+"Write-behind mode for the cache store also requires 
CacheConfiguration.setWriteThrough(true) " +
+"property. Fix configuration for the cache: " + 
cfg.getName());
+}
 }
 
 sesLsnrs = CU.startStoreSessionListeners(cctx.kernalContext(), 
cfg.getCacheStoreSessionListenerFactories());
@@ -1256,4 +1268,4 @@ public abstract class GridCacheStoreManagerAdapter 
extends GridCacheManagerAdapt
 }
 }
 }
-}
\ No newline at end of file
+}



[6/6] ignite git commit: Merge branch 'ignite-1.5'

2015-11-10 Thread vkulichenko
Merge branch 'ignite-1.5'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6a7d079b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6a7d079b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6a7d079b

Branch: refs/heads/master
Commit: 6a7d079b7c357d8120e2ae1fac78d6d492b17681
Parents: 0e1017b 388a892
Author: Valentin Kulichenko 
Authored: Tue Nov 10 16:50:29 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 16:50:29 2015 -0800

--
 .../store/GridCacheStoreManagerAdapter.java | 26 ++--
 1 file changed, 19 insertions(+), 7 deletions(-)
--




ignite git commit: Minor fix for StreamTransformer

2015-11-10 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master 6a7d079b7 -> 569dd21fc


Minor fix for StreamTransformer


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/569dd21f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/569dd21f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/569dd21f

Branch: refs/heads/master
Commit: 569dd21fc049be6cd89df0f24551818ba88f0329
Parents: 6a7d079
Author: Valentin Kulichenko 
Authored: Tue Nov 10 17:45:10 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 17:45:10 2015 -0800

--
 .../main/java/org/apache/ignite/stream/StreamTransformer.java| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/569dd21f/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
index f0f41bf..4435c0a 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
@@ -37,7 +37,7 @@ public abstract class StreamTransformer implements 
StreamReceiver, E
 /** {@inheritDoc} */
 @Override public void receive(IgniteCache cache, 
Collection> entries) throws IgniteException {
 for (Map.Entry entry : entries)
-cache.invoke(entry.getKey(), this);
+cache.invoke(entry.getKey(), this, entry.getValue());
 }
 
 /**
@@ -53,4 +53,4 @@ public abstract class StreamTransformer implements 
StreamReceiver, E
 }
 };
 }
-}
\ No newline at end of file
+}



ignite git commit: Minor fix for StreamTransformer (JavaDoc)

2015-11-10 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master 569dd21fc -> 9f7286e2d


Minor fix for StreamTransformer (JavaDoc)


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9f7286e2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9f7286e2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9f7286e2

Branch: refs/heads/master
Commit: 9f7286e2d41e6bd91106b317c3b25a47292666aa
Parents: 569dd21
Author: Valentin Kulichenko 
Authored: Tue Nov 10 17:47:19 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 10 17:47:19 2015 -0800

--
 .../main/java/org/apache/ignite/stream/StreamTransformer.java   | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/9f7286e2/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java 
b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
index 4435c0a..176973e 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamTransformer.java
@@ -29,6 +29,11 @@ import org.apache.ignite.cache.CacheEntryProcessor;
 /**
  * Convenience adapter to transform update existing values in streaming cache
  * based on the previously cached value.
+ * 
+ * This transformer implement {@link EntryProcessor} and internally will call
+ * {@link IgniteCache#invoke(Object, EntryProcessor, Object...)} method. Note
+ * that the value received from the data streamer will be passed to the entry
+ * processor as an argument.
  */
 public abstract class StreamTransformer implements StreamReceiver, 
EntryProcessor {
 /** */



ignite git commit: Optimizations for direct marshalling

2015-11-15 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-direct-marsh-opt [created] 045bb6b57


Optimizations for direct marshalling


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/045bb6b5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/045bb6b5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/045bb6b5

Branch: refs/heads/ignite-direct-marsh-opt
Commit: 045bb6b578f6943e4e673d6be8e79eb6beb0f889
Parents: 5a116cb
Author: Valentin Kulichenko 
Authored: Sun Nov 15 22:30:23 2015 -0800
Committer: Valentin Kulichenko 
Committed: Sun Nov 15 22:33:59 2015 -0800

--
 .../internal/direct/DirectByteBufferStream.java | 154 +++
 1 file changed, 93 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/045bb6b5/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
index cf56430..0201298 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
@@ -286,6 +286,9 @@ public class DirectByteBufferStream {
 private Map map;
 
 /** */
+private long prim;
+
+/** */
 private boolean lastFinished;
 
 /** */
@@ -362,14 +365,27 @@ public class DirectByteBufferStream {
  * @param val Value.
  */
 public void writeInt(int val) {
-lastFinished = buf.remaining() >= 4;
+if (val == Integer.MAX_VALUE)
+val = Integer.MIN_VALUE;
+else
+val++;
+
+lastFinished = buf.remaining() >= 5;
 
 if (lastFinished) {
 int pos = buf.position();
 
-UNSAFE.putInt(heapArr, baseOff + pos, val);
+while ((val & 0xFF80) != 0) {
+byte b = (byte)(val | 0x80);
 
-buf.position(pos + 4);
+UNSAFE.putByte(heapArr, baseOff + pos++, b);
+
+val >>>= 7;
+}
+
+UNSAFE.putByte(heapArr, baseOff + pos++, (byte) val);
+
+buf.position(pos);
 }
 }
 
@@ -377,14 +393,22 @@ public class DirectByteBufferStream {
  * @param val Value.
  */
 public void writeLong(long val) {
-lastFinished = buf.remaining() >= 8;
+lastFinished = buf.remaining() >= 10;
 
 if (lastFinished) {
 int pos = buf.position();
 
-UNSAFE.putLong(heapArr, baseOff + pos, val);
+while ((val & 0xFF80L) != 0) {
+byte b = (byte)(val | 0x80);
 
-buf.position(pos + 8);
+UNSAFE.putByte(heapArr, baseOff + pos++, b);
+
+val >>>= 7;
+}
+
+UNSAFE.putByte(heapArr, baseOff + pos++, (byte) val);
+
+buf.position(pos);
 }
 }
 
@@ -747,34 +771,73 @@ public class DirectByteBufferStream {
  * @return Value.
  */
 public int readInt() {
-lastFinished = buf.remaining() >= 4;
+lastFinished = false;
 
-if (lastFinished) {
-int pos = buf.position();
+int val = 0;
 
-buf.position(pos + 4);
+int initPos = buf.position();
+int shift = 0;
+
+while (buf.hasRemaining()) {
+byte b = UNSAFE.getByte(heapArr, baseOff + initPos + shift);
+
+prim |= ((long)b & 0x7F) << (7 * shift);
+
+shift++;
 
-return UNSAFE.getInt(heapArr, baseOff + pos);
+if ((b & 0x80) == 0) {
+lastFinished = true;
+
+val = (int)prim;
+
+if (val == Integer.MIN_VALUE)
+val = Integer.MAX_VALUE;
+else
+val--;
+
+prim = 0;
+
+break;
+}
 }
-else
-return 0;
+
+buf.position(initPos + shift);
+
+return val;
 }
 
 /**
  * @return Value.
  */
 public long readLong() {
-lastFinished = buf.remaining() >= 8;
+lastFinished = false;
 
-if (lastFinished) {
-int pos = buf.position();
+long val = 0;
 
-buf.position(pos + 8);
+int initPos = buf.position();
+int shift = 0;
 
-return UNSAFE.getLong(heapArr, baseOff + pos);
+while (buf.hasRemaining()) {
+byte b = UNSAFE.getByte(heapArr, baseOff + initPos + shift);
+
+prim |= ((long)b & 0x7F) << (7 * shift);
+
+shift++;
+
+   

[4/9] ignite git commit: Merge remote-tracking branch 'origin/master'

2016-04-12 Thread vkulichenko
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8eed48b6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8eed48b6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8eed48b6

Branch: refs/heads/ignite-2949
Commit: 8eed48b6b5f65517764d4581d1a9fce3b582281b
Parents: 519ae63 96c8c24
Author: vozerov-gridgain 
Authored: Tue Apr 12 15:32:20 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 15:32:20 2016 +0300

--
 .../processors/cache/GridCacheProcessor.java| 35 +
 .../local/LocalAffinityFunctionTest.java| 80 
 .../ignite/testsuites/IgniteCacheTestSuite.java |  2 +
 3 files changed, 101 insertions(+), 16 deletions(-)
--




[5/9] ignite git commit: IGNITE-2101: Hadoop: Improved error messages when Hadoop module is not loaded. This closes #609.

2016-04-12 Thread vkulichenko
IGNITE-2101: Hadoop: Improved error messages when Hadoop module is not loaded. 
This closes #609.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cc0dbd16
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cc0dbd16
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cc0dbd16

Branch: refs/heads/ignite-2949
Commit: cc0dbd1617c905fc96058bdf43b90f52b04d5b0b
Parents: 8eed48b
Author: iveselovskiy 
Authored: Tue Apr 12 15:39:00 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 15:39:00 2016 +0300

--
 .../processors/hadoop/HadoopNoopProcessor.java  | 24 ++
 .../hadoop/HadoopNoHadoopMapReduceTest.java | 47 
 .../testsuites/IgniteHadoopTestSuite.java   |  2 +
 3 files changed, 65 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/cc0dbd16/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopNoopProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopNoopProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopNoopProcessor.java
index 72b5050..e772787 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopNoopProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopNoopProcessor.java
@@ -37,41 +37,49 @@ public class HadoopNoopProcessor extends 
HadoopProcessorAdapter {
 
 /** {@inheritDoc} */
 @Override public Hadoop hadoop() {
-throw new IllegalStateException("Hadoop module is not found in class 
path.");
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public HadoopConfiguration config() {
-return null;
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public HadoopJobId nextJobId() {
-return null;
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture submit(HadoopJobId jobId, 
HadoopJobInfo jobInfo) {
-return new GridFinishedFuture<>(new IgniteCheckedException("Hadoop is 
not available."));
+return new GridFinishedFuture<>(createException());
 }
 
 /** {@inheritDoc} */
 @Override public HadoopJobStatus status(HadoopJobId jobId) throws 
IgniteCheckedException {
-return null;
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public HadoopCounters counters(HadoopJobId jobId) {
-return null;
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public IgniteInternalFuture finishFuture(HadoopJobId jobId) 
throws IgniteCheckedException {
-return null;
+throw createException();
 }
 
 /** {@inheritDoc} */
 @Override public boolean kill(HadoopJobId jobId) throws 
IgniteCheckedException {
-return false;
+throw createException();
+}
+
+/**
+ * Creates an exception to be uniformly thrown from all the methods.
+ */
+private IllegalStateException createException() {
+return new IllegalStateException("Hadoop module is not loaded (please 
ensure that ignite-hadoop.jar is in " +
+"classpath and IgniteConfiguration.peerClassLoadingEnabled is set 
to false).");
 }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cc0dbd16/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopNoHadoopMapReduceTest.java
--
diff --git 
a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopNoHadoopMapReduceTest.java
 
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopNoHadoopMapReduceTest.java
new file mode 100644
index 000..0c172c3
--- /dev/null
+++ 
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopNoHadoopMapReduceTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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 expres

[9/9] ignite git commit: Merge branches 'ignite-2949' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-2949

2016-04-12 Thread vkulichenko
Merge branches 'ignite-2949' and 'master' of 
https://git-wip-us.apache.org/repos/asf/ignite into ignite-2949


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2c3d16d1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2c3d16d1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2c3d16d1

Branch: refs/heads/ignite-2949
Commit: 2c3d16d150ed4774b546ac79a0c6c0ce89c5175a
Parents: 650fa79 d9f4f6e
Author: Valentin Kulichenko 
Authored: Tue Apr 12 16:41:18 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 12 16:41:18 2016 -0700

--
 .../processors/cache/GridCacheProcessor.java|  35 +-
 .../processors/hadoop/HadoopNoopProcessor.java  |  24 +-
 .../processors/igfs/IgfsDeleteWorker.java   |  16 +-
 .../processors/igfs/IgfsIpcHandler.java |  12 +-
 .../processors/igfs/IgfsMetaManager.java|  26 +-
 .../internal/processors/igfs/IgfsUtils.java |  34 ++
 ...IgfsMetaDirectoryListingRemoveProcessor.java |   2 -
 .../platform/PlatformNoopProcessor.java |   4 +-
 .../platform/PlatformProcessorImpl.java |   9 +
 .../local/LocalAffinityFunctionTest.java|  80 
 .../ignite/igfs/IgfsEventsAbstractSelfTest.java |  26 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 .../hadoop/igfs/HadoopIgfsWrapper.java  |  11 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java|   2 +-
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |   6 +
 ...IgniteHadoopFileSystemHandshakeSelfTest.java | 121 --
 .../hadoop/HadoopAbstractMapReduceTest.java | 405 +++
 .../processors/hadoop/HadoopErrorSimulator.java | 326 +++
 .../HadoopMapReduceErrorResilienceTest.java | 154 +++
 .../processors/hadoop/HadoopMapReduceTest.java  | 380 +
 .../hadoop/HadoopNoHadoopMapReduceTest.java |  47 +++
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |   8 +
 .../hadoop/examples/HadoopWordCount1Map.java|  12 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   5 +
 .../hadoop/examples/HadoopWordCount2.java   |   2 +-
 .../examples/HadoopWordCount2Combiner.java  |  45 +++
 .../hadoop/examples/HadoopWordCount2Mapper.java |  19 +-
 .../examples/HadoopWordCount2Reducer.java   |  43 +-
 .../testsuites/IgniteHadoopTestSuite.java   |  10 +-
 .../Cache/Query/CacheQueriesTest.cs |  13 +-
 .../Compute/MixedClusterTest.cs | 122 --
 .../Config/cache-query.xml  |   2 +
 32 files changed, 1514 insertions(+), 489 deletions(-)
--




[8/9] ignite git commit: IGNITE-2354: Hadoop: Added tests for errors thrown on different MR stages. This closes #622.

2016-04-12 Thread vkulichenko
IGNITE-2354: Hadoop: Added tests for errors thrown on different MR stages. This 
closes #622.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d9f4f6e8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d9f4f6e8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d9f4f6e8

Branch: refs/heads/ignite-2949
Commit: d9f4f6e8dfdab37a730651b8850ebb976d4b1d72
Parents: 34fc271
Author: iveselovskiy 
Authored: Tue Apr 12 16:15:37 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 16:15:37 2016 +0300

--
 .../hadoop/HadoopAbstractMapReduceTest.java | 405 +++
 .../processors/hadoop/HadoopErrorSimulator.java | 326 +++
 .../HadoopMapReduceErrorResilienceTest.java | 154 +++
 .../processors/hadoop/HadoopMapReduceTest.java  | 380 +
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |   8 +
 .../hadoop/examples/HadoopWordCount1Map.java|  12 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   5 +
 .../hadoop/examples/HadoopWordCount2.java   |   2 +-
 .../examples/HadoopWordCount2Combiner.java  |  45 +++
 .../hadoop/examples/HadoopWordCount2Mapper.java |  19 +-
 .../examples/HadoopWordCount2Reducer.java   |  43 +-
 .../testsuites/IgniteHadoopTestSuite.java   |   8 +-
 12 files changed, 1038 insertions(+), 369 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/d9f4f6e8/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractMapReduceTest.java
--
diff --git 
a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractMapReduceTest.java
 
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractMapReduceTest.java
new file mode 100644
index 000..d09ec61
--- /dev/null
+++ 
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractMapReduceTest.java
@@ -0,0 +1,405 @@
+/*
+ * 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 java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.UUID;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.hadoop.fs.IgniteHadoopFileSystemCounterWriter;
+import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
+import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
+import org.apache.ignite.igfs.IgfsMode;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.igfs.IgfsUserContext;
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
+import 
org.apache.ignite.internal.processors.hadoop.counter.HadoopPerformanceCounter;
+import org.apache.ignite.internal.processors.hadoop.examples.HadoopWordCount1;
+import org.apache.ignite.internal.processors.hadoop.examples.HadoopWordCount2;
+import org.apache.ignite.internal.processors.igfs.IgfsEx;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.ap

[1/9] ignite git commit: IGNITE-2972 .NET: Fixed CacheQueriesTest.TestSqlQueryLocal sporadic failures. This closes #633.

2016-04-12 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2949 650fa795c -> 2c3d16d15


IGNITE-2972 .NET: Fixed CacheQueriesTest.TestSqlQueryLocal sporadic failures. 
This closes #633.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6578c8b1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6578c8b1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6578c8b1

Branch: refs/heads/ignite-2949
Commit: 6578c8b1e2dc57861da7ce448bc9f752ddecdf3a
Parents: 222f9c1
Author: Pavel Tupitsyn 
Authored: Tue Apr 12 15:09:57 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 15:09:57 2016 +0300

--
 .../Cache/Query/CacheQueriesTest.cs| 13 ++---
 .../Apache.Ignite.Core.Tests/Config/cache-query.xml|  2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/6578c8b1/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
--
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 8020649..6ed76678 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -27,7 +27,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 using Apache.Ignite.Core.Cache;
 using Apache.Ignite.Core.Cache.Query;
 using Apache.Ignite.Core.Common;
-using Apache.Ignite.Core.Impl;
 using Apache.Ignite.Core.Impl.Binary;
 using NUnit.Framework;
 
@@ -399,8 +398,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 var exp = PopulateCache(cache, loc, cnt, x => x < 50);
 
 // 2. Validate results.
-SqlQuery qry = loc ?  new SqlQuery(typeof(QueryPerson), "age < 
50", true) :
-new SqlQuery(typeof(QueryPerson), "age < 50");
+var qry = new SqlQuery(typeof(QueryPerson), "age < 50", loc);
 
 ValidateQueryResults(cache, qry, exp, keepBinary);
 }
@@ -666,7 +664,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 
 var qry = new ScanQuery { Partition = part };
 
-Console.WriteLine("Checking query on partition " + part);
 ValidateQueryResults(cache, qry, exp0, keepBinary);
 }
 
@@ -683,7 +680,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 
 var qry = new ScanQuery(new ScanQueryFilter()) { 
Partition = part };
 
-Console.WriteLine("Checking predicate query on partition " + 
part);
 ValidateQueryResults(cache, qry, exp0, keepBinary);
 }
 
@@ -831,14 +827,17 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
 
 var exp = new HashSet();
 
+var aff = cache.Ignite.GetAffinity(cache.Name);
+
+var localNode = cache.Ignite.GetCluster().GetLocalNode();
+
 for (var i = 0; i < cnt; i++)
 {
 var val = rand.Next(100);
 
 cache.Put(val, new QueryPerson(val.ToString(), val));
 
-if (expectedEntryFilter(val) && (!loc || 
cache.Ignite.GetAffinity(cache.Name)
-.IsPrimary(cache.Ignite.GetCluster().GetLocalNode(), val)))
+if (expectedEntryFilter(val) && (!loc || 
aff.IsPrimary(localNode, val)))
 exp.Add(val);
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6578c8b1/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml
--
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml
index 08d36e2..b0dc48f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml
@@ -28,6 +28,7 @@
 
 
 
+
 
 
 
@@ -52,6 +53,7 @@
 
 
 
+
 
 
 



[3/9] ignite git commit: IGNITE-1679: IGFS: Restored PURGE events. This closes #262. This closes #605.

2016-04-12 Thread vkulichenko
IGNITE-1679: IGFS: Restored PURGE events. This closes #262. This closes #605.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/519ae631
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/519ae631
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/519ae631

Branch: refs/heads/ignite-2949
Commit: 519ae631e1931f227111d50c4709bbd70ae4d781
Parents: 6578c8b
Author: iveselovskiy 
Authored: Tue Apr 12 15:32:06 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 15:32:06 2016 +0300

--
 .../processors/igfs/IgfsDeleteWorker.java   | 16 +++--
 .../processors/igfs/IgfsMetaManager.java| 26 +++
 .../internal/processors/igfs/IgfsUtils.java | 34 
 ...IgfsMetaDirectoryListingRemoveProcessor.java |  2 --
 .../ignite/igfs/IgfsEventsAbstractSelfTest.java | 26 +++
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |  6 
 6 files changed, 86 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/519ae631/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
index e5914e0..aef60dd 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.igfs;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.IgniteFutureCancelledCheckedException;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import 
org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
@@ -39,6 +40,7 @@ import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
 import static org.apache.ignite.internal.GridTopic.TOPIC_IGFS;
+import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_PURGED;
 
 /**
  * IGFS worker for removal from the trash directory.
@@ -167,7 +169,7 @@ public class IgfsDeleteWorker extends IgfsThread {
 try {
 info = meta.info(trashId);
 }
-catch(ClusterTopologyServerNotFoundException e) {
+catch (ClusterTopologyServerNotFoundException e) {
 LT.warn(log, e, "Server nodes not found.");
 }
 catch (IgniteCheckedException e) {
@@ -245,7 +247,17 @@ public class IgfsDeleteWorker extends IgfsThread {
 // In case this node crashes, other node will re-delete 
the file.
 data.delete(lockedInfo).get();
 
-return meta.delete(trashId, name, id);
+boolean ret = meta.delete(trashId, name, id);
+
+if (ret) {
+IgfsPath path = 
IgfsUtils.extractOriginalPathFromTrash(name);
+
+assert path != null;
+
+IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, 
EVT_IGFS_FILE_PURGED);
+}
+
+return ret;
 }
 }
 else

http://git-wip-us.apache.org/repos/asf/ignite/blob/519ae631/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 7b1d68c..73d0887 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -968,7 +968,7 @@ public class IgfsMetaManager extends IgfsManager {
  * @param destParentId New parent directory ID.
  * @throws IgniteCheckedException If failed.
  */
-private void moveNonTx(IgniteUuid fileId, @Nullable String srcFileName, 
IgniteUuid srcParentId, String destFileName,
+private void moveNonTx(IgniteUuid fileId, String srcFileName, IgniteUuid 
srcParentId, String destFileName,
 IgniteUuid destParentId) throws IgniteCheckedException {
 validTxState(true);
 
@@ -1139,7 +1139,8 @@ public class IgfsMetaManager extends IgfsManager {
 
 // Prepare trash data.
 

[6/9] ignite git commit: IGNITE-1566: IGFS: Improved error message when IGFS name is not specified in URL. This closes #216.

2016-04-12 Thread vkulichenko
IGNITE-1566: IGFS: Improved error message when IGFS name is not specified in 
URL. This closes #216.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/18077e07
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/18077e07
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/18077e07

Branch: refs/heads/ignite-2949
Commit: 18077e073c130966e61b221a35527f8217377ebe
Parents: cc0dbd1
Author: iveselovskiy 
Authored: Tue Apr 12 16:00:36 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Apr 12 16:00:36 2016 +0300

--
 .../processors/igfs/IgfsIpcHandler.java |  12 +-
 .../hadoop/igfs/HadoopIgfsWrapper.java  |  11 +-
 .../ignite/igfs/Hadoop1DualAbstractTest.java|   2 +-
 ...IgniteHadoopFileSystemHandshakeSelfTest.java | 121 +++
 4 files changed, 113 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/18077e07/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
index bf87384..a888aff 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
@@ -257,13 +257,13 @@ class IgfsIpcHandler implements IgfsServerHandler {
  * @throws IgniteCheckedException In case of handshake failure.
  */
 private IgfsMessage processHandshakeRequest(IgfsHandshakeRequest req) 
throws IgniteCheckedException {
-if (!F.eq(ctx.gridName(), req.gridName()))
-throw new IgniteCheckedException("Failed to perform handshake 
because actual Grid name differs from expected " +
-"[expected=" + req.gridName() + ", actual=" + ctx.gridName() + 
']');
+if (req.gridName() != null && !F.eq(ctx.gridName(), req.gridName()))
+throw new IgniteCheckedException("Failed to perform handshake 
because existing Grid name " +
+"differs from requested [requested=" + req.gridName() + ", 
existing=" + ctx.gridName() + ']');
 
-if (!F.eq(igfs.name(), req.igfsName()))
-throw new IgniteCheckedException("Failed to perform handshake 
because actual IGFS name differs from expected " +
-"[expected=" + req.igfsName() + ", actual=" + igfs.name() + 
']');
+if (req.igfsName() != null && !F.eq(igfs.name(), req.igfsName()))
+throw new IgniteCheckedException("Failed to perform handshake 
because existing IGFS name " +
+"differs from requested [requested=" + req.igfsName() + ", 
existing=" + igfs.name() + ']');
 
 IgfsControlResponse res = new IgfsControlResponse();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/18077e07/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsWrapper.java
--
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsWrapper.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsWrapper.java
index 69df381..f4ee97f 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsWrapper.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsWrapper.java
@@ -19,16 +19,15 @@ package org.apache.ignite.internal.processors.hadoop.igfs;
 
 import java.io.IOException;
 import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import org.apache.commons.logging.Log;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.IgniteIllegalStateException;
-import org.apache.ignite.IgniteState;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsFile;
@@ -38,6 +37,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsEx;
 import org.apache.ignite.internal.processors.igfs.IgfsHandshakeResponse;
 import org.apache.ignite.internal.processors.igfs.IgfsStatus;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 i

ignite git commit: IGNITE-2949 - Replaced JCache dependency with Geronimo

2016-04-12 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2949 2c3d16d15 -> 6f9c483f7


IGNITE-2949 - Replaced JCache dependency with Geronimo


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6f9c483f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6f9c483f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6f9c483f

Branch: refs/heads/ignite-2949
Commit: 6f9c483f77e42a789c3bf67b9b69040af33d1ca8
Parents: 2c3d16d
Author: Valentin Kulichenko 
Authored: Tue Apr 12 16:42:01 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 12 16:42:01 2016 -0700

--
 examples/pom.xml   | 2 +-
 examples/schema-import/pom.xml | 2 +-
 modules/core/pom.xml   | 2 +-
 parent/pom.xml | 1 -
 4 files changed, 3 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/6f9c483f/examples/pom.xml
--
diff --git a/examples/pom.xml b/examples/pom.xml
index 32a124f..1c03a24 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -34,7 +34,7 @@
 
 org.apache.geronimo.specs
 geronimo-jcache_1.0_spec
-${geronimo.jcache.version}
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6f9c483f/examples/schema-import/pom.xml
--
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index bca2a78..eb1236d 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -41,7 +41,7 @@
 
 org.apache.geronimo.specs
 geronimo-jcache_1.0_spec
-${geronimo.jcache.version}
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6f9c483f/modules/core/pom.xml
--
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index d928966..82e20ad 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -65,7 +65,7 @@
 
 org.apache.geronimo.specs
 geronimo-jcache_1.0_spec
-${geronimo.jcache.version}
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6f9c483f/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 04dec10..44a8ff7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -75,7 +75,6 @@
 4.4.3
 1.9.13
 1.0.0_1
-1.0-alpha-1
 9.2.11.v20150529
 1.1.1
 0.1.53_1



ignite git commit: IGNITE-2949 - Replaced JCache dependency with Geronimo

2016-04-12 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2949 6f9c483f7 -> ea0fdc9c9


IGNITE-2949 - Replaced JCache dependency with Geronimo


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ea0fdc9c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ea0fdc9c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ea0fdc9c

Branch: refs/heads/ignite-2949
Commit: ea0fdc9c947dc6164196f1f399ed61ddc07b7756
Parents: 6f9c483
Author: Valentin Kulichenko 
Authored: Tue Apr 12 19:16:40 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 12 19:16:40 2016 -0700

--
 assembly/LICENSE_FABRIC  | 8 +---
 assembly/LICENSE_HADOOP  | 6 --
 modules/flume/README.txt | 2 +-
 modules/kafka/README.txt | 4 ++--
 .../dotnet/Apache.Ignite.Core.Tests/DeploymentTest.cs| 4 ++--
 5 files changed, 6 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/ea0fdc9c/assembly/LICENSE_FABRIC
--
diff --git a/assembly/LICENSE_FABRIC b/assembly/LICENSE_FABRIC
index 3f92502..8cb5730 100644
--- a/assembly/LICENSE_FABRIC
+++ b/assembly/LICENSE_FABRIC
@@ -227,12 +227,6 @@ For details, see CC0 1.0 Universal (1.0), Public Domain 
Dedication,
 http://creativecommons.org/publicdomain/zero/1.0/
 
 ==
-For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) 
javax.cache:cache-api:jar:1.0.0
-==
-This product bundles JSR107 API and SPI which is available under a:
-JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. For 
details, see https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt.
-
-==
 For JSch (http://www.jcraft.com/jsch/) com.jcraft:jsch:jar:0.1.50
 ==
 This product bundles JSch which is available under a:
@@ -303,4 +297,4 @@ Eclipse Public License - Version 1.0. For details, see 
http://www.eclipse.org/or
 For SLF4J API Module (http://www.slf4j.org) org.slf4j:slf4j-api:jar:1.6.4
 ==
 This product bundles SLF4J API Module which is available under a:
-MIT License. For details, see 
http://www.opensource.org/licenses/mit-license.php.
\ No newline at end of file
+MIT License. For details, see 
http://www.opensource.org/licenses/mit-license.php.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea0fdc9c/assembly/LICENSE_HADOOP
--
diff --git a/assembly/LICENSE_HADOOP b/assembly/LICENSE_HADOOP
index 8d4cc62..0d05d52 100644
--- a/assembly/LICENSE_HADOOP
+++ b/assembly/LICENSE_HADOOP
@@ -227,12 +227,6 @@ For details, see CC0 1.0 Universal (1.0), Public Domain 
Dedication,
 http://creativecommons.org/publicdomain/zero/1.0/
 
 ==
-For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) 
javax.cache:cache-api:jar:1.0.0
-==
-This product bundles JSR107 API and SPI which is available under a:
-JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. For 
details, see https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt.
-
-==
 For JSch (http://www.jcraft.com/jsch/) com.jcraft:jsch:jar:0.1.50
 ==
 This product bundles JSch which is available under a:

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea0fdc9c/modules/flume/README.txt
--
diff --git a/modules/flume/README.txt b/modules/flume/README.txt
index bf7e0ff..97d8cac 100644
--- a/modules/flume/README.txt
+++ b/modules/flume/README.txt
@@ -20,7 +20,7 @@ plugins.d/
 |-- lib
 |   `-- ignite-flume-transformer-x.x.x.jar <-- your jar
 `-- libext
-|-- cache-api-1.0.0.jar
+|-- geronimo-jcache_1.0_spec-1.0-alpha-1.jar
 |-- ignite-core-x.x.x.jar
 |-- ignite-flume-x.x.x.jar <-- IgniteSink
 |-- ignite-spring-x.x.x.jar

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea0fdc9c/modules/kafka/README.txt
--
diff --git a/modules/kafka/README.txt b/modules/kafka/REA

ignite git commit: IGNITE-3057 - Optimization for transactions that do not acquire locks

2016-04-26 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-3057 [created] 87a1480cb


IGNITE-3057 - Optimization for transactions that do not acquire locks


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/87a1480c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/87a1480c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/87a1480c

Branch: refs/heads/ignite-3057
Commit: 87a1480cb84adbd81f924a753748ce4280ceda6c
Parents: 3be3d16
Author: Valentin Kulichenko 
Authored: Tue Apr 26 18:55:44 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 26 18:55:44 2016 -0700

--
 .../cache/distributed/near/GridNearTxLocal.java | 25 
 .../cache/transactions/IgniteTxManager.java | 43 ++--
 2 files changed, 65 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/87a1480c/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 4aee6ad..470b1cc 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
@@ -72,6 +72,7 @@ import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.transactions.TransactionState.COMMITTED;
 import static org.apache.ignite.transactions.TransactionState.COMMITTING;
+import static org.apache.ignite.transactions.TransactionState.PREPARED;
 import static org.apache.ignite.transactions.TransactionState.PREPARING;
 import static org.apache.ignite.transactions.TransactionState.ROLLED_BACK;
 import static org.apache.ignite.transactions.TransactionState.ROLLING_BACK;
@@ -824,6 +825,18 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter 
{
 if (log.isDebugEnabled())
 log.debug("Committing near local tx: " + this);
 
+if (writeMap().isEmpty() && (optimistic() || readMap().isEmpty())) {
+state(PREPARING);
+state(PREPARED);
+state(COMMITTING);
+
+cctx.tm().fastFinishTx(this, true);
+
+state(COMMITTED);
+
+return new GridFinishedFuture<>((IgniteInternalTx)this);
+}
+
 prepareAsync();
 
 GridNearTxFinishFuture fut = commitFut;
@@ -869,6 +882,18 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter 
{
 if (log.isDebugEnabled())
 log.debug("Rolling back near tx: " + this);
 
+if (writeMap().isEmpty() && (optimistic() || readMap().isEmpty())) {
+state(PREPARING);
+state(PREPARED);
+state(ROLLING_BACK);
+
+cctx.tm().fastFinishTx(this, false);
+
+state(ROLLED_BACK);
+
+return new GridFinishedFuture<>((IgniteInternalTx)this);
+}
+
 GridNearTxFinishFuture fut = rollbackFut;
 
 if (fut != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/87a1480c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 7fbf253..3931208 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -85,15 +85,12 @@ import static 
org.apache.ignite.internal.processors.cache.GridCacheUtils.isNearE
 import static 
org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx.FinalizationStatus.RECOVERY_FINISH;
 import static 
org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx.FinalizationStatus.USER_FINISH;
 import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap;
-import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
-import static 
org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
 import static org.apache.ignite.transactions.TransactionState.ACTIVE;
 import static org.apache.ignite.transactions.TransactionState.COMMITTED;
 import static org.apache.ignite.transactions.TransactionState.COMMITTING;
 import static org.apac

ignite git commit: IGNITE-3024 - Fixed deadlock in ServiceProcessor

2016-04-27 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-3024 [created] 5053376ab


IGNITE-3024 - Fixed deadlock in ServiceProcessor


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5053376a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5053376a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5053376a

Branch: refs/heads/ignite-3024
Commit: 5053376ab0429eb867e4c47ff2ea7747ec67e287
Parents: f9bd9a3
Author: Valentin Kulichenko 
Authored: Wed Apr 27 20:55:19 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Apr 27 20:55:19 2016 -0700

--
 .../service/GridServiceProcessor.java   | 197 +++
 .../processors/service/GridServiceProxy.java|  15 +-
 .../processors/service/ServiceContextImpl.java  |  23 ++-
 3 files changed, 140 insertions(+), 95 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/5053376a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index eded5e1..2e4ae6e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -240,7 +240,11 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 
 for (ServiceContextImpl ctx : ctxs) {
 ctx.setCancelled(true);
-ctx.service().cancel(ctx);
+
+Service svc = ctx.service();
+
+if (svc != null)
+svc.cancel(ctx);
 
 ctx.executor().shutdownNow();
 }
@@ -653,7 +657,14 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 if (ctxs.isEmpty())
 return null;
 
-return (T)ctxs.iterator().next().service();
+for (ServiceContextImpl ctx : ctxs) {
+Service svc = ctx.service();
+
+if (svc != null)
+return (T)svc;
+}
+
+return null;
 }
 }
 
@@ -675,7 +686,12 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 if (ctxs.isEmpty())
 return null;
 
-return ctxs.iterator().next();
+for (ServiceContextImpl ctx : ctxs) {
+if (ctx.service() != null)
+return ctx;
+}
+
+return null;
 }
 }
 
@@ -695,11 +711,15 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 ServiceContextImpl ctx = serviceContext(name);
 
 if (ctx != null) {
-if (!svcItf.isAssignableFrom(ctx.service().getClass()))
-throw new IgniteException("Service does not implement 
specified interface [svcItf=" +
-svcItf.getName() + ", svcCls=" + 
ctx.service().getClass().getName() + ']');
+Service svc = ctx.service();
+
+if (svc != null) {
+if (!svcItf.isAssignableFrom(svc.getClass()))
+throw new IgniteException("Service does not implement 
specified interface [svcItf=" +
+svcItf.getName() + ", svcCls=" + 
svc.getClass().getName() + ']');
 
-return (T)ctx.service();
+return (T)svc;
+}
 }
 }
 
@@ -738,8 +758,12 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 synchronized (ctxs) {
 Collection res = new ArrayList<>(ctxs.size());
 
-for (ServiceContextImpl ctx : ctxs)
-res.add((T)ctx.service());
+for (ServiceContextImpl ctx : ctxs) {
+Service svc = ctx.service();
+
+if (svc != null)
+res.add((T)svc);
+}
 
 return res;
 }
@@ -911,8 +935,6 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 if (assignCnt == null)
 assignCnt = 0;
 
-Service svc = assigns.service();
-
 Collection ctxs;
 
 synchronized (locSvcs) {
@@ -922,6 +944,8 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 locSvcs.put(svcName, ctxs = new ArrayList<>());
 }
 
+Collection toInit = new ArrayList<>();
+
 synchronized (ctxs) {
 if (ctxs.size() > assignCnt) {
 int cancelCnt = ctxs.size() - assignCnt;
@@ -932,75 +956,84 @@ publ

ignite git commit: IGNITE-3024 - Typo

2016-04-28 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-3024 d99f189fd -> cf71130bc


IGNITE-3024 - Typo


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cf71130b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cf71130b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cf71130b

Branch: refs/heads/ignite-3024
Commit: cf71130bce8c5796b4706912ea1bc3e868846816
Parents: d99f189
Author: Valentin Kulichenko 
Authored: Thu Apr 28 16:24:09 2016 -0700
Committer: Valentin Kulichenko 
Committed: Thu Apr 28 16:24:09 2016 -0700

--
 .../processors/service/GridServiceNotFoundException.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/cf71130b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceNotFoundException.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceNotFoundException.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceNotFoundException.java
index e23db7c..f41bceb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceNotFoundException.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceNotFoundException.java
@@ -30,11 +30,11 @@ public class GridServiceNotFoundException extends 
IgniteCheckedException {
  * @param name Service name.
  */
 public GridServiceNotFoundException(String name) {
-super("Service node found: " + name);
+super("Service not found: " + name);
 }
 
 /** {@inheritDoc} */
 @Override public String toString() {
 return getClass() + ": " + getMessage();
 }
-}
\ No newline at end of file
+}



ignite git commit: IGNITE-1988 - Exception for explicit lock inside a transaction

2015-11-24 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 c23cda1d2 -> 4d29cb7f8


IGNITE-1988 - Exception for explicit lock inside a transaction


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4d29cb7f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4d29cb7f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4d29cb7f

Branch: refs/heads/ignite-1.5
Commit: 4d29cb7f87aafa505807f4b10cddd0264cdac85f
Parents: c23cda1
Author: Valentin Kulichenko 
Authored: Tue Nov 24 16:23:05 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 24 16:23:05 2015 -0800

--
 .../processors/cache/CacheLockImpl.java | 18 -
 .../colocated/GridDhtColocatedLockFuture.java   |  8 ++--
 .../cache/GridCacheAbstractFullApiSelfTest.java | 42 +++-
 3 files changed, 61 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/4d29cb7f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLockImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLockImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLockImpl.java
index 2e8dc9b..ae7b42e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLockImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLockImpl.java
@@ -69,6 +69,8 @@ class CacheLockImpl implements Lock {
 CacheOperationContext prev = gate.enter(opCtx);
 
 try {
+checkTx();
+
 delegate.lockAll(keys, 0);
 
 incrementLockCounter();
@@ -102,6 +104,8 @@ class CacheLockImpl implements Lock {
 CacheOperationContext prev = gate.enter(opCtx);
 
 try {
+checkTx();
+
 boolean res = delegate.lockAll(keys, -1);
 
 if (res)
@@ -128,6 +132,8 @@ class CacheLockImpl implements Lock {
 CacheOperationContext prev = gate.enter(opCtx);
 
 try {
+checkTx();
+
 IgniteInternalFuture fut = delegate.lockAllAsync(keys, 
unit.toMillis(time));
 
 try {
@@ -198,8 +204,18 @@ class CacheLockImpl implements Lock {
 throw new UnsupportedOperationException();
 }
 
+/**
+ * Verifies there is no ongoing user transaction.
+ *
+ * @throws CacheException
+ */
+private void checkTx() throws CacheException {
+if (delegate.context().tm().inUserTx())
+throw new CacheException("Explicit lock can't be acquired within a 
transaction.");
+}
+
 /** {@inheritDoc} */
 @Override public String toString() {
 return S.toString(CacheLockImpl.class, this);
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/4d29cb7f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 7e6ce89..ecdf641 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -296,10 +296,6 @@ public final class GridDhtColocatedLockFuture extends 
GridCompoundIdentityFuture
 GridCacheMvccCandidate cand = cctx.mvcc().explicitLock(threadId, 
txKey);
 
 if (inTx()) {
-IgniteTxEntry txEntry = tx.entry(txKey);
-
-txEntry.cached(entry);
-
 if (cand != null) {
 if (!tx.implicit())
 throw new IgniteCheckedException("Cannot access key within 
transaction if lock is " +
@@ -308,6 +304,10 @@ public final class GridDhtColocatedLockFuture extends 
GridCompoundIdentityFuture
 return null;
 }
 else {
+IgniteTxEntry txEntry = tx.entry(txKey);
+
+txEntry.cached(entry);
+
 // Check transaction entries (corresponding tx entries must be 
enlisted in transaction).
 cand = new GridCacheMvccCandidate(entry,
 cctx.localNodeId(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/4d29cb7f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfT

ignite git commit: Better exception message if Ignite is not started

2015-11-24 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5 4d29cb7f8 -> dafad526f


Better exception message if Ignite is not started


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dafad526
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dafad526
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dafad526

Branch: refs/heads/ignite-1.5
Commit: dafad526f84ecbf503135c7538ffef07dd5e1c4f
Parents: 4d29cb7
Author: Valentin Kulichenko 
Authored: Tue Nov 24 16:34:37 2015 -0800
Committer: Valentin Kulichenko 
Committed: Tue Nov 24 16:34:37 2015 -0800

--
 .../main/java/org/apache/ignite/internal/IgnitionEx.java| 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/dafad526/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 7d2b2dc..6bd74be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1187,8 +1187,8 @@ public class IgnitionEx {
 Ignite res;
 
 if (grid == null || (res = grid.grid()) == null)
-throw new IgniteIllegalStateException("Grid instance was not 
properly started " +
-"or was already stopped: " + name);
+throw new IgniteIllegalStateException("Ignite instance with 
provided name doesn't exist. " +
+"Did you call Ignition.start(..) to start an Ignite instance? 
[name=" + name + ']');
 
 return res;
 }
@@ -1205,7 +1205,8 @@ public class IgnitionEx {
 IgniteKernal res;
 
 if (grid == null || (res = grid.gridx()) == null)
-throw new IllegalStateException("Grid instance was not properly 
started or was already stopped: " + name);
+throw new IgniteIllegalStateException("Ignite instance with 
provided name doesn't exist. " +
+"Did you call Ignition.start(..) to start an Ignite instance? 
[name=" + name + ']');
 
 return res;
 }
@@ -2388,4 +2389,4 @@ public class IgnitionEx {
 }
 }
 }
-}
\ No newline at end of file
+}



ignite git commit: Update notifier fixes

2016-01-14 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5.4 cc3db3592 -> a5c85ca77


Update notifier fixes


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a5c85ca7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a5c85ca7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a5c85ca7

Branch: refs/heads/ignite-1.5.4
Commit: a5c85ca7749ae90af2e4a29e2162713b480e40fa
Parents: cc3db35
Author: Valentin Kulichenko 
Authored: Thu Jan 14 22:58:41 2016 -0800
Committer: Valentin Kulichenko 
Committed: Thu Jan 14 22:58:41 2016 -0800

--
 .../org/apache/ignite/internal/IgniteKernal.java|  4 ++--
 .../processors/cluster/ClusterProcessor.java| 16 +---
 2 files changed, 15 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a5c85ca7/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 d011d1f..6bba502 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
@@ -769,8 +769,6 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 
 startProcessor(clusterProc);
 
-fillNodeAttributes(clusterProc.updateNotifierEnabled());
-
 U.onGridStart();
 
 // Start and configure resource processor first as it contains 
resources used
@@ -871,6 +869,8 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 
provider.start(ctx.plugins().pluginContextForProvider(provider));
 }
 
+fillNodeAttributes(clusterProc.updateNotifierEnabled());
+
 gw.writeLock();
 
 try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5c85ca7/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
index 5e8e98d..0ed440e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
@@ -57,7 +57,7 @@ public class ClusterProcessor extends GridProcessorAdapter {
 private IgniteClusterImpl cluster;
 
 /** */
-private boolean notifyEnabled;
+private volatile boolean notifyEnabled;
 
 /** */
 @GridToStringExclude
@@ -155,6 +155,13 @@ public class ClusterProcessor extends GridProcessorAdapter 
{
 }
 
 /**
+ * Disables update notifier.
+ */
+public void disableUpdateNotifier() {
+notifyEnabled = false;
+}
+
+/**
  * @return Update notifier status.
  */
 public boolean updateNotifierEnabled() {
@@ -171,7 +178,7 @@ public class ClusterProcessor extends GridProcessorAdapter {
 /**
  * Update notifier timer task.
  */
-private static class UpdateNotifierTimerTask extends GridTimerTask {
+private class UpdateNotifierTimerTask extends GridTimerTask {
 /** Reference to kernal. */
 private final WeakReference kernalRef;
 
@@ -200,6 +207,9 @@ public class ClusterProcessor extends GridProcessorAdapter {
 
 /** {@inheritDoc} */
 @Override public void safeRun() throws InterruptedException {
+if (!notifyEnabled)
+return;
+
 if (!first) {
 IgniteKernal kernal = kernalRef.get();
 
@@ -228,4 +238,4 @@ public class ClusterProcessor extends GridProcessorAdapter {
 }
 }
 }
-}
\ No newline at end of file
+}



ignite git commit: Communication fixes

2016-01-15 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5.4-c [created] e03823953


Communication fixes


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e0382395
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e0382395
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e0382395

Branch: refs/heads/ignite-1.5.4-c
Commit: e03823953e5b8b54faadb65bfe27e4fc21f9c0ac
Parents: 6482dc8
Author: Valentin Kulichenko 
Authored: Fri Jan 15 18:58:33 2016 -0800
Committer: Valentin Kulichenko 
Committed: Fri Jan 15 18:58:33 2016 -0800

--
 .../internal/direct/DirectMessageWriter.java|  5 ++
 .../stream/v1/DirectByteBufferStreamImplV1.java |  2 +
 .../stream/v2/DirectByteBufferStreamImplV2.java |  2 +
 .../continuous/CacheContinuousQueryEntry.java   | 70 ++--
 .../ignite/internal/util/IgniteUtils.java   |  2 +
 .../ignite/internal/util/nio/GridNioServer.java |  8 +++
 .../extensions/communication/MessageWriter.java |  9 ++-
 7 files changed, 62 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/e0382395/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
index 085cf68..c960ad4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
@@ -58,6 +58,11 @@ public class DirectMessageWriter implements MessageWriter {
 }
 
 /** {@inheritDoc} */
+@Override public void setCurrentWriteClass(Class 
msgCls) {
+// No-op.
+}
+
+/** {@inheritDoc} */
 @Override public boolean writeHeader(byte type, byte fieldCnt) {
 DirectByteBufferStream stream = state.item().stream;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e0382395/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v1/DirectByteBufferStreamImplV1.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v1/DirectByteBufferStreamImplV1.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v1/DirectByteBufferStreamImplV1.java
index ad8671d..2ca3a23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v1/DirectByteBufferStreamImplV1.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v1/DirectByteBufferStreamImplV1.java
@@ -519,6 +519,8 @@ public class DirectByteBufferStreamImplV1 implements 
DirectByteBufferStream {
 try {
 writer.beforeInnerMessageWrite();
 
+writer.setCurrentWriteClass(msg.getClass());
+
 lastFinished = msg.writeTo(buf, writer);
 }
 finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e0382395/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
index 89c9cc6..489e7e1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/v2/DirectByteBufferStreamImplV2.java
@@ -618,6 +618,8 @@ public class DirectByteBufferStreamImplV2 implements 
DirectByteBufferStream {
 try {
 writer.beforeInnerMessageWrite();
 
+writer.setCurrentWriteClass(msg.getClass());
+
 lastFinished = msg.writeTo(buf, writer);
 }
 finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e0382395/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 bcc2576..4d3786a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/

ignite git commit: Communication fixes

2016-01-15 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5.4-c e03823953 -> 5936109cd


Communication fixes


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5936109c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5936109c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5936109c

Branch: refs/heads/ignite-1.5.4-c
Commit: 5936109cd07c714d97b8be6c5bff3efbf97518d0
Parents: e038239
Author: Valentin Kulichenko 
Authored: Fri Jan 15 21:38:21 2016 -0800
Committer: Valentin Kulichenko 
Committed: Fri Jan 15 21:38:21 2016 -0800

--
 .../org/apache/ignite/internal/util/IgniteUtils.java|  3 ++-
 .../apache/ignite/internal/util/nio/GridNioServer.java  | 12 
 2 files changed, 10 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/5936109c/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 58f0828..5784a4d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -9273,7 +9273,8 @@ public abstract class IgniteUtils {
 assert buf != null;
 assert buf.hasArray();
 
-writer.setCurrentWriteClass(msg.getClass());
+if (writer != null)
+writer.setCurrentWriteClass(msg.getClass());
 
 boolean finished = false;
 int cnt = 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5936109c/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 496c1e3..ce82323 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -1001,7 +1001,8 @@ public class GridNioServer {
 
 assert msg != null;
 
-writer.setCurrentWriteClass(msg.getClass());
+if (writer != null)
+writer.setCurrentWriteClass(msg.getClass());
 
 finished = msg.writeTo(buf, writer);
 
@@ -1025,7 +1026,8 @@ public class GridNioServer {
 
 assert msg != null;
 
-writer.setCurrentWriteClass(msg.getClass());
+if (writer != null)
+writer.setCurrentWriteClass(msg.getClass());
 
 finished = msg.writeTo(buf, writer);
 
@@ -1171,7 +1173,8 @@ public class GridNioServer {
 
 assert msg != null;
 
-writer.setCurrentWriteClass(msg.getClass());
+if (writer != null)
+writer.setCurrentWriteClass(msg.getClass());
 
 finished = msg.writeTo(buf, writer);
 
@@ -1197,7 +1200,8 @@ public class GridNioServer {
 
 assert msg != null;
 
-writer.setCurrentWriteClass(msg.getClass());
+if (writer != null)
+writer.setCurrentWriteClass(msg.getClass());
 
 finished = msg.writeTo(buf, writer);
 



ignite git commit: Communication fixes

2016-01-16 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5.4-c 5936109cd -> 1ff818f88


Communication fixes


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1ff818f8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1ff818f8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1ff818f8

Branch: refs/heads/ignite-1.5.4-c
Commit: 1ff818f8850aaf11b9ab016878232afb846f40be
Parents: 5936109
Author: Valentin Kulichenko 
Authored: Sat Jan 16 11:42:52 2016 -0800
Committer: Valentin Kulichenko 
Committed: Sat Jan 16 11:42:52 2016 -0800

--
 .../processors/continuous/AbstractContinuousMessage.java| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/1ff818f8/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
index 8aa683e..01a95df 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
@@ -25,6 +25,9 @@ import org.apache.ignite.lang.IgniteUuid;
  *
  */
 public abstract class AbstractContinuousMessage implements 
DiscoveryCustomMessage {
+/** */
+private static final long serialVersionUID = 2781778657738703012L;
+
 /** Routine ID. */
 protected final UUID routineId;
 
@@ -54,4 +57,4 @@ public abstract class AbstractContinuousMessage implements 
DiscoveryCustomMessag
 @Override public boolean isMutable() {
 return false;
 }
-}
\ No newline at end of file
+}



ignite git commit: IGNITE-2853 - Fixed cancellation of the job that depends on a service

2016-03-19 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master 69d1f4b77 -> d3420e6bc


IGNITE-2853 - Fixed cancellation of the job that depends on a service


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d3420e6b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d3420e6b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d3420e6b

Branch: refs/heads/master
Commit: d3420e6bc5e833a6eb1daaad25b11843f97328d5
Parents: 69d1f4b
Author: Valentin Kulichenko 
Authored: Wed Mar 16 22:21:24 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Mar 16 22:21:24 2016 -0700

--
 .../apache/ignite/internal/IgniteKernal.java|   2 +-
 .../ComputeJobCancelWithServiceSelfTest.java| 154 +++
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 3 files changed, 157 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/d3420e6b/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 5d8daf6..8df89f3 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
@@ -849,6 +849,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 startProcessor(createComponent(IgniteCacheObjectProcessor.class, 
ctx));
 startProcessor(new GridCacheProcessor(ctx));
 startProcessor(new GridQueryProcessor(ctx));
+startProcessor(new GridServiceProcessor(ctx));
 startProcessor(new GridTaskSessionProcessor(ctx));
 startProcessor(new GridJobProcessor(ctx));
 startProcessor(new GridTaskProcessor(ctx));
@@ -860,7 +861,6 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 startProcessor((GridProcessor)(cfg.isPeerClassLoadingEnabled() ?
 IgniteComponentType.HADOOP.create(ctx, true): // No-op when 
peer class loading is enabled.
 IgniteComponentType.HADOOP.createIfInClassPath(ctx, 
cfg.getHadoopConfiguration() != null)));
-startProcessor(new GridServiceProcessor(ctx));
 startProcessor(new DataStructuresProcessor(ctx));
 startProcessor(createComponent(PlatformProcessor.class, ctx));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d3420e6b/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
new file mode 100644
index 000..2718ed9
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
@@ -0,0 +1,154 @@
+/*
+ * 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;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobAdapter;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeTaskFuture;
+import org.apache.ignite.compute.ComputeTaskSplitAdapter;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.services.Service;
+import org.apache.ignite.services.ServiceContext;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ign

ignite git commit: IGNITE-2853 - Fixed cancellation of the job that depends on a service

2016-03-19 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2853 [created] 84c2681dc


IGNITE-2853 - Fixed cancellation of the job that depends on a service


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/84c2681d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/84c2681d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/84c2681d

Branch: refs/heads/ignite-2853
Commit: 84c2681dc161e06f27aa7d20082d19bb3af5e119
Parents: 69d1f4b
Author: Valentin Kulichenko 
Authored: Wed Mar 16 17:03:20 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Mar 16 17:03:20 2016 -0700

--
 .../apache/ignite/internal/IgniteKernal.java|   2 +-
 .../ComputeJobCancelWithServiceSelfTest.java| 154 +++
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 3 files changed, 157 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/84c2681d/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 5d8daf6..8df89f3 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
@@ -849,6 +849,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 startProcessor(createComponent(IgniteCacheObjectProcessor.class, 
ctx));
 startProcessor(new GridCacheProcessor(ctx));
 startProcessor(new GridQueryProcessor(ctx));
+startProcessor(new GridServiceProcessor(ctx));
 startProcessor(new GridTaskSessionProcessor(ctx));
 startProcessor(new GridJobProcessor(ctx));
 startProcessor(new GridTaskProcessor(ctx));
@@ -860,7 +861,6 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 startProcessor((GridProcessor)(cfg.isPeerClassLoadingEnabled() ?
 IgniteComponentType.HADOOP.create(ctx, true): // No-op when 
peer class loading is enabled.
 IgniteComponentType.HADOOP.createIfInClassPath(ctx, 
cfg.getHadoopConfiguration() != null)));
-startProcessor(new GridServiceProcessor(ctx));
 startProcessor(new DataStructuresProcessor(ctx));
 startProcessor(createComponent(PlatformProcessor.class, ctx));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/84c2681d/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
new file mode 100644
index 000..2718ed9
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/ComputeJobCancelWithServiceSelfTest.java
@@ -0,0 +1,154 @@
+/*
+ * 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;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCompute;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.compute.ComputeJob;
+import org.apache.ignite.compute.ComputeJobAdapter;
+import org.apache.ignite.compute.ComputeJobResult;
+import org.apache.ignite.compute.ComputeTaskFuture;
+import org.apache.ignite.compute.ComputeTaskSplitAdapter;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.services.Service;
+import org.apache.ignite.services.ServiceContext;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apa

[ignite] Git Push Summary

2016-03-19 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2853 [deleted] 84c2681dc


ignite git commit: IGNITE-2546 - Added transformers to SCAN queries

2016-03-22 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2546 [created] 5730c06ae


IGNITE-2546 - Added transformers to SCAN queries


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5730c06a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5730c06a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5730c06a

Branch: refs/heads/ignite-2546
Commit: 5730c06ae3d41edb00f46a6b103a421974eac1a9
Parents: 0013955
Author: Valentin Kulichenko 
Authored: Tue Mar 22 22:20:39 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Mar 22 22:20:39 2016 -0700

--
 .../java/org/apache/ignite/IgniteCache.java |  15 +
 .../processors/cache/IgniteCacheProxy.java  |  81 +++
 .../cache/query/GridCacheQueryManager.java  |  43 +-
 .../GridCacheQueryTransformerSelfTest.java  | 570 +++
 .../multijvm/IgniteCacheProcessProxy.java   |   8 +-
 .../IgniteCacheQuerySelfTestSuite.java  |   2 +
 6 files changed, 688 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/5730c06a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
--
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java 
b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index a791e38..5c4e37f 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -56,6 +56,7 @@ import org.apache.ignite.lang.IgniteAsyncSupport;
 import org.apache.ignite.lang.IgniteAsyncSupported;
 import org.apache.ignite.lang.IgniteBiInClosure;
 import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.mxbean.CacheMetricsMXBean;
 import org.jetbrains.annotations.Nullable;
@@ -289,6 +290,20 @@ public interface IgniteCache extends 
javax.cache.Cache, IgniteAsyncS
 public  QueryCursor query(Query qry);
 
 /**
+ * Queries the cache transforming the entries on the server nodes. Can be 
used, for example,
+ * to avoid network overhead in case only one field out of the large is 
required by client.
+ * 
+ * Currently transformers are supported ONLY for {@link ScanQuery}. 
Passing any other
+ * subclass of {@link Query} interface to this method will end up with
+ * {@link UnsupportedOperationException}.
+ *
+ * @param qry Query.
+ * @param transformer Transformer.
+ * @return Cursor.
+ */
+public  QueryCursor query(Query qry, IgniteClosure 
transformer);
+
+/**
  * Allows for iteration over local cache entries.
  *
  * @param peekModes Peek modes.

http://git-wip-us.apache.org/repos/asf/ignite/blob/5730c06a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 6e8bcbf..91a2ad9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -83,6 +83,7 @@ import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.mxbean.CacheMetricsMXBean;
 import org.apache.ignite.plugin.security.SecurityPermission;
@@ -449,6 +450,56 @@ public class IgniteCacheProxy extends 
AsyncSupportAdapter QueryCursor query(final ScanQuery filter, @Nullable 
ClusterGroup grp,
+final IgniteClosure transformer) throws IgniteCheckedException {
+boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary();
+
+IgniteBiPredicate p = filter.getFilter();
+
+final CacheQuery> qry = 
ctx.queries().createScanQuery(p, filter.getPartition(), isKeepBinary);
+
+if (grp != null)
+qry.projection(grp);
+
+final CacheQueryFuture fut = 
ctx.kernalContext().query().executeQuery(ctx,
+new IgniteOutClosureX>() {
+@Override public CacheQueryFuture applyx() throws 
IgniteCheckedException {
+return qry.execute(transformer);
+}
+}, false);
+
+return new QueryCursorImpl<>(new GridCloseableIteratorAdapter() {
+ 

[5/5] ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-2546

2016-03-23 Thread vkulichenko
Merge remote-tracking branch 'remotes/origin/master' into ignite-2546


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8302aa34
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8302aa34
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8302aa34

Branch: refs/heads/ignite-2546
Commit: 8302aa34f98f5b01aa9f9f334a8a912212722ce7
Parents: 07e7df9 66f9a34
Author: Valentin Kulichenko 
Authored: Wed Mar 23 15:31:29 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Mar 23 15:31:29 2016 -0700

--
 .../processors/cache/GridCacheMapEntry.java |  8 +--
 .../continuous/CacheContinuousQueryManager.java | 13 +++--
 .../continuous/GridContinuousProcessor.java |  2 +-
 .../platform/cache/PlatformCache.java   | 54 
 .../platform/utils/PlatformFutureUtils.java |  2 +-
 .../cache/IgniteCacheAbstractTest.java  |  6 +++
 .../IgniteCacheEntryListenerAbstractTest.java   | 16 +-
 .../distributed/IgniteCacheManyClientsTest.java |  6 +++
 ...ContinuousQueryFailoverAbstractSelfTest.java |  6 +++
 .../Cache/CacheTestAsyncWrapper.cs  | 12 +
 .../Cache/Store/CacheStoreTest.cs   | 31 +++
 .../Cache/Store/CacheTestStore.cs   |  2 +-
 .../dotnet/Apache.Ignite.Core/Cache/ICache.cs   | 26 ++
 .../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs  | 17 ++
 .../Apache.Ignite.Core/Impl/Cache/CacheOp.cs|  3 +-
 15 files changed, 192 insertions(+), 12 deletions(-)
--




[1/5] ignite git commit: IGNITE-2844: .NET: Added "LoadAll" methods to cache API. This closes #562.

2016-03-23 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2546 5730c06ae -> 8302aa34f


IGNITE-2844: .NET: Added "LoadAll" methods to cache API. This closes #562.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc9730a9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc9730a9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc9730a9

Branch: refs/heads/ignite-2546
Commit: fc9730a9ae33b36ee8b6430583b39f13dfdd16de
Parents: 0013955
Author: Pavel Tupitsyn 
Authored: Wed Mar 23 12:44:44 2016 +0300
Committer: vozerov-gridgain 
Committed: Wed Mar 23 12:44:44 2016 +0300

--
 .../platform/cache/PlatformCache.java   | 54 
 .../platform/utils/PlatformFutureUtils.java |  2 +-
 .../Cache/CacheTestAsyncWrapper.cs  | 12 +
 .../Cache/Store/CacheStoreTest.cs   | 31 +++
 .../Cache/Store/CacheTestStore.cs   |  2 +-
 .../dotnet/Apache.Ignite.Core/Cache/ICache.cs   | 26 ++
 .../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs  | 17 ++
 .../Apache.Ignite.Core/Impl/Cache/CacheOp.cs|  3 +-
 8 files changed, 144 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/fc9730a9/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index 37fd335..35ccd19 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -44,16 +44,19 @@ import 
org.apache.ignite.internal.processors.platform.cache.query.PlatformFields
 import 
org.apache.ignite.internal.processors.platform.cache.query.PlatformQueryCursor;
 import 
org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils;
 import 
org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils;
+import org.apache.ignite.internal.processors.platform.utils.PlatformListenable;
 import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
 import org.apache.ignite.internal.util.GridConcurrentFactory;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.typedef.C1;
+import org.apache.ignite.lang.IgniteBiInClosure;
 import org.apache.ignite.lang.IgniteFuture;
 import org.jetbrains.annotations.Nullable;
 
 import javax.cache.Cache;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
+import javax.cache.integration.CompletionListener;
 import javax.cache.processor.EntryProcessorException;
 import javax.cache.processor.EntryProcessorResult;
 import java.util.Iterator;
@@ -183,6 +186,9 @@ public class PlatformCache extends PlatformAbstractTarget {
 /** */
 public static final int OP_GET_CONFIG = 39;
 
+/** */
+public static final int OP_LOAD_ALL = 40;
+
 /** Underlying JCache. */
 private final IgniteCacheProxy cache;
 
@@ -369,6 +375,19 @@ public class PlatformCache extends PlatformAbstractTarget {
 case OP_IS_LOCAL_LOCKED:
 return cache.isLocalLocked(reader.readObjectDetached(), 
reader.readBoolean()) ? TRUE : FALSE;
 
+case OP_LOAD_ALL: {
+long futId = reader.readLong();
+boolean replaceExisting = reader.readBoolean();
+
+CompletionListenable fut = new CompletionListenable();
+
+PlatformFutureUtils.listen(platformCtx, fut, futId, 
PlatformFutureUtils.TYP_OBJ, null, this);
+
+cache.loadAll(PlatformUtils.readSet(reader), replaceExisting, 
fut);
+
+return TRUE;
+}
+
 default:
 return super.processInStreamOutLong(type, reader);
 }
@@ -1101,4 +1120,39 @@ public class PlatformCache extends 
PlatformAbstractTarget {
 }
 }
 }
+
+/**
+ * Listenable around CompletionListener.
+ */
+private static class CompletionListenable implements PlatformListenable, 
CompletionListener {
+/** */
+private IgniteBiInClosure lsnr;
+
+/** {@inheritDoc} */
+@Override public void onCompletion() {
+assert lsnr != null;
+
+lsnr.apply(null, null);
+}
+
+/** {@inheritDoc} */
+@Override public void onException(Exception e) {
+lsnr.apply(null, e);
+}
+
+/** {@inheritDoc} */
+@Override public void listen(IgniteBiInClosure 
lsnr) {

[2/5] ignite git commit: Reproducer.

2016-03-23 Thread vkulichenko
Reproducer.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b189bb2e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b189bb2e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b189bb2e

Branch: refs/heads/ignite-2546
Commit: b189bb2e15e7a54a890395b344bc7355e2f6d147
Parents: fc9730a
Author: vozerov-gridgain 
Authored: Wed Mar 23 18:01:01 2016 +0300
Committer: vozerov-gridgain 
Committed: Wed Mar 23 18:01:01 2016 +0300

--
 .../ignite/internal/processors/cache/GridCacheMapEntry.java  | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/b189bb2e/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 fb6aeef..6677c6a 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
@@ -2453,10 +2453,12 @@ public abstract class GridCacheMapEntry extends 
GridMetadataAwareAdapter impleme
 
 recordNodeId(affNodeId, topVer);
 
-updateCntr0 = nextPartCounter(topVer);
+if (hadVal) {
+updateCntr0 = nextPartCounter(topVer);
 
-if (updateCntr != null)
-updateCntr0 = updateCntr;
+if (updateCntr != null)
+updateCntr0 = updateCntr;
+}
 
 drReplicate(drType, null, newVer, topVer);
 



[4/5] ignite git commit: IGNITE-2546 - Added transformers to SCAN queries

2016-03-23 Thread vkulichenko
IGNITE-2546 - Added transformers to SCAN queries


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/07e7df99
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/07e7df99
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/07e7df99

Branch: refs/heads/ignite-2546
Commit: 07e7df9931a950b05165b5011a1b39c250020dfa
Parents: 5730c06
Author: Valentin Kulichenko 
Authored: Wed Mar 23 15:30:09 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Mar 23 15:30:09 2016 -0700

--
 .../cache/query/GridCacheQueryManager.java  | 31 +++-
 1 file changed, 24 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/07e7df99/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 786052a..de9d6da 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
@@ -1341,8 +1341,10 @@ public abstract class GridCacheQueryManager 
extends GridCacheManagerAdapte
 // Preparing query closures.
 IgniteClosure, Object> trans =
 (IgniteClosure, 
Object>)qryInfo.transformer();
+IgniteReducer, Object> rdc = 
(IgniteReducer, Object>)qryInfo.reducer();
 
 injectResources(trans);
+injectResources(rdc);
 
 GridCacheQueryAdapter qry = qryInfo.query();
 
@@ -1503,15 +1505,26 @@ public abstract class GridCacheQueryManager 
extends GridCacheManagerAdapte
 }
 }
 
-// Unwrap entry for transformer only.
-if (trans != null) {
+// Unwrap entry for transformer or reducer only.
+if (trans != null || rdc != null) {
 key = (K)cctx.unwrapBinaryIfNeeded(key, 
qry.keepBinary());
 val = (V)cctx.unwrapBinaryIfNeeded(val, 
qry.keepBinary());
+}
+
+if (rdc != null) {
+if (!rdc.collect(F.t(key, val)) || !iter.hasNext()) {
+onPageReady(loc, qryInfo, 
Collections.singletonList(rdc.reduce()), true, null);
 
-data.add(trans.apply(new CacheEntryImpl<>(key, val)));
+pageSent = true;
+
+break;
+}
+else
+continue;
 }
-else
-data.add(!loc ? new GridCacheQueryResponseEntry<>(key, 
val) : F.t(key, val));
+
+data.add(trans != null ? trans.apply(new 
CacheEntryImpl<>(key, val)) :
+!loc ? new GridCacheQueryResponseEntry<>(key, val) : 
F.t(key, val));
 
 if (!loc) {
 if (++cnt == pageSize || !iter.hasNext()) {
@@ -1535,8 +1548,12 @@ public abstract class GridCacheQueryManager 
extends GridCacheManagerAdapte
 }
 }
 
-if (!pageSent)
-onPageReady(loc, qryInfo, data, true, null);
+if (!pageSent) {
+if (rdc == null)
+onPageReady(loc, qryInfo, data, true, null);
+else
+onPageReady(loc, qryInfo, 
Collections.singletonList(rdc.reduce()), true, null);
+}
 }
 catch (Throwable e) {
 if (!X.hasCause(e, GridDhtUnreservedPartitionException.class))



[3/5] ignite git commit: Fixed tests.

2016-03-23 Thread vkulichenko
Fixed tests.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/66f9a34b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/66f9a34b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/66f9a34b

Branch: refs/heads/ignite-2546
Commit: 66f9a34bfc13eb54822581aefcd2c687c5bc9245
Parents: b189bb2
Author: nikolay_tikhonov 
Authored: Wed Mar 23 19:45:51 2016 +0300
Committer: nikolay_tikhonov 
Committed: Wed Mar 23 19:46:16 2016 +0300

--
 .../continuous/CacheContinuousQueryManager.java | 13 +
 .../continuous/GridContinuousProcessor.java |  2 +-
 .../processors/cache/IgniteCacheAbstractTest.java   |  6 ++
 .../cache/IgniteCacheEntryListenerAbstractTest.java | 16 +++-
 .../distributed/IgniteCacheManyClientsTest.java |  6 ++
 ...acheContinuousQueryFailoverAbstractSelfTest.java |  6 ++
 6 files changed, 43 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/66f9a34b/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 869a51b..c01f636 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
@@ -489,7 +489,8 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
 false,
 false,
 loc,
-keepBinary);
+keepBinary,
+false);
 }
 
 /**
@@ -528,6 +529,7 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
 true,
 notifyExisting,
 loc,
+false,
 false);
 }
 
@@ -608,6 +610,7 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
  * @param internal Internal flag.
  * @param notifyExisting Notify existing flag.
  * @param loc Local flag.
+ * @param onStart Waiting topology exchange.
  * @return Continuous routine ID.
  * @throws IgniteCheckedException In case of error.
  */
@@ -619,7 +622,8 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
 boolean internal,
 boolean notifyExisting,
 boolean loc,
-final boolean keepBinary) throws IgniteCheckedException
+final boolean keepBinary,
+boolean onStart) throws IgniteCheckedException
 {
 cctx.checkSecurity(SecurityPermission.CACHE_READ);
 
@@ -650,7 +654,7 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
 pred).get();
 
 try {
-if (hnd.isQuery() && cctx.userCache())
+if (hnd.isQuery() && cctx.userCache() && !onStart)
 hnd.waitTopologyFuture(cctx.kernalContext());
 }
 catch (IgniteCheckedException e) {
@@ -905,7 +909,8 @@ public class CacheContinuousQueryManager extends 
GridCacheManagerAdapter {
 false,
 false,
 false,
-keepBinary
+keepBinary,
+onStart
 );
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/66f9a34b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index f2d6e1e..99e0bb5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -915,7 +915,7 @@ public class GridContinuousProcessor extends 
GridProcessorAdapter {
 if (proc != null) {
 GridCacheAdapter cache = 
ctx.cache().internalCache(hnd0.cacheName());
 
-if (cache != null && !cache.isLocal())
+if (cache != null && !cache.isLocal() && 
cache.context().userCache())
 req.addUpdateCounters(ctx.localNodeId(), 
cache.context().topology().updateCounters());
 }
  

ignite git commit: AWS test

2016-04-04 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/amazon-test [created] 5a50181da


AWS test


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a50181d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a50181d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a50181d

Branch: refs/heads/amazon-test
Commit: 5a50181da2d56a1a28f005580de789765f261a5b
Parents: 8d6b032
Author: Valentin Kulichenko 
Authored: Mon Apr 4 15:21:19 2016 -0700
Committer: Valentin Kulichenko 
Committed: Mon Apr 4 15:21:19 2016 -0700

--
 examples/pom.xml|  2 +-
 examples/schema-import/pom.xml  |  2 +-
 modules/aop/pom.xml |  4 +--
 modules/apache-license-gen/pom.xml  |  2 +-
 modules/aws/pom.xml |  2 +-
 modules/camel/pom.xml   |  2 +-
 modules/clients/pom.xml |  2 +-
 modules/cloud/pom.xml   |  2 +-
 modules/codegen/pom.xml |  2 +-
 modules/core/pom.xml|  2 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java|  8 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java  | 28 ++--
 .../tcp/TcpClientDiscoverySpiSelfTest.java  |  5 ++--
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 26 --
 .../TcpDiscoverySpiFailureTimeoutSelfTest.java  | 13 ++---
 modules/extdata/p2p/pom.xml |  2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |  4 +--
 modules/extdata/uri/pom.xml |  2 +-
 modules/flume/pom.xml   |  2 +-
 modules/gce/pom.xml |  2 +-
 modules/geospatial/pom.xml  | 10 +++
 modules/hadoop/pom.xml  |  2 +-
 modules/hibernate/pom.xml   |  2 +-
 modules/indexing/pom.xml| 10 +++
 modules/jcl/pom.xml |  4 +--
 modules/jms11/pom.xml   |  2 +-
 modules/jta/pom.xml |  2 +-
 modules/kafka/pom.xml   |  2 +-
 modules/log4j/pom.xml   |  2 +-
 modules/log4j2/pom.xml  |  4 +--
 modules/mesos/pom.xml   |  4 +--
 modules/mqtt/pom.xml|  2 +-
 modules/osgi-karaf/pom.xml  |  6 ++---
 modules/osgi-paxlogging/pom.xml |  2 +-
 modules/osgi/pom.xml| 10 +++
 modules/rest-http/pom.xml   |  2 +-
 modules/scalar-2.10/pom.xml |  2 +-
 modules/scalar/pom.xml  |  2 +-
 modules/schedule/pom.xml|  4 +--
 modules/schema-import/pom.xml   |  2 +-
 modules/slf4j/pom.xml   |  2 +-
 modules/spark-2.10/pom.xml  |  2 +-
 modules/spark/pom.xml   |  2 +-
 modules/spring/pom.xml  |  4 +--
 modules/ssh/pom.xml |  2 +-
 modules/tools/pom.xml   |  2 +-
 modules/twitter/pom.xml |  2 +-
 modules/urideploy/pom.xml   |  2 +-
 modules/visor-console-2.10/pom.xml  |  2 +-
 modules/visor-console/pom.xml   |  2 +-
 modules/visor-plugins/pom.xml   |  2 +-
 modules/web/pom.xml |  4 +--
 modules/yardstick/pom.xml   |  2 +-
 modules/yarn/pom.xml|  2 +-
 modules/zookeeper/pom.xml   |  2 +-
 pom.xml |  2 +-
 56 files changed, 91 insertions(+), 135 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/5a50181d/examples/pom.xml
--
diff --git a/examples/pom.xml b/examples/pom.xml
index 39eecd1..aeac52b 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
 
 
 ignite-examples
-1.5.0.final
+2.0.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5a50181d/examples/schema-import/pom.xml
--
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 910157d..0838512 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -35,7 +35,7 @@
 
 
 ignite-schema-import-demo
-1.5.0.final
+2.0.0-SNAPSHOT
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5a50181d/modules/aop/pom.xml
--

ignite git commit: IGNITE-2546 - Added transformers to SCAN queries

2016-04-04 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/amazon-test 5a50181da -> 0cfa3d18d


IGNITE-2546 - Added transformers to SCAN queries


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0cfa3d18
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0cfa3d18
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0cfa3d18

Branch: refs/heads/amazon-test
Commit: 0cfa3d18de85b466a345e24b0aac3733cf648188
Parents: 5a50181
Author: Valentin Kulichenko 
Authored: Mon Apr 4 17:07:01 2016 -0700
Committer: Valentin Kulichenko 
Committed: Mon Apr 4 17:07:01 2016 -0700

--
 .../processors/continuous/GridContinuousProcessor.java | 13 -
 .../ignite/spi/discovery/tcp/TcpDiscoverySpi.java  |  3 +--
 2 files changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/0cfa3d18/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 9bc9a38..99d4f87 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -395,7 +395,18 @@ public class GridContinuousProcessor extends 
GridProcessorAdapter {
 /** {@inheritDoc} */
 @Override @Nullable public Serializable collectDiscoveryData(UUID nodeId) {
 if (!nodeId.equals(ctx.localNodeId()) || !locInfos.isEmpty()) {
-DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos);
+Map> clientInfos0 = 
U.newHashMap(clientInfos.size());
+
+for (Map.Entry> e : 
clientInfos.entrySet()) {
+Map copy = 
U.newHashMap(e.getValue().size());
+
+for (Map.Entry e0 : 
e.getValue().entrySet())
+copy.put(e0.getKey(), e0.getValue());
+
+clientInfos0.put(e.getKey(), copy);
+}
+
+DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos0);
 
 // Collect listeners information (will be sent to joining node 
during discovery process).
 for (Map.Entry e : locInfos.entrySet()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0cfa3d18/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 1d55b54..5920d90 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.spi.discovery.tcp;
 
-import java.io.BufferedOutputStream;
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -1358,7 +1357,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter 
implements DiscoverySpi, T
 IOException err = null;
 
 try {
-marsh.marshal(msg, new 
BufferedOutputStream(sock.getOutputStream(), sock.getSendBufferSize()));
+marsh.marshal(msg, sock.getOutputStream());
 }
 catch (IOException e) {
 err = e;



ignite git commit: IGNITE-2949 - Replaced JCache dependency with Geronimo

2016-04-05 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/igntie-2949 [created] acb7aed2e


IGNITE-2949 - Replaced JCache dependency with Geronimo


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/acb7aed2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/acb7aed2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/acb7aed2

Branch: refs/heads/igntie-2949
Commit: acb7aed2e0f2ef261737adff2e552862351d03b3
Parents: 00a3937
Author: Valentin Kulichenko 
Authored: Tue Apr 5 12:43:42 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 5 12:43:42 2016 -0700

--
 examples/pom-standalone-lgpl.xml  | 6 +++---
 examples/pom-standalone.xml   | 6 +++---
 examples/pom.xml  | 6 +++---
 examples/schema-import/pom-standalone.xml | 6 +++---
 examples/schema-import/pom.xml| 6 +++---
 modules/core/pom.xml  | 6 +++---
 parent/pom.xml| 2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/examples/pom-standalone-lgpl.xml
--
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
index 7e7ccc2..951fab6 100644
--- a/examples/pom-standalone-lgpl.xml
+++ b/examples/pom-standalone-lgpl.xml
@@ -41,9 +41,9 @@
 
 
 
-javax.cache
-cache-api
-1.0.0
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/examples/pom-standalone.xml
--
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index 6247ced..20399ee 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -41,9 +41,9 @@
 
 
 
-javax.cache
-cache-api
-1.0.0
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/examples/pom.xml
--
diff --git a/examples/pom.xml b/examples/pom.xml
index d8a38d8..32a124f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -32,9 +32,9 @@
 
 
 
-javax.cache
-cache-api
-${javax.cache.version}
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+${geronimo.jcache.version}
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/examples/schema-import/pom-standalone.xml
--
diff --git a/examples/schema-import/pom-standalone.xml 
b/examples/schema-import/pom-standalone.xml
index e443728..43b76d8 100644
--- a/examples/schema-import/pom-standalone.xml
+++ b/examples/schema-import/pom-standalone.xml
@@ -36,9 +36,9 @@
 
 
 
-javax.cache
-cache-api
-1.0.0
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+1.0-alpha-1
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/examples/schema-import/pom.xml
--
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 62bb773..bca2a78 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -39,9 +39,9 @@
 
 
 
-javax.cache
-cache-api
-${javax.cache.version}
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+${geronimo.jcache.version}
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/modules/core/pom.xml
--
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 3c16366..d928966 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -63,9 +63,9 @@
 
 
 
-javax.cache
-cache-api
-${javax.cache.version}
+org.apache.geronimo.specs
+geronimo-jcache_1.0_spec
+${geronimo.jcache.version}
 
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/acb7aed2/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index ebc94f4..04dec10 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -75,7 +75,7 @@
 4.4.3
 1.9.13
 1.0.0_1
-  

[22/47] ignite git commit: IGNITE-2813: IGFS: Optimized metadata values splitting file and directory into separate classes.

2016-04-05 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfa7bf6c/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
index 06ae40b..013bb18 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
@@ -17,12 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
-import java.nio.ByteBuffer;
-import java.security.SecureRandom;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.concurrent.Callable;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -44,6 +38,13 @@ import 
org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.jetbrains.annotations.Nullable;
 
+import java.nio.ByteBuffer;
+import java.security.SecureRandom;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.Callable;
+
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -168,8 +169,8 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 long t = System.currentTimeMillis();
 
-IgfsFileInfo info = new IgfsFileInfo(200, 0L, null, 
IgfsUtils.DELETE_LOCK_ID,
-false, null, t, t);
+IgfsEntryInfo info = IgfsUtils.createFile(IgniteUuid.randomUuid(), 
200, 0L, null,
+IgfsUtils.DELETE_LOCK_ID, false, null, t, t);
 
 assertNull(mgr.dataBlock(info, path, 0, null).get());
 
@@ -181,11 +182,11 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 expectsStoreFail(info, data, "Not enough space reserved to store 
data");
 
-info = new IgfsFileInfo(info, info.length() + data.length - 3);
+info = info.length(info.length() + data.length - 3);
 
 expectsStoreFail(info, data, "Not enough space reserved to store 
data");
 
-info = new IgfsFileInfo(info, info.length() + 3);
+info = info.length(info.length() + 3);
 
 IgfsFileAffinityRange range = new IgfsFileAffinityRange();
 
@@ -253,8 +254,8 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 long t = System.currentTimeMillis();
 
-IgfsFileInfo info = new IgfsFileInfo(blockSize, 0L, null, 
IgfsUtils.DELETE_LOCK_ID,
-false, null, t, t);
+IgfsEntryInfo info = IgfsUtils.createFile(IgniteUuid.randomUuid(), 
blockSize, 0L, null,
+IgfsUtils.DELETE_LOCK_ID, false, null, t, t);
 
 assertNull(mgr.dataBlock(info, path, 0, null).get());
 
@@ -266,7 +267,7 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 rnd.nextBytes(remainder);
 
-info = new IgfsFileInfo(info, info.length() + data.length + 
remainder.length);
+info = info.length(info.length() + data.length + remainder.length);
 
 IgniteInternalFuture fut = mgr.writeStart(info);
 
@@ -279,7 +280,7 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 byte[] remainder2 = new byte[blockSize / 2];
 
-info = new IgfsFileInfo(info, info.length() + remainder2.length);
+info = info.length(info.length() + remainder2.length);
 
 byte[] left2 = mgr.storeDataBlocks(info, info.length(), left, 
left.length, ByteBuffer.wrap(remainder2),
 false, range, null);
@@ -344,9 +345,8 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 long t = System.currentTimeMillis();
 
-IgfsFileInfo info =
-new IgfsFileInfo(blockSize, 0L, null, IgfsUtils.DELETE_LOCK_ID,
-false, null, t, t);
+IgfsEntryInfo info = IgfsUtils.createFile(IgniteUuid.randomUuid(), 
blockSize, 0L, null,
+IgfsUtils.DELETE_LOCK_ID, false, null, t, t);
 
 IgfsFileAffinityRange range = new IgfsFileAffinityRange();
 
@@ -356,7 +356,7 @@ public class IgfsDataManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 byte[] data = new byte[chunkSize];
 
-info = new IgfsFileInfo(info, info.length() + data.length * 
writesCnt);
+info = info.length(info.length() + da

[26/47] ignite git commit: IGNITE-2861: IGFS: Moved metadata processors into separate top-level classes to simplify code. Also cleaned up IgfsMetaManager from unused code.

2016-04-05 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/ignite/blob/9a4b5bd7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileLockProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileLockProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileLockProcessor.java
new file mode 100644
index 000..43a5d7d
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileLockProcessor.java
@@ -0,0 +1,63 @@
+package org.apache.ignite.internal.processors.igfs.meta;
+
+import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteUuid;
+
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * File lock entry processor.
+ */
+public class IgfsMetaFileLockProcessor implements EntryProcessor,
+Externalizable {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Lock Id. */
+private IgniteUuid lockId;
+
+/**
+ * Default constructor.
+ */
+public IgfsMetaFileLockProcessor() {
+// No-op.
+}
+
+/**
+ * Constructor.
+ *
+ * @param lockId Lock ID.
+ */
+public IgfsMetaFileLockProcessor(IgniteUuid lockId) {
+this.lockId = lockId;
+}
+
+/** {@inheritDoc} */
+@Override public IgfsEntryInfo process(MutableEntry entry, Object... args)
+throws EntryProcessorException {
+IgfsEntryInfo oldInfo = entry.getValue();
+
+IgfsEntryInfo newInfo = oldInfo.lock(lockId);
+
+entry.setValue(newInfo);
+
+return newInfo;
+}
+
+/** {@inheritDoc} */
+@Override public void writeExternal(ObjectOutput out) throws IOException {
+U.writeGridUuid(out, lockId);
+}
+
+/** {@inheritDoc} */
+@Override public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+lockId = U.readGridUuid(in);
+}
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a4b5bd7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileRangeDeleteProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileRangeDeleteProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileRangeDeleteProcessor.java
new file mode 100644
index 000..5af09e5
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaFileRangeDeleteProcessor.java
@@ -0,0 +1,74 @@
+package org.apache.ignite.internal.processors.igfs.meta;
+
+import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
+import org.apache.ignite.internal.processors.igfs.IgfsFileAffinityRange;
+import org.apache.ignite.internal.processors.igfs.IgfsFileMap;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteUuid;
+
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Delete range processor.
+ */
+public class IgfsMetaFileRangeDeleteProcessor implements 
EntryProcessor,
+Externalizable {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Range. */
+private IgfsFileAffinityRange range;
+
+/**
+ * Constructor.
+ */
+public IgfsMetaFileRangeDeleteProcessor() {
+// No-op.
+}
+
+/**
+ * Constructor.
+ *
+ * @param range Range.
+ */
+public IgfsMetaFileRangeDeleteProcessor(IgfsFileAffinityRange range) {
+this.range = range;
+}
+
+/** {@inheritDoc} */
+@Override public IgfsEntryInfo process(MutableEntry entry, Object... args)
+throws EntryProcessorException {
+IgfsEntryInfo oldInfo = entry.getValue();
+
+IgfsFileMap newMap = new IgfsFileMap(oldInfo.fileMap());
+
+newMap.deleteRange(range);
+
+IgfsEntryInfo newInfo = oldInfo.fileMap(newMap);
+
+entry.setValue(newInfo);
+
+return newInfo;
+}
+
+/** {@inheritDoc} */
+@Override public void writeExternal(ObjectOutput out) throws IOException {
+out.writeObject(range);
+}
+
+/** {@inheritDoc} */
+@Override public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
+range = (IgfsFileAffinityRan

[37/47] ignite git commit: IGNITE-2876: Fixed possible starvation in system pool caused by IgfsBlockMessage. This closes #575.

2016-04-05 Thread vkulichenko
IGNITE-2876: Fixed possible starvation in system pool caused by 
IgfsBlockMessage. This closes #575.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/01a6e86e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/01a6e86e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/01a6e86e

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 01a6e86ec4e19d372b8efbc5c497c84f4238a46c
Parents: 00a0e4b
Author: vozerov-gridgain 
Authored: Thu Mar 24 13:28:30 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:27 2016 +0300

--
 .../managers/communication/GridIoManager.java   |  11 +
 .../managers/communication/GridIoPolicy.java|   3 +
 .../processors/igfs/IgfsDataManager.java|  29 +-
 .../processors/igfs/IgfsDeleteWorker.java   |   2 +-
 .../igfs/IgfsFragmentizerManager.java   |   4 +-
 ...lockMessageSystemPoolStarvationSelfTest.java | 299 +++
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   3 +
 7 files changed, 329 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/01a6e86e/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 0438b64..8ba6a1c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -87,6 +87,7 @@ import static 
org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
 import static org.apache.ignite.internal.GridTopic.TOPIC_COMM_USER;
 import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
+import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.IGFS_POOL;
 import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.MANAGEMENT_POOL;
 import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.MARSH_CACHE_POOL;
 import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.P2P_POOL;
@@ -146,6 +147,9 @@ public class GridIoManager extends 
GridManagerAdapter= 0 : "Negative policy: " + plc;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/01a6e86e/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
index 57622c9..00590ba 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
@@ -43,6 +43,9 @@ public class GridIoPolicy {
 /** Marshaller cache execution pool. */
 public static final byte MARSH_CACHE_POOL = 6;
 
+/** Marshaller cache execution pool. */
+public static final byte IGFS_POOL = 7;
+
 /**
  * Defines the range of reserved pools that are not available for plugins.
  * @param key The key.

http://git-wip-us.apache.org/repos/asf/ignite/blob/01a6e86e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index 3825086..16fbeb8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -91,7 +91,7 @@ import java.util.concurrent.locks.ReentrantLock;
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
 import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
 import static org.apache.ignite.internal.GridTopic.TOPIC_IGFS;
-import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.SYSTEM_POOL;
+import static 
org.apache.ignite.internal.managers.communication.GridIoPolicy.IGFS_POOL;
 import static 
org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
 import static 
org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 
@@ -1014,26 +1014,1

[11/47] ignite git commit: IGNITE-2810: IGFS: Striped trash directory to reduce contention during removals.

2016-04-05 Thread vkulichenko
IGNITE-2810: IGFS: Striped trash directory to reduce contention during removals.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/37c4d508
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/37c4d508
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/37c4d508

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 37c4d508c9e40dcba274ae1625d7bf59bfeef144
Parents: ff5b68c
Author: vozerov-gridgain 
Authored: Mon Mar 14 11:49:03 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:12:54 2016 +0300

--
 .../processors/igfs/IgfsDeleteWorker.java   |  28 ++--
 .../internal/processors/igfs/IgfsFileInfo.java  |   9 +-
 .../internal/processors/igfs/IgfsImpl.java  |   5 +-
 .../processors/igfs/IgfsMetaManager.java| 146 ++-
 .../processors/igfs/IgfsOutputStreamImpl.java   |   2 +-
 .../internal/processors/igfs/IgfsUtils.java |  72 +
 .../processors/igfs/IgfsAbstractSelfTest.java   |  21 ++-
 .../igfs/IgfsDataManagerSelfTest.java   |   6 +-
 .../igfs/IgfsMetaManagerSelfTest.java   |   2 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |   9 +-
 .../processors/igfs/IgfsSizeSelfTest.java   |  13 +-
 11 files changed, 199 insertions(+), 114 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/37c4d508/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
index 95a6a5d..ffddd3e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
@@ -39,7 +39,6 @@ import org.apache.ignite.lang.IgniteUuid;
 
 import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_PURGED;
 import static org.apache.ignite.internal.GridTopic.TOPIC_IGFS;
-import static org.apache.ignite.internal.processors.igfs.IgfsFileInfo.TRASH_ID;
 
 /**
  * IGFS worker for removal from the trash directory.
@@ -150,13 +149,23 @@ public class IgfsDeleteWorker extends IgfsThread {
 }
 
 /**
- * Perform cleanup of the trash directory.
+ * Perform cleanup of trash directories.
  */
 private void delete() {
+for (int i = 0; i < IgfsUtils.TRASH_CONCURRENCY; i++)
+delete(IgfsUtils.trashId(i));
+}
+
+/**
+ * Perform cleanup of concrete trash directory.
+ *
+ * @param trashId Trash ID.
+ */
+private void delete(IgniteUuid trashId) {
 IgfsFileInfo info = null;
 
 try {
-info = meta.info(TRASH_ID);
+info = meta.info(trashId);
 }
 catch(ClusterTopologyServerNotFoundException e) {
 LT.warn(log, e, "Server nodes not found.");
@@ -174,7 +183,7 @@ public class IgfsDeleteWorker extends IgfsThread {
 
 try {
 if (!cancelled) {
-if (delete(entry.getKey(), fileId)) {
+if (delete(trashId, entry.getKey(), fileId)) {
 if (log.isDebugEnabled())
 log.debug("Sending delete confirmation message 
[name=" + entry.getKey() +
 ", fileId=" + fileId + ']');
@@ -200,12 +209,13 @@ public class IgfsDeleteWorker extends IgfsThread {
 /**
  * Remove particular entry from the TRASH directory.
  *
+ * @param trashId ID of the trash directory.
  * @param name Entry name.
  * @param id Entry ID.
  * @return {@code True} in case the entry really was deleted form the file 
system by this call.
  * @throws IgniteCheckedException If failed.
  */
-private boolean delete(String name, IgniteUuid id) throws 
IgniteCheckedException {
+private boolean delete(IgniteUuid trashId, String name, IgniteUuid id) 
throws IgniteCheckedException {
 assert name != null;
 assert id != null;
 
@@ -214,10 +224,10 @@ public class IgfsDeleteWorker extends IgfsThread {
 
 if (info != null) {
 if (info.isDirectory()) {
-if (!deleteDirectoryContents(TRASH_ID, id))
+if (!deleteDirectoryContents(trashId, id))
 return false;
 
-if (meta.delete(TRASH_ID, name, id))
+if (meta.delete(trashId, name, id))
 return true;
 }
 else {
@@ -235,7 +245,7 @@ public class IgfsDeleteWorker extends IgfsThread {
 // In case 

[28/47] ignite git commit: IGNITE-2836: IGFS: Ensured that metadata can be serialized through BinaryMarshaller in the most efficient way.

2016-04-05 Thread vkulichenko
IGNITE-2836: IGFS: Ensured that metadata can be serialized through 
BinaryMarshaller in the most efficient way.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2cd0dcb3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2cd0dcb3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2cd0dcb3

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 2cd0dcb37ce43a4cb07885ddfb2e72392fc814a7
Parents: 9a4b5bd
Author: vozerov-gridgain 
Authored: Mon Mar 21 10:29:20 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:49 2016 +0300

--
 .../java/org/apache/ignite/igfs/IgfsPath.java   | 23 ++-
 .../ignite/internal/binary/BinaryContext.java   | 43 
 .../ignite/internal/binary/BinaryUtils.java | 37 +
 .../processors/igfs/IgfsDirectoryInfo.java  | 27 +++-
 .../internal/processors/igfs/IgfsEntryInfo.java | 35 
 .../processors/igfs/IgfsFileAffinityRange.java  | 32 +--
 .../internal/processors/igfs/IgfsFileInfo.java  | 37 -
 .../internal/processors/igfs/IgfsFileMap.java   | 41 +--
 .../processors/igfs/IgfsListingEntry.java   | 25 +++-
 .../meta/IgfsMetaDirectoryCreateProcessor.java  | 38 -
 .../IgfsMetaDirectoryListingAddProcessor.java   | 24 ++-
 ...IgfsMetaDirectoryListingRemoveProcessor.java | 32 ++-
 ...gfsMetaDirectoryListingReplaceProcessor.java | 31 +-
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  | 39 +-
 .../igfs/meta/IgfsMetaFileLockProcessor.java| 29 -
 .../meta/IgfsMetaFileRangeDeleteProcessor.java  | 22 +-
 .../meta/IgfsMetaFileRangeUpdateProcessor.java  | 24 ++-
 .../meta/IgfsMetaFileReserveSpaceProcessor.java | 32 ++-
 .../igfs/meta/IgfsMetaFileUnlockProcessor.java  | 28 -
 .../igfs/meta/IgfsMetaUpdatePathProcessor.java  | 23 ++-
 .../meta/IgfsMetaUpdatePropertiesProcessor.java | 28 -
 .../igfs/meta/IgfsMetaUpdateTimesProcessor.java | 30 +-
 22 files changed, 653 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/2cd0dcb3/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
--
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
index bbb4efb..f1ceb2e 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
@@ -25,6 +25,13 @@ import java.net.URI;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
 import org.apache.ignite.internal.util.io.GridFilenameUtils;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.A;
@@ -42,7 +49,7 @@ import org.jetbrains.annotations.Nullable;
  * IgfsFile file = igfs.info(filePath);
  * 
  */
-public final class IgfsPath implements Comparable, Externalizable {
+public final class IgfsPath implements Comparable, Externalizable, 
Binarylizable {
 /** */
 private static final long serialVersionUID = 0L;
 
@@ -260,6 +267,20 @@ public final class IgfsPath implements 
Comparable, Externalizable {
 }
 
 /** {@inheritDoc} */
+@Override public void writeBinary(BinaryWriter writer) throws 
BinaryObjectException {
+BinaryRawWriter out = writer.rawWriter();
+
+out.writeString(path);
+}
+
+/** {@inheritDoc} */
+@Override public void readBinary(BinaryReader reader) throws 
BinaryObjectException {
+BinaryRawReader in = reader.rawReader();
+
+path = in.readString();
+}
+
+/** {@inheritDoc} */
 @Override public int hashCode() {
 return path.hashCode();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/2cd0dcb3/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index b9b633f..c9ad1e9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.

[02/47] ignite git commit: Merge remote-tracking branch 'upstream/gridgain-7.5.10' into gridgain-7.5.10

2016-04-05 Thread vkulichenko
Merge remote-tracking branch 'upstream/gridgain-7.5.10' into gridgain-7.5.10


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/60e74618
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/60e74618
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/60e74618

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 60e74618b310dafc28eb5f935859fed4ec87584c
Parents: 08f5981 ce56625
Author: vozerov-gridgain 
Authored: Mon Mar 28 14:52:13 2016 +0300
Committer: vozerov-gridgain 
Committed: Mon Mar 28 14:52:13 2016 +0300

--
 .../IgniteBinaryCacheQueryTestSuite2.java   |  39 +
 .../IgniteBinaryCacheQueryTestSuite3.java   |  39 +
 .../IgniteCacheQuerySelfTestSuite.java  | 145 ---
 .../IgniteCacheQuerySelfTestSuite2.java | 102 +
 .../IgniteCacheQuerySelfTestSuite3.java | 109 ++
 5 files changed, 289 insertions(+), 145 deletions(-)
--




[13/47] ignite git commit: IGNITE-2814: IGFS: File lock/unlock/reserve operations are no longer require put/replace on cache. Thin entry processors are used instead.

2016-04-05 Thread vkulichenko
IGNITE-2814: IGFS: File lock/unlock/reserve operations are no longer require 
put/replace on cache. Thin entry processors are used instead.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8083391b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8083391b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8083391b

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 8083391be726c2bbc27e018983ca713e4b25e2a2
Parents: 54e6991
Author: vozerov-gridgain 
Authored: Mon Mar 14 13:17:58 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:05 2016 +0300

--
 .../processors/igfs/IgfsMetaManager.java| 270 ---
 .../processors/igfs/IgfsOutputStreamImpl.java   |  76 +-
 2 files changed, 228 insertions(+), 118 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/8083391b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 89ddd02..8bb9e92 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -466,10 +466,11 @@ public class IgfsMetaManager extends IgfsManager {
  * Lock the file explicitly outside of transaction.
  *
  * @param fileId File ID to lock.
+ * @param delete If file is being locked for delete.
  * @return Locked file info or {@code null} if file cannot be locked or 
doesn't exist.
  * @throws IgniteCheckedException If the file with such id does not exist, 
or on another failure.
  */
-public @Nullable IgfsFileInfo lock(IgniteUuid fileId, boolean 
isDeleteLock) throws IgniteCheckedException {
+public @Nullable IgfsFileInfo lock(IgniteUuid fileId, boolean delete) 
throws IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
 assert validTxState(false);
@@ -487,13 +488,11 @@ public class IgfsMetaManager extends IgfsManager {
 if (oldInfo.lockId() != null)
 return null; // The file is already locked, we cannot 
lock it.
 
-IgfsFileInfo newInfo = lockInfo(oldInfo, isDeleteLock);
+IgniteUuid lockId = createFileLockId(delete);
 
-boolean put = id2InfoPrj.replace(fileId, oldInfo, newInfo);
+id2InfoPrj.invoke(fileId, new FileLockProcessor(lockId));
 
-assert put : "Value was not stored in cache [fileId=" + 
fileId + ", newInfo=" + newInfo + ']';
-
-assert newInfo.id().equals(oldInfo.id()); // Same id.
+IgfsFileInfo newInfo = id2InfoPrj.get(fileId);
 
 tx.commit();
 
@@ -515,30 +514,13 @@ public class IgfsMetaManager extends IgfsManager {
 }
 
 /**
- * Set lock on file info.
+ * Create file lock ID.
  *
- * @param info File info.
- * @return New file info with lock set, or null if the info passed in is 
already locked.
- * @throws IgniteCheckedException In case lock is already set on that file.
+ * @param delete If lock ID is required for file deletion.
+ * @return Lock ID.
  */
-private @Nullable IgfsFileInfo lockInfo(IgfsFileInfo info, boolean 
isDeleteLock) {
- assert info != null;
-
- if (info.lockId() != null)
- return null; // Null return value indicates that the file is 
already locked.
-
- return new IgfsFileInfo(info, composeLockId(isDeleteLock), 
info.modificationTime());
-}
-
-/**
- * Gets a new lock id.
- * The returned Id #globalId() method will return the Id of the node which 
locked the file.
- *
- * @param isDeleteLock if this is special delete lock.
- * @return The new lock id.
- */
-private IgniteUuid composeLockId(boolean isDeleteLock) {
-if (isDeleteLock)
+private IgniteUuid createFileLockId(boolean delete) {
+if (delete)
 return IgfsUtils.DELETE_LOCK_ID;
 
 return IgniteUuid.fromUuid(locNode.id());
@@ -584,12 +566,7 @@ public class IgfsMetaManager extends IgfsManager {
 "[fileId=" + fileId + ", lockId=" + 
info.lockId() + ", actualLockId=" +
 oldInfo.lockId() + ']');
 
-IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, 
null, modificationTime);
-
-boolean put = id2InfoPrj.put(fileId, newInfo);
-
-   

[31/47] ignite git commit: IGNITE-2868: IGFS: Increased trash concurrency from 16 to 64.

2016-04-05 Thread vkulichenko
IGNITE-2868: IGFS: Increased trash concurrency from 16 to 64.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/218132dc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/218132dc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/218132dc

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 218132dc0c3764966294a5f29ad480af4af7b0ff
Parents: ee5ea53
Author: vozerov-gridgain 
Authored: Tue Mar 22 09:23:29 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:04 2016 +0300

--
 .../java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/218132dc/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 7063f68..94e1cef 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -65,7 +65,7 @@ public class IgfsUtils {
 public static final IgniteUuid DELETE_LOCK_ID = new IgniteUuid(new UUID(0, 
0), 0);
 
 /** Constant trash concurrency level. */
-public static final int TRASH_CONCURRENCY = 16;
+public static final int TRASH_CONCURRENCY = 64;
 
 /** Trash directory IDs. */
 private static final IgniteUuid[] TRASH_IDS;



[07/47] ignite git commit: IGNITE-2575: Added validation of IGFS endpoint port value. This closes #469.

2016-04-05 Thread vkulichenko
IGNITE-2575: Added validation of IGFS endpoint port value. This closes #469.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0e753c38
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0e753c38
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0e753c38

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 0e753c38a986cbd46eb24845808ec1d0fc7d1dea
Parents: 85a675b
Author: dkarachentsev 
Authored: Wed Feb 10 12:38:43 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:12:05 2016 +0300

--
 .../internal/processors/igfs/IgfsProcessor.java | 14 ++
 .../igfs/IgfsProcessorValidationSelfTest.java   | 27 
 2 files changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/0e753c38/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 21446e1..1b60252 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -67,6 +67,12 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 /** Null IGFS name. */
 private static final String NULL_NAME = UUID.randomUUID().toString();
 
+/** Min available TCP port. */
+private static final int MIN_TCP_PORT = 1;
+
+/** Max available TCP port. */
+private static final int MAX_TCP_PORT = 0x;
+
 /** Converts context to IGFS. */
 private static final IgniteClosure 
CTX_TO_IGFS = new C1() {
 @Override public IgniteFileSystem apply(IgfsContext igfsCtx) {
@@ -307,6 +313,14 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 throw new IgniteCheckedException("Invalid IGFS data cache 
configuration (key affinity mapper class should be " +
 IgfsGroupDataBlocksKeyMapper.class.getSimpleName() + "): " 
+ cfg);
 
+if (cfg.getIpcEndpointConfiguration() != null) {
+final int tcpPort = 
cfg.getIpcEndpointConfiguration().getPort();
+
+if (!(tcpPort >= MIN_TCP_PORT && tcpPort <= MAX_TCP_PORT))
+throw new IgniteCheckedException("IGFS endpoint TCP port 
is out of range [" + MIN_TCP_PORT +
+".." + MAX_TCP_PORT + "]: " + tcpPort);
+}
+
 long maxSpaceSize = cfg.getMaxSpaceSize();
 
 if (maxSpaceSize > 0) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0e753c38/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
index 11a80af..27f47e8 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
@@ -23,6 +23,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
+import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
 import 
org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
@@ -442,6 +443,32 @@ public class IgfsProcessorValidationSelfTest extends 
IgfsCommonAbstractTest {
 }
 
 /**
+ * @throws Exception If failed.
+ */
+public void testInvalidEndpointTcpPort() throws Exception {
+final String failMsg = "IGFS endpoint TCP port is out of range";
+g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), 
CacheConfiguration.class));
+
+final String igfsCfgName = "igfs-cfg";
+final IgfsIpcEndpointConfiguration igfsEndpointCfg = new 
IgfsIpcEndpointConfiguration();
+igfsEndpointCfg.setPort(0);
+g1IgfsCfg1.setName(igfsCfgName);
+g1IgfsCfg1.setIpcEndpointConfiguration(igfsEndpointCfg);
+
+checkGridStartFails(g1Cfg, failMsg, true);
+
+igfsEndpointCfg.setPort(-1);
+g1IgfsCfg1.setIpcEndpointConfiguration(igfsEndpointCfg);
+
+

[24/47] ignite git commit: IGNITE-2813: IGFS: Optimized metadata values splitting file and directory into separate classes.

2016-04-05 Thread vkulichenko
IGNITE-2813: IGFS: Optimized metadata values splitting file and directory into 
separate classes.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bfa7bf6c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bfa7bf6c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bfa7bf6c

Branch: refs/heads/gridgain-7.5.11-vk
Commit: bfa7bf6c3d693406f1dd5121488796687aebbe7d
Parents: 8e9e790
Author: vozerov-gridgain 
Authored: Fri Mar 18 17:45:48 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:38 2016 +0300

--
 .../processors/igfs/IgfsDataManager.java| 103 ++--
 .../processors/igfs/IgfsDeleteWorker.java   |  27 +-
 .../processors/igfs/IgfsDirectoryInfo.java  | 210 
 .../internal/processors/igfs/IgfsEntryInfo.java | 305 +++
 .../internal/processors/igfs/IgfsFileImpl.java  |  15 +-
 .../internal/processors/igfs/IgfsFileInfo.java  | 500 +++
 .../processors/igfs/IgfsFileWorkerBatch.java|  75 +--
 .../IgfsFileWorkerBatchCancelledException.java  |  51 ++
 .../igfs/IgfsFragmentizerManager.java   |  64 ++-
 .../internal/processors/igfs/IgfsImpl.java  |  28 +-
 .../processors/igfs/IgfsInputStreamAdapter.java |   5 +-
 .../processors/igfs/IgfsInputStreamImpl.java|  32 +-
 .../processors/igfs/IgfsIpcHandler.java |  16 +-
 .../processors/igfs/IgfsListingEntry.java   |  12 +-
 .../processors/igfs/IgfsMetaManager.java| 432 
 .../processors/igfs/IgfsOutputStreamImpl.java   |  19 +-
 .../internal/processors/igfs/IgfsPathIds.java   |   4 +-
 .../processors/igfs/IgfsPathsCreateResult.java  |   6 +-
 .../IgfsSecondaryInputStreamDescriptor.java |   6 +-
 .../IgfsSecondaryOutputStreamDescriptor.java|   9 +-
 .../internal/processors/igfs/IgfsUtils.java |  68 +++
 .../internal/processors/igfs/package-info.java  |   2 +-
 .../igfs/IgfsFragmentizerAbstractSelfTest.java  |   4 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |   4 +-
 .../igfs/IgfsDataManagerSelfTest.java   |  55 +-
 .../igfs/IgfsDualAbstractSelfTest.java  |  17 +-
 .../processors/igfs/IgfsFileInfoSelfTest.java   |  31 +-
 .../igfs/IgfsMetaManagerSelfTest.java   |  34 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |  31 +-
 .../processors/igfs/IgfsSizeSelfTest.java   |  35 +-
 .../processors/igfs/IgfsStreamsSelfTest.java|  25 +-
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |  32 +-
 .../igfs/HadoopIgfsDualAbstractSelfTest.java|  11 +-
 .../IgniteHadoopFileSystemLoggerSelfTest.java   |  21 +-
 .../testsuites/IgniteHadoopTestSuite.java   |  26 +-
 35 files changed, 1321 insertions(+), 994 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/bfa7bf6c/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index 125d728..3825086 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -17,35 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
-import java.io.DataInput;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-import javax.cache.processor.EntryProcessor;
-import javax.cache.processor.MutableEntry;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteDataStreamer;
 import org.apache.ignite.IgniteException;
@@ -87,6 +58,36 @@ import org.apache.ignite.thread.IgniteThreadPoolExecutor;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
+impo

[46/47] ignite git commit: Removed buffer from message worker

2016-04-05 Thread vkulichenko
Removed buffer from message worker


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/19b4af10
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/19b4af10
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/19b4af10

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 19b4af10386779efeb57be68f10484937201c58d
Parents: 2397552
Author: Valentin Kulichenko 
Authored: Tue Apr 5 13:16:08 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 5 13:16:08 2016 -0700

--
 .../ignite/spi/discovery/tcp/ServerImpl.java|  8 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java  | 27 +---
 .../tcp/TcpClientDiscoverySpiSelfTest.java  |  5 ++--
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 26 ---
 .../TcpDiscoverySpiFailureTimeoutSelfTest.java  | 13 ++
 5 files changed, 17 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/19b4af10/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index f0de546..356f4fe 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -73,7 +73,6 @@ import 
org.apache.ignite.internal.util.GridBoundedLinkedHashSet;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
-import org.apache.ignite.internal.util.io.GridByteArrayOutputStream;
 import org.apache.ignite.internal.util.lang.GridTuple;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.C1;
@@ -5751,9 +5750,6 @@ class ServerImpl extends TcpDiscoveryImpl {
  * Base class for message workers.
  */
 protected abstract class MessageWorkerAdapter extends IgniteSpiThread {
-/** Pre-allocated output stream (100K). */
-private final GridByteArrayOutputStream bout = new 
GridByteArrayOutputStream(100 * 1024);
-
 /** Message queue. */
 private final BlockingDeque queue = new 
LinkedBlockingDeque<>();
 
@@ -5845,9 +5841,7 @@ class ServerImpl extends TcpDiscoveryImpl {
  */
 protected final void writeToSocket(Socket sock, 
TcpDiscoveryAbstractMessage msg, long timeout)
 throws IOException, IgniteCheckedException {
-bout.reset();
-
-spi.writeToSocket(sock, msg, bout, timeout);
+spi.writeToSocket(sock, msg, timeout);
 }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/19b4af10/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 277055a..d0d8be2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -51,7 +51,6 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.AddressResolver;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.util.io.GridByteArrayOutputStream;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
@@ -1340,21 +1339,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter 
implements DiscoverySpi, T
  *
  * @param sock Socket.
  * @param msg Message.
- * @param timeout Socket write timeout.
- * @throws IOException If IO failed or write timed out.
- * @throws IgniteCheckedException If marshalling failed.
- */
-protected void writeToSocket(Socket sock, TcpDiscoveryAbstractMessage msg, 
long timeout) throws IOException,
-IgniteCheckedException {
-writeToSocket(sock, msg, new GridByteArrayOutputStream(8 * 1024), 
timeout); // 8K.
-}
-
-/**
- * Writes message to the socket.
- *
- * @param sock Socket.
- * @param msg Message.
- * @param bout Byte array output stream.
  * @param timeout Timeout.
  * @throws IOException If IO failed or write timed out.
  * @t

[25/47] ignite git commit: IGNITE-2860: IGFS: Fixed minor bug in append() operation.

2016-04-05 Thread vkulichenko
IGNITE-2860: IGFS: Fixed minor bug in append() operation.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8de40f2f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8de40f2f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8de40f2f

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 8de40f2f8649c9ffecf86202f9fd4efbc3827e83
Parents: bfa7bf6
Author: thatcoach 
Authored: Fri Mar 18 21:15:04 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:42 2016 +0300

--
 .../apache/ignite/internal/processors/igfs/IgfsMetaManager.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/8de40f2f/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 84e4dae..d66d9be 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -3549,7 +3549,7 @@ public class IgfsMetaManager extends IgfsManager {
 IgniteUuid oldId = pathIds.lastId();
 
 id2InfoPrj.invoke(trashId, new 
ListingAddProcessor(oldId.toString(),
-new IgfsListingEntry(oldId, true)));
+new IgfsListingEntry(oldInfo)));
 
 // Second step: replace ID in parent directory.
 String name = pathIds.lastPart();



[27/47] ignite git commit: IGNITE-2861: IGFS: Moved metadata processors into separate top-level classes to simplify code. Also cleaned up IgfsMetaManager from unused code.

2016-04-05 Thread vkulichenko
IGNITE-2861: IGFS: Moved metadata processors into separate top-level classes to 
simplify code. Also cleaned up IgfsMetaManager from unused code.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9a4b5bd7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9a4b5bd7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9a4b5bd7

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 9a4b5bd720c5ed1f96b82a457fa3eaed1bdbb132
Parents: 8de40f2
Author: thatcoach 
Authored: Sat Mar 19 21:13:35 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:45 2016 +0300

--
 .../igfs/IgfsFragmentizerManager.java   |  141 +--
 .../processors/igfs/IgfsMetaManager.java| 1142 ++
 .../internal/processors/igfs/IgfsPathIds.java   |2 +-
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |  117 ++
 .../IgfsMetaDirectoryListingAddProcessor.java   |   92 ++
 ...IgfsMetaDirectoryListingRemoveProcessor.java |   89 ++
 ...gfsMetaDirectoryListingReplaceProcessor.java |   84 ++
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  |  110 ++
 .../igfs/meta/IgfsMetaFileLockProcessor.java|   63 +
 .../meta/IgfsMetaFileRangeDeleteProcessor.java  |   74 ++
 .../meta/IgfsMetaFileRangeUpdateProcessor.java  |   81 ++
 .../meta/IgfsMetaFileReserveSpaceProcessor.java |   75 ++
 .../igfs/meta/IgfsMetaFileUnlockProcessor.java  |   60 +
 .../igfs/meta/IgfsMetaUpdatePathProcessor.java  |   66 +
 .../meta/IgfsMetaUpdatePropertiesProcessor.java |   78 ++
 .../igfs/meta/IgfsMetaUpdateTimesProcessor.java |   68 ++
 16 files changed, 1155 insertions(+), 1187 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/9a4b5bd7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
index 194a8ac..99e7cd6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
@@ -26,13 +26,14 @@ import 
org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
+import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileRangeDeleteProcessor;
+import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileRangeUpdateProcessor;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridSpinReadWriteLock;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.LT;
-import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -40,13 +41,6 @@ import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.thread.IgniteThread;
 import org.jetbrains.annotations.Nullable;
 
-import javax.cache.processor.EntryProcessor;
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -294,7 +288,7 @@ public class IgfsFragmentizerManager extends IgfsManager {
 case RANGE_STATUS_INITIAL: {
 // Mark range as moving.
 updated = igfsCtx.meta().updateInfo(
-fileId, new RangeUpdateProcessor(range, 
RANGE_STATUS_MOVING));
+fileId, new 
IgfsMetaFileRangeUpdateProcessor(range, RANGE_STATUS_MOVING));
 
 if (updated == null) {
 igfsCtx.data().cleanBlocks(fileInfo, range, true);
@@ -311,7 +305,7 @@ public class IgfsFragmentizerManager extends IgfsManager {
 
 // Mark range as moved.
 updated = igfsCtx.meta().updateInfo(
-fileId, new RangeUpdateProcessor(range, 
RANGE_STATUS_MOVED));
+fileId, new 
IgfsMetaFileRangeUpdateProces

[41/47] ignite git commit: Minor fix for Visor query metrics.

2016-04-05 Thread vkulichenko
Minor fix for Visor query metrics.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a70d2dc4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a70d2dc4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a70d2dc4

Branch: refs/heads/gridgain-7.5.11-vk
Commit: a70d2dc48c42f23b1ea64c2a219560efa44fb99f
Parents: 28d2a7b
Author: Alexey Kuznetsov 
Authored: Mon Apr 4 14:14:42 2016 +0700
Committer: Alexey Kuznetsov 
Committed: Mon Apr 4 14:14:42 2016 +0700

--
 .../internal/visor/cache/VisorCacheMetrics.java |  9 ---
 .../resources/META-INF/classnames.properties| 82 +---
 2 files changed, 55 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a70d2dc4/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 0397fe0..5b17965 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -415,15 +415,6 @@ public class VisorCacheMetrics implements Serializable {
 }
 
 /**
- * Sets cache query metrics.
- *
- * @param qryMetrics New value for query metrics.
- */
-public void queryMetrics(VisorCacheQueryMetrics qryMetrics) {
-this.qryMetrics = qryMetrics;
-}
-
-/**
  * @return Current size of evict queue used to batch up evictions.
  */
 public int dhtEvictQueueCurrentSize() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/a70d2dc4/modules/core/src/main/resources/META-INF/classnames.properties
--
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties 
b/modules/core/src/main/resources/META-INF/classnames.properties
index 9728d9c..0dd6a59 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -71,6 +71,7 @@ org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy
 
org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy$DefaultHolderComparator
 
org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy$GridConcurrentSkipListSetEx
 org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy$HolderComparator
+org.apache.ignite.cache.query.CacheQueryEntryEvent
 org.apache.ignite.cache.query.ContinuousQuery
 org.apache.ignite.cache.query.Query
 org.apache.ignite.cache.query.ScanQuery
@@ -346,26 +347,30 @@ 
org.apache.ignite.internal.processors.cache.GridCacheAdapter
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$10
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$11
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$12
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$13$1
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$13
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$14
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$15
+`org.apache.ignite.internal.processors.cache.GridCacheAdapter$15$1
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$16
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$17
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$2
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$23$1
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$25
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$26$1
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$25$1
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$27
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$28$1
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$29
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$3
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$31
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$4
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$6
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$62
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$63
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$64
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$65
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$66
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$67
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$67$1
 org.apache.ignite.internal.processors.ca

[14/47] ignite git commit: IGNITE-2828: IGFS: Introduced processor for "updateTimes" operation.

2016-04-05 Thread vkulichenko
IGNITE-2828: IGFS: Introduced processor for "updateTimes" operation.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7c1f444
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7c1f444
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7c1f444

Branch: refs/heads/gridgain-7.5.11-vk
Commit: a7c1f44420ae96f183abc2e17125f0c9aa0775d5
Parents: 8083391
Author: vozerov-gridgain 
Authored: Mon Mar 14 15:57:28 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:10 2016 +0300

--
 .../processors/igfs/IgfsMetaManager.java| 73 
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |  6 --
 2 files changed, 61 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c1f444/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 8bb9e92..d3aae58 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -411,7 +411,7 @@ public class IgfsMetaManager extends IgfsManager {
 
 // Force root ID always exist in cache.
 if (info == null && IgfsUtils.ROOT_ID.equals(fileId))
-id2InfoPrj.putIfAbsent(IgfsUtils.ROOT_ID, info = new 
IgfsFileInfo());
+info = createSystemEntryIfAbsent(fileId);
 
 return info;
 }
@@ -443,13 +443,9 @@ public class IgfsMetaManager extends IgfsManager {
 
 // Force root ID always exist in cache.
 if (fileIds.contains(IgfsUtils.ROOT_ID) && 
!map.containsKey(IgfsUtils.ROOT_ID)) {
-IgfsFileInfo info = new IgfsFileInfo();
-
-id2InfoPrj.putIfAbsent(IgfsUtils.ROOT_ID, info);
-
 map = new GridLeanMap<>(map);
 
-map.put(IgfsUtils.ROOT_ID, info);
+map.put(IgfsUtils.ROOT_ID, 
createSystemEntryIfAbsent(IgfsUtils.ROOT_ID));
 }
 
 return map;
@@ -666,8 +662,6 @@ public class IgfsMetaManager extends IgfsManager {
  */
 private IgfsFileInfo createSystemEntryIfAbsent(IgniteUuid id)
 throws IgniteCheckedException {
-assert validTxState(true);
-
 assert IgfsUtils.isRootOrTrashId(id);
 
 IgfsFileInfo info = new IgfsFileInfo(id);
@@ -2995,11 +2989,10 @@ public class IgfsMetaManager extends IgfsManager {
 
 assert parentInfo.isDirectory();
 
-IgfsFileInfo updated = new IgfsFileInfo(fileInfo,
+id2InfoPrj.invoke(fileId, new UpdateTimesProcessor(
 accessTime == -1 ? fileInfo.accessTime() : accessTime,
-modificationTime == -1 ? fileInfo.modificationTime() : 
modificationTime);
-
-id2InfoPrj.put(fileId, updated);
+modificationTime == -1 ? fileInfo.modificationTime() : 
modificationTime)
+);
 
 id2InfoPrj.invoke(parentId, new UpdateListingEntry(fileId, 
fileName, 0, accessTime,
 modificationTime));
@@ -4058,4 +4051,60 @@ public class IgfsMetaManager extends IgfsManager {
 affRange = (IgfsFileAffinityRange)in.readObject();
 }
 }
+
+/**
+ * Update times entry processor.
+ */
+private static class UpdateTimesProcessor implements 
EntryProcessor,
+Externalizable {
+/** */
+private static final long serialVersionUID = 0L;
+
+/** Access time. */
+private long accessTime;
+
+/** Modification time. */
+private long modificationTime;
+
+/**
+ * Default constructor.
+ */
+public UpdateTimesProcessor() {
+// No-op.
+}
+
+/**
+ * Constructor.
+ *
+ * @param accessTime Access time.
+ * @param modificationTime Modification time.
+ */
+public UpdateTimesProcessor(long accessTime, long modificationTime) {
+this.accessTime = accessTime;
+this.modificationTime = modificationTime;
+}
+
+/** {@inheritDoc} */
+@Override public Void process(MutableEntry 
entry, Object... args)
+throws EntryProcessorException {
+
+IgfsFileInfo oldInfo = entry.getValue();
+
+entry.setValue(new IgfsFileInfo(oldInfo, accessTime, 
modificatio

[20/47] ignite git commit: IGNITE-2860: IGFS: Reworked base meta operations.

2016-04-05 Thread vkulichenko
IGNITE-2860: IGFS: Reworked base meta operations.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8a93c3bf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8a93c3bf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8a93c3bf

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 8a93c3bf1687e6f2de1a4391d95366d733a44a7d
Parents: f57f365
Author: vozerov-gridgain 
Authored: Fri Mar 18 16:38:45 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:30 2016 +0300

--
 .../java/org/apache/ignite/igfs/IgfsPath.java   |9 +
 .../internal/processors/igfs/IgfsImpl.java  |   59 +-
 .../processors/igfs/IgfsMetaManager.java| 1058 +-
 .../internal/processors/igfs/IgfsPathIds.java   |  291 +
 .../processors/igfs/IgfsPathsCreateResult.java  |   77 ++
 .../internal/processors/igfs/IgfsUtils.java |   23 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |   68 +-
 .../igfs/IgfsMetaManagerSelfTest.java   |   31 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |   26 +-
 .../processors/igfs/IgfsStartCacheTest.java |9 +-
 .../apache/ignite/igfs/IgfsEventsTestSuite.java |   10 +-
 11 files changed, 1039 insertions(+), 622 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/8a93c3bf/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
--
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
index fb0621c..bbb4efb 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
@@ -159,6 +159,15 @@ public final class IgfsPath implements 
Comparable, Externalizable {
 }
 
 /**
+ * Get components in array form.
+ *
+ * @return Components array.
+ */
+public String[] componentsArray() {
+return path.length() == 1 ? new String[0] : 
path.substring(1).split(SLASH);
+}
+
+/**
  * Returns the parent of a path or {@code null} if at root.
  *
  * @return The parent of a path or {@code null} if at root.

http://git-wip-us.apache.org/repos/asf/ignite/blob/8a93c3bf/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 3065427..9ec583c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -17,24 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -94,6 +76,25 @@ import org.apache.ignite.thread.IgniteThreadPoolExecutor;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
 import static org.apache.ignite.events.EventType.EVT_IGFS_DIR_DELETED;
 import static org.apache.ignite.events.EventType.EVT_IGFS_DIR_RENAMED;
 import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_CLOSED_READ;
@@ -1033,8 +1034,15 @@ public final class IgfsImpl implements IgfsEx {
 else
 dirProps = fileProps = new HashMap<>(props);
 
-IgniteBiTuple t2 = meta.create(path, 

[09/47] ignite git commit: IGNITE-2754: IGFS: Created separate processor for listing remove operation.

2016-04-05 Thread vkulichenko
IGNITE-2754: IGFS: Created separate processor for listing remove operation.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/219238f2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/219238f2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/219238f2

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 219238f2793a3f3f9f5705a065c67510c286df1c
Parents: 99028b5
Author: vozerov-gridgain 
Authored: Thu Mar 3 13:25:43 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:12:44 2016 +0300

--
 .../processors/igfs/IgfsMetaManager.java| 160 ---
 1 file changed, 105 insertions(+), 55 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/219238f2/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 0ba78c5..c120b9d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -43,6 +43,7 @@ import javax.cache.processor.EntryProcessor;
 import javax.cache.processor.EntryProcessorException;
 import javax.cache.processor.EntryProcessorResult;
 import javax.cache.processor.MutableEntry;
+
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteInterruptedException;
@@ -847,7 +848,7 @@ public class IgfsMetaManager extends IgfsManager {
 if (!id2InfoPrj.putIfAbsent(fileId, newFileInfo))
 throw fsException("Failed to add file details into cache: " + 
newFileInfo);
 
-id2InfoPrj.invoke(parentId, new UpdateListing(fileName, new 
IgfsListingEntry(newFileInfo), false));
+id2InfoPrj.invoke(parentId, new ListingAdd(fileName, new 
IgfsListingEntry(newFileInfo)));
 
 return null;
 }
@@ -956,8 +957,8 @@ public class IgfsMetaManager extends IgfsManager {
 // 8. Actual move: remove from source parent and add to 
destination target.
 IgfsListingEntry entry = 
srcTargetInfo.listing().get(srcName);
 
-id2InfoPrj.invoke(srcTargetId, new UpdateListing(srcName, 
entry, true));
-id2InfoPrj.invoke(dstTargetId, new UpdateListing(dstName, 
entry, false));
+id2InfoPrj.invoke(srcTargetId, new ListingRemove(srcName, 
entry.fileId()));
+id2InfoPrj.invoke(dstTargetId, new ListingAdd(dstName, 
entry));
 
 tx.commit();
 
@@ -1093,10 +1094,10 @@ public class IgfsMetaManager extends IgfsManager {
 ", destParentId=" + destParentId + ", destEntry=" + destEntry 
+ ']'));
 
 // Remove listing entry from the source parent listing.
-id2InfoPrj.invoke(srcParentId, new UpdateListing(srcFileName, 
srcEntry, true));
+id2InfoPrj.invoke(srcParentId, new ListingRemove(srcFileName, 
srcEntry.fileId()));
 
 // Add listing entry into the destination parent listing.
-id2InfoPrj.invoke(destParentId, new UpdateListing(destFileName, 
srcEntry, false));
+id2InfoPrj.invoke(destParentId, new ListingAdd(destFileName, 
srcEntry));
 }
 
 /**
@@ -1134,8 +1135,8 @@ public class IgfsMetaManager extends IgfsManager {
 id2InfoPrj.put(newInfo.id(), newInfo);
 
 // Add new info to trash listing.
-id2InfoPrj.invoke(TRASH_ID, new 
UpdateListing(newInfo.id().toString(),
-new IgfsListingEntry(newInfo), false));
+id2InfoPrj.invoke(TRASH_ID, new 
ListingAdd(newInfo.id().toString(),
+new IgfsListingEntry(newInfo)));
 
 // Remove listing entries from root.
 // Note that root directory properties and other 
attributes are preserved:
@@ -1233,10 +1234,10 @@ public class IgfsMetaManager extends IgfsManager {
 
 assert victimId.equals(srcEntry.fileId());
 
-id2InfoPrj.invoke(srcParentId, new 
UpdateListing(srcFileName, srcEntry, true));
+id2InfoPrj.invoke(srcParentId, new 
ListingRemove(srcFileName, srcEntry.fileId()));
 
 // Add listing entry into the destination parent listing.
-id2InfoPrj.invoke(TRASH_ID, new 
UpdateListing(destFileName, srcEntry, false));
+id2InfoPrj.invoke(TRASH_ID, new ListingAdd(destFileName, 
srcEntry));
 
 if (victimInfo.isFile())
 

[17/47] ignite git commit: IGNITE-2842: IGFS: Optimized create/mkdirs operations with help of entry processors.

2016-04-05 Thread vkulichenko
IGNITE-2842: IGFS: Optimized create/mkdirs operations with help of entry 
processors.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3e59321e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3e59321e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3e59321e

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 3e59321ef0ae1d936d94f8f804db45ceeff55844
Parents: 4f7e3c1
Author: vozerov-gridgain 
Authored: Wed Mar 16 12:31:37 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:21 2016 +0300

--
 .../internal/processors/igfs/IgfsFileInfo.java  |  13 +
 .../processors/igfs/IgfsListingEntry.java   |  15 +-
 .../processors/igfs/IgfsMetaManager.java| 262 ---
 3 files changed, 251 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/3e59321e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
index ba484bb..13c54ff 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
@@ -345,6 +345,19 @@ public final class IgfsFileInfo implements Externalizable {
 }
 
 /**
+ * Temporal hack to change ID before saving entry to cache. Currently we 
have too much constructors and adding
+ * more will make things even worse. Instead, we use this method until 
directories and files are split into
+ * separate entities.
+ *
+ * @param id ID.
+ * @deprecated Use only on not-yet-saved entries.
+ */
+@Deprecated
+public void id(IgniteUuid id) {
+this.id = id;
+}
+
+/**
  * @return {@code True} if this is a file.
  */
 public boolean isFile() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e59321e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsListingEntry.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsListingEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsListingEntry.java
index 61d9265..4fe0dca 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsListingEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsListingEntry.java
@@ -34,7 +34,7 @@ public class IgfsListingEntry implements Externalizable {
 /** */
 private static final long serialVersionUID = 0L;
 
-/** File id. */
+/** ID. */
 private IgniteUuid id;
 
 /** Directory marker. */
@@ -48,6 +48,8 @@ public class IgfsListingEntry implements Externalizable {
 }
 
 /**
+ * Constructor.
+ *
  * @param fileInfo File info to construct listing entry from.
  */
 public IgfsListingEntry(IgfsFileInfo fileInfo) {
@@ -56,6 +58,17 @@ public class IgfsListingEntry implements Externalizable {
 }
 
 /**
+ * Constructor.
+ *
+ * @param id File ID.
+ * @param dir Directory marker.
+ */
+public IgfsListingEntry(IgniteUuid id, boolean dir) {
+this.id = id;
+this.dir = dir;
+}
+
+/**
  * @return Entry file ID.
  */
 public IgniteUuid fileId() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e59321e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index df69d49..2a85cf8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -1868,13 +1868,11 @@ public class IgfsMetaManager extends IgfsManager {
  * @return New file info.
  * @throws IgniteCheckedException If failed.
  */
-private IgfsFileInfo invokeAndGet(IgniteUuid id, 
EntryProcessor proc)
+private IgfsFileInfo invokeAndGet(IgniteUuid id, 
EntryProcessor proc)
 throws IgniteCheckedException {
 validTxState(true);
 
-id2InfoPrj.invoke(id, proc);
-
-return getInfo(id);
+return id2InfoPrj.invoke(id, proc).get();
 }
 
 /**
@@ -3493,7 +3491,7 @@ public cl

[05/47] ignite git commit: IGNITE-2801 Coordinator floods network with partitions full map exchange messages

2016-04-05 Thread vkulichenko
 IGNITE-2801 Coordinator floods network with partitions full map exchange 
messages


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e62b667
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e62b667
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e62b667

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 9e62b667e73396d3affbc4d1e62449d07d08ec8b
Parents: d36a2e5
Author: Anton Vinogradov 
Authored: Tue Mar 29 14:56:21 2016 +0300
Committer: Anton Vinogradov 
Committed: Tue Mar 29 14:56:21 2016 +0300

--
 .../GridCachePartitionExchangeManager.java  |   8 +-
 ...cingDelayedPartitionMapExchangeSelfTest.java |  14 +-
 .../GridCacheRebalancingSyncSelfTest.java   | 187 ++-
 .../junits/common/GridCommonAbstractTest.java   |  53 +-
 4 files changed, 238 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/9e62b667/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 1681f2f..b54116c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1264,13 +1264,9 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 break;
 }
 
-// If not first preloading and no more topology events 
present,
-// then we periodically refresh partition map.
-if (!cctx.kernalContext().clientNode() && futQ.isEmpty() 
&& preloadFinished) {
-refreshPartitions(timeout);
-
+// If not first preloading and no more topology events 
present.
+if (!cctx.kernalContext().clientNode() && futQ.isEmpty() 
&& preloadFinished)
 timeout = cctx.gridConfig().getNetworkTimeout();
-}
 
 // After workers line up and before preloading starts we 
initialize all futures.
 if (log.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e62b667/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.java
index 2890fcb..2c47a1c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -99,7 +100,7 @@ public class 
GridCacheRabalancingDelayedPartitionMapExchangeSelfTest extends Gri
  * @throws Exception e.
  */
 public void test() throws Exception {
-startGrid(0);
+IgniteKernal ignite = (IgniteKernal)startGrid(0);
 
 CacheConfiguration cfg = new CacheConfiguration<>();
 
@@ -114,26 +115,29 @@ public class 
GridCacheRabalancingDelayedPartitionMapExchangeSelfTest extends Gri
 startGrid(2);
 startGrid(3);
 
-awaitPartitionMapExchange(true);
+awaitPartitionMapExchange(true, true);
 
 for (int i = 0; i < 2; i++) {
 stopGrid(3);
 
-awaitPartitionMapExchange(true);
+awaitPartitionMapExchange(true, true);
 
 startGrid(3);
 
-awaitPartitionMapExchange

[08/47] ignite git commit: IGFS: Minor refactoring.

2016-04-05 Thread vkulichenko
IGFS: Minor refactoring.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/99028b50
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/99028b50
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/99028b50

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 99028b509c736b79faac7fb8104b1bc3cfe30720
Parents: 0e753c3
Author: vozerov-gridgain 
Authored: Thu Mar 3 12:56:55 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:12:11 2016 +0300

--
 .../processors/igfs/IgfsMetaManager.java| 55 +++-
 1 file changed, 29 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/99028b50/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index a149b31..0ba78c5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -480,7 +480,7 @@ public class IgfsMetaManager extends IgfsManager {
 assert validTxState(false);
 assert fileId != null;
 
-IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, 
REPEATABLE_READ);
+IgniteInternalTx tx = startTx();
 
 try {
 // Lock file ID for this transaction.
@@ -494,7 +494,7 @@ public class IgfsMetaManager extends IgfsManager {
 
 IgfsFileInfo newInfo = lockInfo(oldInfo, isDeleteLock);
 
-boolean put = metaCache.replace(fileId, oldInfo, newInfo);
+boolean put = id2InfoPrj.replace(fileId, oldInfo, newInfo);
 
 assert put : "Value was not stored in cache [fileId=" + 
fileId + ", newInfo=" + newInfo + ']';
 
@@ -571,7 +571,7 @@ public class IgfsMetaManager extends IgfsManager {
 final boolean interrupted = Thread.interrupted();
 
 try {
-IgfsUtils.doInTransactionWithRetries(metaCache, new 
IgniteOutClosureX() {
+IgfsUtils.doInTransactionWithRetries(id2InfoPrj, new 
IgniteOutClosureX() {
 @Override public Void applyx() throws 
IgniteCheckedException {
 assert validTxState(true);
 
@@ -591,7 +591,7 @@ public class IgfsMetaManager extends IgfsManager {
 
 IgfsFileInfo newInfo = new IgfsFileInfo(oldInfo, 
null, modificationTime);
 
-boolean put = metaCache.put(fileId, newInfo);
+boolean put = id2InfoPrj.put(fileId, newInfo);
 
 assert put : "Value was not stored in cache 
[fileId=" + fileId + ", newInfo=" + newInfo
 + ']';
@@ -847,8 +847,6 @@ public class IgfsMetaManager extends IgfsManager {
 if (!id2InfoPrj.putIfAbsent(fileId, newFileInfo))
 throw fsException("Failed to add file details into cache: " + 
newFileInfo);
 
-assert metaCache.get(parentId) != null;
-
 id2InfoPrj.invoke(parentId, new UpdateListing(fileName, new 
IgfsListingEntry(newFileInfo), false));
 
 return null;
@@ -890,7 +888,7 @@ public class IgfsMetaManager extends IgfsManager {
 }
 
 // 2. Start transaction.
-IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, 
REPEATABLE_READ);
+IgniteInternalTx tx = startTx();
 
 try {
 // 3. Obtain the locks.
@@ -1094,9 +1092,6 @@ public class IgfsMetaManager extends IgfsManager {
 " directory (file already exists) [fileId=" + fileId + ", 
destFileName=" + destFileName +
 ", destParentId=" + destParentId + ", destEntry=" + destEntry 
+ ']'));
 
-assert metaCache.get(srcParentId) != null;
-assert metaCache.get(destParentId) != null;
-
 // Remove listing entry from the source parent listing.
 id2InfoPrj.invoke(srcParentId, new UpdateListing(srcFileName, 
srcEntry, true));
 
@@ -1116,7 +,7 @@ public class IgfsMetaManager extends IgfsManager {
 try {
 assert validTxState(false);
 
-final IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, 
REPEATABLE_READ);
+final IgniteInternalTx tx = startTx();
 
 try {
 // NB: We may lock root because its id is less than any 
other id:
@@ -1197,7 +1192,7 @@ public class IgfsMet

[47/47] ignite git commit: Fixed race condition in continuous processor

2016-04-05 Thread vkulichenko
Fixed race condition in continuous processor


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/433fd031
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/433fd031
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/433fd031

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 433fd031abbaf8d11ab55cc75eb1ef061dc450bd
Parents: 19b4af1
Author: Valentin Kulichenko 
Authored: Tue Apr 5 13:16:33 2016 -0700
Committer: Valentin Kulichenko 
Committed: Tue Apr 5 13:16:33 2016 -0700

--
 .../processors/continuous/GridContinuousProcessor.java | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/433fd031/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 99e0bb5..c6503e0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -394,7 +394,18 @@ public class GridContinuousProcessor extends 
GridProcessorAdapter {
 /** {@inheritDoc} */
 @Override @Nullable public Serializable collectDiscoveryData(UUID nodeId) {
 if (!nodeId.equals(ctx.localNodeId()) || !locInfos.isEmpty()) {
-DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos);
+Map> clientInfos0 = 
U.newHashMap(clientInfos.size());
+
+for (Map.Entry> e : 
clientInfos.entrySet()) {
+Map copy = 
U.newHashMap(e.getValue().size());
+
+for (Map.Entry e0 : 
e.getValue().entrySet())
+copy.put(e0.getKey(), e0.getValue());
+
+clientInfos0.put(e.getKey(), copy);
+}
+
+DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos0);
 
 // Collect listeners information (will be sent to joining node 
during discovery process).
 for (Map.Entry e : locInfos.entrySet()) {



[10/47] ignite git commit: IGNITE-2781: IGFS: Force "copyOnRead=false" for meta and data caches.

2016-04-05 Thread vkulichenko
IGNITE-2781: IGFS: Force "copyOnRead=false" for meta and data caches.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ff5b68ca
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ff5b68ca
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ff5b68ca

Branch: refs/heads/gridgain-7.5.11-vk
Commit: ff5b68ca69050817794ef4b142c955a186e03de9
Parents: 219238f
Author: vozerov-gridgain 
Authored: Mon Mar 14 10:19:23 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:12:48 2016 +0300

--
 .../main/java/org/apache/ignite/internal/IgnitionEx.java| 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/ff5b68ca/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 5153fb3..905a625 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1950,6 +1950,15 @@ public class IgnitionEx {
 }
 
 cfg.setCacheConfiguration(cacheCfgs.toArray(new 
CacheConfiguration[cacheCfgs.size()]));
+
+// Iterate over IGFS caches and set "copyOnRead" flag to "false". 
Note that we do this after cloning
+// to leave user object unchanged.
+assert cfg.getCacheConfiguration() != null;
+
+for (CacheConfiguration ccfg : cfg.getCacheConfiguration()) {
+if (CU.isIgfsCache(cfg, ccfg.getName()))
+ccfg.setCopyOnRead(false);
+}
 }
 
 /**



[29/47] ignite git commit: IGNITE-2861: Added missing Apache headers.

2016-04-05 Thread vkulichenko
IGNITE-2861: Added missing Apache headers.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/76191ff3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/76191ff3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/76191ff3

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 76191ff39456a30246df3aca7c026773d00a8446
Parents: 2cd0dcb
Author: vozerov-gridgain 
Authored: Mon Mar 21 10:36:26 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:53 2016 +0300

--
 .../meta/IgfsMetaDirectoryCreateProcessor.java | 17 +
 .../meta/IgfsMetaDirectoryListingAddProcessor.java | 17 +
 .../IgfsMetaDirectoryListingRemoveProcessor.java   | 17 +
 .../IgfsMetaDirectoryListingReplaceProcessor.java  | 17 +
 .../igfs/meta/IgfsMetaFileCreateProcessor.java | 17 +
 .../igfs/meta/IgfsMetaFileLockProcessor.java   | 17 +
 .../meta/IgfsMetaFileRangeDeleteProcessor.java | 17 +
 .../meta/IgfsMetaFileRangeUpdateProcessor.java | 17 +
 .../meta/IgfsMetaFileReserveSpaceProcessor.java| 17 +
 .../igfs/meta/IgfsMetaFileUnlockProcessor.java | 17 +
 .../igfs/meta/IgfsMetaUpdatePathProcessor.java | 17 +
 .../meta/IgfsMetaUpdatePropertiesProcessor.java| 17 +
 .../igfs/meta/IgfsMetaUpdateTimesProcessor.java| 17 +
 13 files changed, 221 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/76191ff3/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
index ded66bf..dcca298 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryCreateProcessor.java
@@ -1,3 +1,20 @@
+/*
+ * 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.igfs.meta;
 
 import org.apache.ignite.binary.BinaryObjectException;

http://git-wip-us.apache.org/repos/asf/ignite/blob/76191ff3/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
index d45dea1..f27bdd5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/meta/IgfsMetaDirectoryListingAddProcessor.java
@@ -1,3 +1,20 @@
+/*
+ * 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
+ * l

[42/47] ignite git commit: Now cache plugins are able to unwrap entries passed to EntryProcessor.

2016-04-05 Thread vkulichenko
Now cache plugins are able to unwrap entries passed to EntryProcessor.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ec2ec996
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ec2ec996
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ec2ec996

Branch: refs/heads/gridgain-7.5.11-vk
Commit: ec2ec9965ae03ef3666b2035a13f444cf2765aec
Parents: a70d2dc
Author: dkarachentsev 
Authored: Wed Mar 30 13:29:36 2016 +0300
Committer: dkarachentsev 
Committed: Tue Apr 5 12:06:22 2016 +0300

--
 .../processors/cache/CacheInvokeEntry.java  | 41 +++-
 .../processors/cache/CacheLazyEntry.java|  9 -
 .../processors/cache/GridCacheMapEntry.java |  9 +++--
 .../distributed/dht/GridDhtTxPrepareFuture.java | 12 +++---
 .../dht/atomic/GridDhtAtomicCache.java  |  4 +-
 .../local/atomic/GridLocalAtomicCache.java  |  4 +-
 .../cache/transactions/IgniteTxAdapter.java |  8 ++--
 .../cache/transactions/IgniteTxEntry.java   |  4 +-
 .../transactions/IgniteTxLocalAdapter.java  |  5 +--
 .../processors/plugin/CachePluginManager.java   | 25 
 .../ignite/plugin/CachePluginProvider.java  | 11 ++
 ...CacheDeploymentCachePluginConfiguration.java |  7 
 12 files changed, 107 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/ec2ec996/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index 2ecfdbf..2526146 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -40,44 +40,53 @@ public class CacheInvokeEntry extends 
CacheLazyEntry implements Muta
 /** Entry version. */
 private GridCacheVersion ver;
 
+/** Cache entry instance. */
+private GridCacheEntryEx entry;
+
 /**
- * @param cctx Cache context.
+ * Constructor.
+ *
  * @param keyObj Key cache object.
  * @param valObj Cache object value.
  * @param ver Entry version.
+ * @param keepBinary Keep binary flag.
+ * @param entry Original entry.
  */
-public CacheInvokeEntry(GridCacheContext cctx,
-KeyCacheObject keyObj,
+public CacheInvokeEntry(KeyCacheObject keyObj,
 @Nullable CacheObject valObj,
 GridCacheVersion ver,
-boolean keepBinary
+boolean keepBinary,
+GridCacheEntryEx entry
 ) {
-super(cctx, keyObj, valObj, keepBinary);
+super(entry.context(), keyObj, valObj, keepBinary);
 
 this.hadVal = valObj != null;
 this.ver = ver;
+this.entry = entry;
 }
 
 /**
- * @param ctx Cache context.
  * @param keyObj Key cache object.
  * @param key Key value.
  * @param valObj Value cache object.
  * @param val Value.
  * @param ver Entry version.
+ * @param keepBinary Keep binary flag.
+ * @param entry Grid cache entry.
  */
-public CacheInvokeEntry(GridCacheContext ctx,
-KeyCacheObject keyObj,
+public CacheInvokeEntry(KeyCacheObject keyObj,
 @Nullable K key,
 @Nullable CacheObject valObj,
 @Nullable V val,
 GridCacheVersion ver,
-boolean keepBinary
+boolean keepBinary,
+GridCacheEntryEx entry
 ) {
-super(ctx, keyObj, key, valObj, val, keepBinary);
+super(entry.context(), keyObj, key, valObj, val, keepBinary);
 
 this.hadVal = valObj != null || val != null;
 this.ver = ver;
+this.entry = entry;
 }
 
 /** {@inheritDoc} */
@@ -122,12 +131,24 @@ public class CacheInvokeEntry extends 
CacheLazyEntry implements Muta
 return op != Operation.NONE;
 }
 
+/**
+ * @return Cache entry instance.
+ */
+public GridCacheEntryEx entry() {
+return entry;
+}
+
 /** {@inheritDoc} */
 @SuppressWarnings("unchecked")
 @Override public  T unwrap(Class cls) {
 if (cls.isAssignableFrom(CacheEntry.class) && ver != null)
 return (T)new CacheEntryImplEx<>(getKey(), getValue(), ver);
 
+final T res = cctx.plugin().unwrapCacheEntry(this, cls);
+
+if (res != null)
+return res;
+
 return super.unwrap(cls);
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec2ec996/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java

[34/47] ignite git commit: IGNITE-2806: IGFS: Implemented relaxed consistency model.

2016-04-05 Thread vkulichenko
IGNITE-2806: IGFS: Implemented relaxed consistency model.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b286facc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b286facc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b286facc

Branch: refs/heads/gridgain-7.5.11-vk
Commit: b286facc4b8c44ab1628039dded6c7527760df73
Parents: 8d95eba
Author: vozerov-gridgain 
Authored: Tue Mar 22 12:34:35 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:16 2016 +0300

--
 .../configuration/FileSystemConfiguration.java  | 49 +-
 .../processors/igfs/IgfsMetaManager.java| 38 --
 .../internal/processors/igfs/IgfsPathIds.java   | 52 ++--
 .../internal/processors/igfs/IgfsProcessor.java | 29 ++-
 .../processors/igfs/IgfsAbstractSelfTest.java   | 11 +
 .../igfs/IgfsPrimaryRelaxedSelfTest.java| 28 +++
 .../processors/igfs/IgfsProcessorSelfTest.java  | 17 ---
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |  2 +
 8 files changed, 177 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/b286facc/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index 99d364e..0d7f3cc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.configuration;
 
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
 import org.apache.ignite.igfs.IgfsMode;
@@ -27,6 +25,9 @@ import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+
 /**
  * {@code IGFS} configuration. More than one file system can be configured 
within grid.
  * {@code IGFS} configuration is provided via {@link 
IgniteConfiguration#getFileSystemConfiguration()}
@@ -87,6 +88,9 @@ public class FileSystemConfiguration {
 /** Default value of metadata co-location flag. */
 public static boolean DFLT_COLOCATE_META = true;
 
+/** Default value of relaxed consistency flag. */
+public static boolean DFLT_RELAXED_CONSISTENCY = true;
+
 /** IGFS instance name. */
 private String name;
 
@@ -171,6 +175,9 @@ public class FileSystemConfiguration {
 /** Metadata co-location flag. */
 private boolean colocateMeta = DFLT_COLOCATE_META;
 
+/** Relaxed consistency flag. */
+private boolean relaxedConsistency = DFLT_RELAXED_CONSISTENCY;
+
 /**
  * Constructs default configuration.
  */
@@ -215,6 +222,7 @@ public class FileSystemConfiguration {
 perNodeBatchSize = cfg.getPerNodeBatchSize();
 perNodeParallelBatchCnt = cfg.getPerNodeParallelBatchCount();
 prefetchBlocks = cfg.getPrefetchBlocks();
+relaxedConsistency = cfg.isRelaxedConsistency();
 seqReadsBeforePrefetch = cfg.getSequentialReadsBeforePrefetch();
 trashPurgeTimeout = cfg.getTrashPurgeTimeout();
 }
@@ -877,6 +885,43 @@ public class FileSystemConfiguration {
 this.colocateMeta = colocateMeta;
 }
 
+/**
+ * Get relaxed consistency flag.
+ * 
+ * Concurrent file system operations might conflict with each other. E.g. 
{@code move("/a1/a2", "/b")} and
+ * {@code move("/b", "/a1")}. Hence, it is necessary to atomically verify 
that participating paths are still
+ * on their places to keep file system in consistent state in such cases. 
These checks are expensive in
+ * distributed environment.
+ * 
+ * Real applications, e.g. Hadoop jobs, rarely produce conflicting 
operations. So additional checks could be
+ * skipped in these scenarios without any negative effect on file system 
integrity. It significantly increases
+ * performance of file system operations.
+ * 
+ * If value of this flag is {@code true}, IGFS will skip expensive 
consistency checks. It is recommended to set
+ * this flag to {@code false} if your application has conflicting 
operations, or you do not how exactly users will
+ * use your system.
+ * 
+ * This property affects only {@link IgfsMode#PRIMARY} paths.
+ * 
+ * Defaults to {@link #DFLT_RELAXED_CONSISTENCY}.
+ 

[19/47] ignite git commit: IGNITE-2860: IGFS: Reworked base meta operations.

2016-04-05 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a93c3bf/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
index 19a91ad..26424f0 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.Callable;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
@@ -29,7 +24,6 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
 import org.apache.ignite.igfs.IgfsPath;
-import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteUuid;
@@ -38,6 +32,12 @@ import 
org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -142,7 +142,7 @@ public class IgfsMetaManagerSelfTest extends 
IgfsCommonAbstractTest {
 assertEmpty(mgr.directoryListing(ROOT_ID));
 
 assertTrue(mgr.mkdirs(new IgfsPath("/dir"), IgfsImpl.DFLT_DIR_META));
-assertNotNull(mgr.create(new IgfsPath("/file"), false, false, null, 
400, null, false, null));
+assertNotNull(mgr.create(new IgfsPath("/file"), null, false, 400, 
null, false, null));
 
 IgfsListingEntry dirEntry = mgr.directoryListing(ROOT_ID).get("dir");
 assertNotNull(dirEntry);
@@ -214,7 +214,7 @@ public class IgfsMetaManagerSelfTest extends 
IgfsCommonAbstractTest {
 private IgfsFileInfo createFileAndGetInfo(String path) throws 
IgniteCheckedException {
 IgfsPath p = path(path);
 
-IgniteBiTuple t2 = mgr.create(p, false, 
false, null, 400, null, false, null);
+IgniteBiTuple t2 = mgr.create(p, null, 
false, 400, null, false, null);
 
 assert t2 != null;
 assert !t2.get1().isDirectory();
@@ -297,14 +297,13 @@ public class IgfsMetaManagerSelfTest extends 
IgfsCommonAbstractTest {
 assertEquals(Arrays.asList(ROOT_ID, null, null, null, null), 
mgr.fileIds(new IgfsPath("/f7/a/b/f6")));
 
 // One of participated files does not exist in cache.
-expectsRenameFail("/b8", "/b2", "Failed to perform move because some 
path component was not found.");
+expectsRenameFail("/b8", "/b2");
 
-expectsRenameFail("/a", "/b/b8", "Failed to perform move because some 
path component was not found.");
+expectsRenameFail("/a", "/b/b8");
 
-expectsRenameFail("/a/f2", "/a/b/f3", "Failed to perform move because 
destination points to existing file");
+expectsRenameFail("/a/f2", "/a/b/f3");
 
-expectsRenameFail("/a/k", "/a/b/", "Failed to perform move because 
destination already " +
-"contains entry with the same name existing file");
+expectsRenameFail("/a/k", "/a/b/");
 
 mgr.delete(a.id(), "k", z.id());
 mgr.delete(b.id(), "k", k.id());
@@ -414,17 +413,15 @@ public class IgfsMetaManagerSelfTest extends 
IgfsCommonAbstractTest {
 
 /**
  * Test expected failures for 'move file' operation.
- *
- * @param msg Failure message if expected exception was not thrown.
  */
-private void expectsRenameFail(final String src, final String dst, 
@Nullable String msg) {
+private void expectsRenameFail(final String src, final String dst) {
 Throwable err = assertThrowsInherited(log, new Callable() {
 @Override public Object call() throws Exception {
 mgr.move(new IgfsPath(src), new IgfsPath(dst));
 
 return null;
 }
-}, IgfsException.class, msg);
+}, IgfsException.class, null);
 
 assertTrue("Unexpected cause: " + err, err instanceof IgfsException);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob

[12/47] ignite git commit: IGNITE-2810: IGFS: Minor correction to IgfsUtils.isRootOrTrashId() method.

2016-04-05 Thread vkulichenko
IGNITE-2810: IGFS: Minor correction to IgfsUtils.isRootOrTrashId() method.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/54e6991c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/54e6991c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/54e6991c

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 54e6991cb1d0b68c4490dede603c9e3ba7cc3b9e
Parents: 37c4d50
Author: vozerov-gridgain 
Authored: Mon Mar 14 12:05:39 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:02 2016 +0300

--
 .../internal/processors/igfs/IgfsUtils.java | 22 ++--
 1 file changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/54e6991c/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 6f8960a..edded2f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -98,12 +98,22 @@ public class IgfsUtils {
 }
 
 /**
+ * Check whether provided ID is either root ID or trash ID.
+ *
+ * @param id ID.
+ * @return {@code True} if this is root ID or trash ID.
+ */
+public static boolean isRootOrTrashId(@Nullable IgniteUuid id) {
+return id != null && (ROOT_ID.equals(id) || isTrashId(id));
+}
+
+/**
  * Check whether provided ID is trash ID.
  *
  * @param id ID.
  * @return {@code True} if this is trash ID.
  */
-public static boolean isTrashId(IgniteUuid id) {
+private static boolean isTrashId(IgniteUuid id) {
 assert id != null;
 
 UUID gid = id.globalId();
@@ -113,16 +123,6 @@ public class IgfsUtils {
 }
 
 /**
- * Check whether provided ID is either root ID or trash ID.
- *
- * @param id ID.
- * @return {@code True} if this is root ID or trash ID.
- */
-public static boolean isRootOrTrashId(IgniteUuid id) {
-return ROOT_ID.equals(id) || isTrashId(id);
-}
-
-/**
  * Converts any passed exception to IGFS exception.
  *
  * @param err Initial exception.



[44/47] ignite git commit: ignite-2835 Minor test changes.

2016-04-05 Thread vkulichenko
ignite-2835 Minor test changes.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d33b4340
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d33b4340
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d33b4340

Branch: refs/heads/gridgain-7.5.11-vk
Commit: d33b4340a68553e59e4adecf78fea79af55bf2ae
Parents: e85a717
Author: sboikov 
Authored: Tue Apr 5 16:42:50 2016 +0300
Committer: sboikov 
Committed: Tue Apr 5 16:42:50 2016 +0300

--
 .../BinaryObjectOffHeapUnswapTemporaryTest.java | 55 
 1 file changed, 23 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/d33b4340/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
index 4272a14..d63b2c3 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
@@ -35,6 +35,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
+import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -81,7 +82,7 @@ public class BinaryObjectOffHeapUnswapTemporaryTest extends 
GridCommonAbstractTe
 CacheMemoryMode memoryMode) {
 this.atomicityMode = atomicityMode;
 
-CacheConfiguration cfg = new CacheConfiguration();
+CacheConfiguration cfg = new CacheConfiguration<>();
 
 cfg.setCacheMode(CacheMode.PARTITIONED);
 cfg.setAtomicityMode(atomicityMode);
@@ -184,50 +185,50 @@ public class BinaryObjectOffHeapUnswapTemporaryTest 
extends GridCommonAbstractTe
 for (int i = 0; i < 2 * CNT; i++)
 keys.add(i);
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.get(key) instanceof BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
-assertFalse(cache.getEntry(key) instanceof 
BinaryObjectOffheapImpl);
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
+assertFalse(cache.getEntry(key).getValue() instanceof 
BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.getAndPut(key, cache.get(key)) instanceof 
BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.getAndReplace(key, cache.get(key)) 
instanceof BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.getAndPutIfAbsent(key, cache.get(key)) 
instanceof BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.localPeek(key) instanceof 
BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) {
+check(new IgniteInClosure() {
+@Override public void apply(Integer key) {
 assertFalse(cache.getAndRemove(key) instanceof 
BinaryObjectOffheapImpl);
 }
 });
 
-check(new TestCheck() {
-@Override public void check(Integer key) 

[18/47] ignite git commit: IGNITE-2846: IGFS: Reworked IgfsMetaManager.updateInfo() operation to use "invoke" instead of "put".

2016-04-05 Thread vkulichenko
IGNITE-2846: IGFS: Reworked IgfsMetaManager.updateInfo() operation to use 
"invoke" instead of "put".


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f57f3657
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f57f3657
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f57f3657

Branch: refs/heads/gridgain-7.5.11-vk
Commit: f57f3657b1da33abf28f885cd405780dabfd57e3
Parents: 3e59321
Author: vozerov-gridgain 
Authored: Wed Mar 16 13:22:07 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:24 2016 +0300

--
 .../internal/processors/igfs/IgfsFileMap.java   |   9 +-
 .../igfs/IgfsFragmentizerManager.java   | 166 ++-
 .../igfs/IgfsInvalidRangeException.java |   4 +-
 .../processors/igfs/IgfsMetaManager.java|  67 
 .../igfs/IgfsMetaManagerSelfTest.java   |  11 --
 5 files changed, 161 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/f57f3657/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileMap.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileMap.java
index 2c0358b..9ea69ea 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileMap.java
@@ -128,12 +128,11 @@ public class IgfsFileMap implements Externalizable {
  *
  * @param range Range to update status.
  * @param status New range status.
- * @throws IgniteCheckedException If range was not found.
  */
-public void updateRangeStatus(IgfsFileAffinityRange range, int status) 
throws IgniteCheckedException {
+public void updateRangeStatus(IgfsFileAffinityRange range, int status) {
 if (ranges == null)
 throw new IgfsInvalidRangeException("Failed to update range status 
(file map is empty) " +
-"[range=" + range + ", ranges=" + ranges + ']');
+"[range=" + range + ", ranges=null]");
 
 assert !ranges.isEmpty();
 
@@ -190,10 +189,10 @@ public class IgfsFileMap implements Externalizable {
  *
  * @param range Range to delete.
  */
-public void deleteRange(IgfsFileAffinityRange range) throws 
IgniteCheckedException {
+public void deleteRange(IgfsFileAffinityRange range) {
 if (ranges == null)
 throw new IgfsInvalidRangeException("Failed to remove range (file 
map is empty) " +
-"[range=" + range + ", ranges=" + ranges + ']');
+"[range=" + range + ", ranges=null]");
 
 assert !ranges.isEmpty();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f57f3657/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
index 899730d..7cc5cb6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java
@@ -17,6 +17,10 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -41,19 +45,22 @@ import 
org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridSpinReadWriteLock;
-import org.apache.ignite.internal.util.typedef.CX1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.P1;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.LT;
+import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.thread.IgniteThread;
 import org.jetbrains.annotations.Nullable;
 
+impor

[38/47] ignite git commit: IGNITE-2883: IGFS: Now IPC messages are handled in a dedicated thread pool.

2016-04-05 Thread vkulichenko
IGNITE-2883: IGFS: Now IPC messages are handled in a dedicated thread pool.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/59705e00
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/59705e00
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/59705e00

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 59705e008267b1d5926410f95c68bb8ffb8cd93c
Parents: 01a6e86
Author: vozerov-gridgain 
Authored: Thu Mar 24 14:29:35 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:32 2016 +0300

--
 .../igfs/IgfsIpcEndpointConfiguration.java  | 28 +++
 .../processors/igfs/IgfsIpcHandler.java | 81 +++-
 .../internal/processors/igfs/IgfsProcessor.java | 11 ++-
 .../internal/processors/igfs/IgfsServer.java|  2 +-
 .../igfs/IgfsProcessorValidationSelfTest.java   | 16 
 5 files changed, 117 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/59705e00/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
index 23993a6..1c68d0f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
@@ -49,6 +49,9 @@ public class IgfsIpcEndpointConfiguration {
  */
 public static final String DFLT_TOKEN_DIR_PATH = "ipc/shmem";
 
+/** Default threads count. */
+public static final int DFLT_THREAD_CNT = 
IgniteConfiguration.AVAILABLE_PROC_CNT;
+
 /** Endpoint type. */
 private IgfsIpcEndpointType type = DFLT_TYPE;
 
@@ -64,6 +67,9 @@ public class IgfsIpcEndpointConfiguration {
 /** Token directory path. */
 private String tokenDirPath = DFLT_TOKEN_DIR_PATH;
 
+/** Thread count. */
+private int threadCnt = DFLT_THREAD_CNT;
+
 /**
  * Default constructor.
  */
@@ -236,6 +242,28 @@ public class IgfsIpcEndpointConfiguration {
 this.tokenDirPath = tokenDirPath;
 }
 
+/**
+ * Get number of threads used by this endpoint to process incoming 
requests.
+ * 
+ * Defaults to {@link #DFLT_THREAD_CNT}.
+ *
+ * @return Number of threads used by this endpoint to process incoming 
requests.
+ */
+public int getThreadCount() {
+return threadCnt;
+}
+
+/**
+ * Set number of threads used by this endpoint to process incoming 
requests.
+ * 
+ * See {@link #getThreadCount()} for more information.
+ *
+ * @param threadCnt Number of threads used by this endpoint to process 
incoming requests.
+ */
+public void setThreadCount(int threadCnt) {
+this.threadCnt = threadCnt;
+}
+
 /** {@inheritDoc} */
 @Override public String toString() {
 return S.toString(IgfsIpcEndpointConfiguration.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/59705e00/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
index eadbdb2..bf87384 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.igfs;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
 import org.apache.ignite.igfs.IgfsOutOfSpaceException;
 import org.apache.ignite.igfs.IgfsOutputStream;
 import org.apache.ignite.igfs.IgfsUserContext;
@@ -31,20 +32,22 @@ import 
org.apache.ignite.internal.igfs.common.IgfsIpcCommand;
 import org.apache.ignite.internal.igfs.common.IgfsMessage;
 import org.apache.ignite.internal.igfs.common.IgfsPathControlRequest;
 import org.apache.ignite.internal.igfs.common.IgfsStreamControlRequest;
-import org.apache.ignite.internal.processors.closure.GridClosurePolicy;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
-import org.apache.ignite.internal.util.lang.GridPlainCallable;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import 

[32/47] ignite git commit: IGNITE-2811: IGFS: Optimized properties handling.

2016-04-05 Thread vkulichenko
IGNITE-2811: IGFS: Optimized properties handling.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e886ad0a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e886ad0a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e886ad0a

Branch: refs/heads/gridgain-7.5.11-vk
Commit: e886ad0aa800cddb3308fa5f8400902e5879ee3c
Parents: 218132d
Author: vozerov-gridgain 
Authored: Tue Mar 22 10:28:13 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:07 2016 +0300

--
 .../internal/processors/igfs/IgfsEntryInfo.java |   8 +-
 .../ignite/internal/processors/igfs/IgfsEx.java |  12 --
 .../internal/processors/igfs/IgfsImpl.java  |   2 +-
 .../processors/igfs/IgfsOutputStreamImpl.java   |   2 +-
 .../internal/processors/igfs/IgfsUtils.java | 113 +++
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |   8 +-
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  |   8 +-
 .../meta/IgfsMetaUpdatePropertiesProcessor.java |   5 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |  20 ++--
 .../igfs/IgfsDualAbstractSelfTest.java  |  13 ++-
 .../processors/igfs/IgfsStreamsSelfTest.java|   2 +-
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |   8 +-
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java|  19 ++--
 .../hadoop/fs/v2/IgniteHadoopFileSystem.java|  21 ++--
 .../hadoop/igfs/HadoopIgfsProperties.java   |  11 +-
 ...oopFileSystemUniversalFileSystemAdapter.java |   8 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |   5 +-
 17 files changed, 187 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/e886ad0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
index d31ef72..45cf828 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEntryInfo.java
@@ -314,7 +314,9 @@ public abstract class IgfsEntryInfo implements 
Externalizable {
  */
 protected void writeBinary(BinaryRawWriter out) {
 BinaryUtils.writeIgniteUuid(out, id);
-out.writeMap(props);
+
+IgfsUtils.writeProperties(out, props);
+
 out.writeLong(accessTime);
 out.writeLong(modificationTime);
 out.writeObject(path);
@@ -327,7 +329,9 @@ public abstract class IgfsEntryInfo implements 
Externalizable {
  */
 protected void readBinary(BinaryRawReader in) {
 id = BinaryUtils.readIgniteUuid(in);
-props = in.readMap();
+
+props = IgfsUtils.readProperties(in);
+
 accessTime = in.readLong();
 modificationTime = in.readLong();
 path = in.readObject();

http://git-wip-us.apache.org/repos/asf/ignite/blob/e886ad0a/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 cf268e0..fb67e20 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
@@ -31,18 +31,6 @@ import org.jetbrains.annotations.Nullable;
  * Internal API extension for {@link org.apache.ignite.IgniteFileSystem}.
  */
 public interface IgfsEx extends IgniteFileSystem {
-/** File property: user name. */
-public static final String PROP_USER_NAME = "usrName";
-
-/** File property: group name. */
-public static final String PROP_GROUP_NAME = "grpName";
-
-/** File property: permission. */
-public static final String PROP_PERMISSION = "permission";
-
-/** File property: prefer writes to local node. */
-public static final String PROP_PREFER_LOCAL_WRITES = "locWrite";
-
 /**
  * Stops IGFS cleaning all used resources.
  *

http://git-wip-us.apache.org/repos/asf/ignite/blob/e886ad0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 398428a..e3a82a5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.ja

[04/47] ignite git commit: IGNITE-2849: BinaryObjectBuilder doesn't properly check metadata

2016-04-05 Thread vkulichenko
IGNITE-2849: BinaryObjectBuilder doesn't properly check metadata


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d36a2e51
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d36a2e51
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d36a2e51

Branch: refs/heads/gridgain-7.5.11-vk
Commit: d36a2e51e3aa3105dff73839c84e52a531fbd918
Parents: 9e84e50
Author: Denis Magda 
Authored: Thu Mar 24 20:07:48 2016 +0300
Committer: Denis Magda 
Committed: Mon Mar 28 17:34:19 2016 +0300

--
 .../cache/store/jdbc/CacheJdbcPojoStore.java|   2 +-
 .../ignite/internal/binary/BinaryUtils.java |  16 ---
 .../binary/builder/BinaryObjectBuilderImpl.java | 107 --
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 144 +--
 ...naryObjectBuilderDefaultMappersSelfTest.java |   2 +-
 5 files changed, 197 insertions(+), 74 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/d36a2e51/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index 200aa0f..b9a3118 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -248,7 +248,7 @@ public class CacheJdbcPojoStore extends 
CacheAbstractJdbcStore {
 
 Object colVal = getColumnValue(rs, colIdx, 
field.getJavaFieldType());
 
-builder.setField(field.getJavaFieldName(), colVal);
+builder.setField(field.getJavaFieldName(), colVal, 
(Class)field.getJavaFieldType());
 
 if (calcHash)
 hashValues.add(colVal);

http://git-wip-us.apache.org/repos/asf/ignite/blob/d36a2e51/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index 4a79f22..eefdc3f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -317,22 +317,6 @@ public class BinaryUtils {
 }
 
 /**
- * @param typeName Field type name.
- * @return Field type ID;
- */
-@SuppressWarnings("StringEquality")
-public static int fieldTypeId(String typeName) {
-for (int i = 0; i < FIELD_TYPE_NAMES.length; i++) {
-String typeName0 = FIELD_TYPE_NAMES[i];
-
-if (typeName.equals(typeName0))
-return i;
-}
-
-throw new IllegalArgumentException("Invalid metadata type name: " + 
typeName);
-}
-
-/**
  * @param typeId Field type ID.
  * @return Field type name.
  */

http://git-wip-us.apache.org/repos/asf/ignite/blob/d36a2e51/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
index 9043a8b..16c51b0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
@@ -195,6 +195,10 @@ public class BinaryObjectBuilderImpl implements 
BinaryObjectBuilder {
 
 Set remainsFlds = null;
 
+BinaryType meta = ctx.metadata(typeId);
+
+Map fieldsMeta = null;
+
 if (reader != null) {
 BinarySchema schema = reader.schema();
 
@@ -204,9 +208,15 @@ public class BinaryObjectBuilderImpl implements 
BinaryObjectBuilder {
 assignedFldsById = U.newHashMap(assignedVals.size());
 
 for (Map.Entry entry : 
assignedVals.entrySet()) {
-int fieldId = ctx.fieldId(typeId, entry.getKey());
+String name = entry.getKey();
+Object val = entry.getValue();
+
+int fieldId = ctx.fieldId(typeId, name);
 
-assignedFldsById.put(fieldId, entry.getValue());
+assignedFldsById.put(fieldId, val);
+
+ 

[15/47] ignite git commit: IGNITE-2838: IGFS: Opimized format of IgfsListingEntry. Now it contains only file ID and boolean flag endicating whether this a directory or file.

2016-04-05 Thread vkulichenko
IGNITE-2838: IGFS: Opimized format of IgfsListingEntry. Now it contains only 
file ID and boolean flag endicating whether this a directory or file.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ba30ddbc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ba30ddbc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ba30ddbc

Branch: refs/heads/gridgain-7.5.11-vk
Commit: ba30ddbc599d67f398ffba1263d174f5b58b4b7d
Parents: a7c1f44
Author: thatcoach 
Authored: Tue Mar 15 20:46:13 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:14 2016 +0300

--
 .../internal/processors/igfs/IgfsFileImpl.java  |  29 ---
 .../internal/processors/igfs/IgfsFileInfo.java  |  38 +++-
 .../internal/processors/igfs/IgfsImpl.java  |   8 +-
 .../processors/igfs/IgfsListingEntry.java   | 129 ++-
 .../processors/igfs/IgfsMetaManager.java| 221 +++
 .../processors/igfs/IgfsOutputStreamImpl.java   |   2 -
 6 files changed, 88 insertions(+), 339 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/ba30ddbc/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
index 4a96e81..3576a06 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
@@ -124,35 +124,6 @@ public final class IgfsFileImpl implements IgfsFile, 
Externalizable {
 modificationTime = info.modificationTime();
 }
 
-/**
- * Constructs file instance.
- *
- * @param path Path.
- * @param entry Listing entry.
- */
-public IgfsFileImpl(IgfsPath path, IgfsListingEntry entry, long 
globalGrpSize) {
-A.notNull(path, "path");
-A.notNull(entry, "entry");
-
-this.path = path;
-fileId = entry.fileId();
-
-blockSize = entry.blockSize();
-
-// By contract file must have blockSize > 0, while directory's 
blockSize == 0:
-assert entry.isFile() == (blockSize > 0);
-assert entry.isDirectory() == (blockSize == 0);
-
-grpBlockSize = entry.affinityKey() == null ? globalGrpSize :
-entry.length() == 0 ? globalGrpSize : entry.length();
-
-len = entry.length();
-props = entry.properties();
-
-accessTime = entry.accessTime();
-modificationTime = entry.modificationTime();
-}
-
 /** {@inheritDoc} */
 @Override public IgfsPath path() {
 return path;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ba30ddbc/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
index 0a85657..ba484bb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
@@ -297,9 +297,6 @@ public final class IgfsFileInfo implements Externalizable {
 this.props = props == null || props.isEmpty() ? null :
 cpProps ? new GridLeanMap<>(props) : props;
 
-if (listing == null && isDir)
-this.listing = Collections.emptyMap();
-
 this.lockId = lockId;
 this.evictExclude = evictExclude;
 }
@@ -410,13 +407,38 @@ public final class IgfsFileInfo implements Externalizable 
{
  * @return Directory listing.
  */
 public Map listing() {
-// Always wrap into unmodifiable map to be able to avoid illegal 
modifications in order pieces of the code.
-if (isFile())
-return Collections.unmodifiableMap(Collections.emptyMap());
+return listing != null ? listing : Collections.emptyMap();
+}
+
+/**
+ * @return {@code True} if at least one child exists.
+ */
+public boolean hasChildren() {
+return !F.isEmpty(listing);
+}
+
+/**
+ * @param name Child name.
+ * @return {@code True} if child with such name exists.
+ */
+public boolean hasChild(String name) {
+return listing != null && listing.containsKey(name);
+}
 
-assert listing != null;
+/**
+ * @param name Child name.
+ * @param expId Expected child ID.
+ * @return {@code True} if child with such

[03/47] ignite git commit: Divide test suite.

2016-04-05 Thread vkulichenko
Divide test suite.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e84e508
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e84e508
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e84e508

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 9e84e508a394b790ef046cdcf2a015bcf853c064
Parents: 60e7461
Author: nikolay_tikhonov 
Authored: Mon Mar 28 16:59:56 2016 +0300
Committer: nikolay_tikhonov 
Committed: Mon Mar 28 16:59:56 2016 +0300

--
 ...acheContinuousQueryRandomOperationsTest.java |  8 ++--
 .../IgniteBinaryCacheQueryTestSuite4.java   | 39 
 .../IgniteCacheQuerySelfTestSuite3.java | 12 -
 .../IgniteCacheQuerySelfTestSuite4.java | 49 
 4 files changed, 92 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/9e84e508/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
index b1316ab..e9fbf70 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
@@ -146,13 +146,13 @@ public class CacheContinuousQueryRandomOperationsTest 
extends GridCommonAbstract
  * @throws Exception If failed.
  */
 public void testFilterAndFactoryProvided() throws Exception {
-CacheConfiguration ccfg = 
cacheConfiguration(PARTITIONED,
+final CacheConfiguration ccfg = 
cacheConfiguration(PARTITIONED,
 1,
 ATOMIC,
 ONHEAP_TIERED,
 false);
 
-final IgniteCache cache = 
grid(0).getOrCreateCache(ccfg);
+grid(0).createCache(ccfg);
 
 try {
 final ContinuousQuery qry = new ContinuousQuery();
@@ -177,13 +177,13 @@ public class CacheContinuousQueryRandomOperationsTest 
extends GridCommonAbstract
 
 GridTestUtils.assertThrows(log, new Callable() {
 @Override public Object call() throws Exception {
-return cache.query(qry);
+return grid(0).cache(ccfg.getName()).query(qry);
 }
 }, IgniteException.class, null);
 
 }
 finally {
-cache.destroy();
+grid(0).destroyCache(ccfg.getName());
 }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9e84e508/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
--
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
new file mode 100644
index 000..32a693f
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
@@ -0,0 +1,39 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with binary marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite4 extends TestSuite {
+/**
+ * @return Suite.
+ * @throws Exception In case of error.
+ */
+public static TestSuite suite() throws Exception {
+GridTestProperties.setProperty(GridTestPrope

[30/47] ignite git commit: IGNITE-2869: IGFS: Slightly improved serialization of IgfsListingEntry.

2016-04-05 Thread vkulichenko
IGNITE-2869: IGFS: Slightly improved serialization of IgfsListingEntry.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ee5ea53b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ee5ea53b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ee5ea53b

Branch: refs/heads/gridgain-7.5.11-vk
Commit: ee5ea53bf9c4ad897459466e0b9b5447fc93ec2a
Parents: 76191ff
Author: vozerov-gridgain 
Authored: Tue Mar 22 09:20:32 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:59 2016 +0300

--
 .../processors/igfs/IgfsDirectoryInfo.java  | 30 +++-
 .../internal/processors/igfs/IgfsUtils.java | 38 
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |  4 +--
 .../IgfsMetaDirectoryListingAddProcessor.java   |  7 ++--
 4 files changed, 74 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/ee5ea53b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
index 233c8ee..a426e8c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDirectoryInfo.java
@@ -23,7 +23,6 @@ import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.binary.BinaryReader;
 import org.apache.ignite.binary.BinaryWriter;
 import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -35,6 +34,7 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -198,6 +198,20 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo 
implements Binarylizable {
 
 writeBinary(out);
 
+if (listing != null) {
+out.writeBoolean(true);
+
+out.writeInt(listing.size());
+
+for (Map.Entry entry : 
listing.entrySet()) {
+out.writeString(entry.getKey());
+
+IgfsUtils.writeListingEntry(out, entry.getValue());
+}
+}
+else
+out.writeBoolean(false);
+
 out.writeMap(listing);
 }
 
@@ -207,6 +221,20 @@ public class IgfsDirectoryInfo extends IgfsEntryInfo 
implements Binarylizable {
 
 readBinary(in);
 
+if (in.readBoolean()) {
+int listingSize = in.readInt();
+
+listing = new HashMap<>(listingSize);
+
+for (int i = 0; i < listingSize; i++) {
+String key = in.readString();
+
+IgfsListingEntry val = IgfsUtils.readListingEntry(in);
+
+listing.put(key, val);
+}
+}
+
 listing = in.readMap();
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ee5ea53b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 325f636..7063f68 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -20,6 +20,8 @@ package org.apache.ignite.internal.processors.igfs;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterTopologyException;
@@ -30,6 +32,7 @@ import org.apache.ignite.events.IgfsEvent;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import 
org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
 import 
org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
 import org.apache.ignite.internal.processors.cache.IgniteI

[33/47] ignite git commit: IGNITE-2871: IGFS: Removed "path" from IgfsEntryInfo. Purge event is never fired now, it will be fixed as a part of IGNITE-1679.

2016-04-05 Thread vkulichenko
IGNITE-2871: IGFS: Removed "path" from IgfsEntryInfo. Purge event is never 
fired now, it will be fixed as a part of IGNITE-1679.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8d95ebac
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8d95ebac
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8d95ebac

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 8d95ebacaa01f3f9271a1ce0d1b991dfead1d0c1
Parents: e886ad0
Author: vozerov-gridgain 
Authored: Tue Mar 22 12:06:51 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:11 2016 +0300

--
 .../ignite/internal/binary/BinaryContext.java   |   2 -
 .../processors/igfs/IgfsDeleteWorker.java   |   8 +-
 .../internal/processors/igfs/IgfsEntryInfo.java |  29 --
 .../internal/processors/igfs/IgfsImpl.java  |  45 
 .../processors/igfs/IgfsInputStreamImpl.java|   2 +-
 .../processors/igfs/IgfsMetaManager.java|  73 -
 .../processors/igfs/IgfsOutputStreamImpl.java   |  19 +---
 .../processors/igfs/IgfsPathsCreateResult.java  |  15 +--
 .../IgfsSecondaryOutputStreamDescriptor.java|  17 +---
 .../internal/processors/igfs/IgfsUtils.java |  20 +++-
 .../igfs/meta/IgfsMetaUpdatePathProcessor.java  | 102 ---
 .../ignite/igfs/IgfsEventsAbstractSelfTest.java |  32 +-
 .../igfs/IgfsMetaManagerSelfTest.java   |   8 +-
 13 files changed, 78 insertions(+), 294 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/8d95ebac/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index c9ad1e9..b357345 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -80,7 +80,6 @@ import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileRangeDeletePr
 import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileRangeUpdateProcessor;
 import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileReserveSpaceProcessor;
 import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileUnlockProcessor;
-import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaUpdatePathProcessor;
 import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaUpdatePropertiesProcessor;
 import 
org.apache.ignite.internal.processors.igfs.meta.IgfsMetaUpdateTimesProcessor;
 import org.apache.ignite.internal.util.IgniteUtils;
@@ -135,7 +134,6 @@ public class BinaryContext {
 sysClss.add(IgfsMetaFileRangeUpdateProcessor.class.getName());
 sysClss.add(IgfsMetaFileReserveSpaceProcessor.class.getName());
 sysClss.add(IgfsMetaFileUnlockProcessor.class.getName());
-sysClss.add(IgfsMetaUpdatePathProcessor.class.getName());
 sysClss.add(IgfsMetaUpdatePropertiesProcessor.class.getName());
 sysClss.add(IgfsMetaUpdateTimesProcessor.class.getName());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8d95ebac/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
index f6b26ab..7e4dac8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java
@@ -38,7 +38,6 @@ import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import static org.apache.ignite.events.EventType.EVT_IGFS_FILE_PURGED;
 import static org.apache.ignite.internal.GridTopic.TOPIC_IGFS;
 
 /**
@@ -246,12 +245,7 @@ public class IgfsDeleteWorker extends IgfsThread {
 // In case this node crashes, other node will re-delete 
the file.
 data.delete(lockedInfo).get();
 
-boolean ret = meta.delete(trashId, name, id);
-
-if (info.path() != null)
-IgfsUtils.sendEvents(igfsCtx.kernalContext(), 
info.path(), EVT_IGFS_FILE_PURGED);
-
-return ret;
+return meta.delete(trashId, name, id);
 }
 }
 else

http://git-wip-us.apache.org/repos/asf/ignite/blob/8d95ebac/modules/core

[16/47] ignite git commit: IGNITE-2817: IGFS: Optimized "updateProperties" and several other cache operations. Reafactored IgfsMetaManager a bit to simplify work with cache.

2016-04-05 Thread vkulichenko
IGNITE-2817: IGFS: Optimized "updateProperties" and several other cache 
operations. Reafactored IgfsMetaManager a bit to simplify work with cache.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4f7e3c1c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4f7e3c1c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4f7e3c1c

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 4f7e3c1c2e82596a26cec3b3587991ae18078b64
Parents: ba30ddb
Author: vozerov-gridgain 
Authored: Wed Mar 16 09:14:49 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:17 2016 +0300

--
 .../internal/processors/igfs/IgfsImpl.java  |   4 +-
 .../processors/igfs/IgfsMetaManager.java| 641 ++-
 .../igfs/IgfsMetaManagerSelfTest.java   |  23 +-
 3 files changed, 336 insertions(+), 332 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/4f7e3c1c/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index f44eda8..3065427 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -636,9 +636,7 @@ public final class IgfsImpl implements IgfsEx {
 if (fileId == null)
 return null;
 
-IgniteUuid parentId = fileIds.size() > 1 ? 
fileIds.get(fileIds.size() - 2) : null;
-
-IgfsFileInfo info = meta.updateProperties(parentId, fileId, 
path.name(), props);
+IgfsFileInfo info = meta.updateProperties(fileId, props);
 
 if (info != null) {
 if (evts.isRecordable(EVT_IGFS_META_UPDATED))

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f7e3c1c/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 463e7a8..df69d49 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -40,7 +40,6 @@ import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
 import javax.cache.processor.EntryProcessor;
 import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.EntryProcessorResult;
 import javax.cache.processor.MutableEntry;
 
 import org.apache.ignite.IgniteCheckedException;
@@ -238,7 +237,7 @@ public class IgfsMetaManager extends IgfsManager {
 @Nullable public IgniteUuid fileId(IgfsPath path) throws 
IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
-assert validTxState(false);
+validTxState(false);
 
 return fileId(path, false);
 }
@@ -322,7 +321,7 @@ public class IgfsMetaManager extends IgfsManager {
 public List fileIds(IgfsPath path) throws 
IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
-assert validTxState(false);
+validTxState(false);
 
 return fileIds(path, false);
 }
@@ -407,7 +406,7 @@ public class IgfsMetaManager extends IgfsManager {
 if (fileId == null)
 return null;
 
-IgfsFileInfo info = id2InfoPrj.get(fileId);
+IgfsFileInfo info = getInfo(fileId);
 
 // Force root ID always exist in cache.
 if (info == null && IgfsUtils.ROOT_ID.equals(fileId))
@@ -433,13 +432,14 @@ public class IgfsMetaManager extends IgfsManager {
 public Map infos(Collection fileIds) 
throws IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
-assert validTxState(false);
+validTxState(false);
+
 assert fileIds != null;
 
 if (F.isEmpty(fileIds))
 return Collections.emptyMap();
 
-Map map = id2InfoPrj.getAll(fileIds);
+Map map = getInfos(fileIds);
 
 // Force root ID always exist in cache.
 if (fileIds.contains(IgfsUtils.ROOT_ID) && 
!map.containsKey(IgfsUtils.ROOT_ID)) {
@@ -469,7 +469,8 @@ public class IgfsMetaManager

[21/47] ignite git commit: IGNITE-2834: IGFS: Implemented optional metadata co-location.

2016-04-05 Thread vkulichenko
IGNITE-2834: IGFS: Implemented optional metadata co-location.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8e9e790e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8e9e790e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8e9e790e

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 8e9e790e482b8911142bf8b21fa3ad7267a62db6
Parents: 8a93c3b
Author: vozerov-gridgain 
Authored: Fri Mar 18 17:07:58 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:13:35 2016 +0300

--
 .../configuration/FileSystemConfiguration.java  | 47 
 .../org/apache/ignite/internal/IgnitionEx.java  | 10 ++--
 .../processors/cache/GridCacheUtils.java| 14 +
 .../IgfsColocatedMetadataAffinityKeyMapper.java | 47 
 .../internal/processors/igfs/IgfsUtils.java | 57 
 5 files changed, 157 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/8e9e790e/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index 1a9c0fe..99d364e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -19,6 +19,7 @@ package org.apache.ignite.configuration;
 
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
 import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
@@ -83,6 +84,9 @@ public class FileSystemConfiguration {
 /** Default value of whether to initialize default path modes. */
 public static final boolean DFLT_INIT_DFLT_PATH_MODES = true;
 
+/** Default value of metadata co-location flag. */
+public static boolean DFLT_COLOCATE_META = true;
+
 /** IGFS instance name. */
 private String name;
 
@@ -164,6 +168,9 @@ public class FileSystemConfiguration {
 /** Whether to initialize default path modes. */
 private boolean initDfltPathModes = DFLT_INIT_DFLT_PATH_MODES;
 
+/** Metadata co-location flag. */
+private boolean colocateMeta = DFLT_COLOCATE_META;
+
 /**
  * Constructs default configuration.
  */
@@ -184,6 +191,7 @@ public class FileSystemConfiguration {
  */
 blockSize = cfg.getBlockSize();
 bufSize = cfg.getStreamBufferSize();
+colocateMeta = cfg.isColocateMetadata();
 dataCacheName = cfg.getDataCacheName();
 dfltMode = cfg.getDefaultMode();
 dualModeMaxPendingPutsSize = cfg.getDualModeMaxPendingPutsSize();
@@ -830,6 +838,45 @@ public class FileSystemConfiguration {
 this.initDfltPathModes = initDfltPathModes;
 }
 
+/**
+ * Get whether to co-locate metadata on a single node.
+ * 
+ * Normally Ignite spread ownership of particular keys among all cache 
nodes. Transaction with keys owned by
+ * different nodes will produce more network traffic and will require more 
time to complete comparing to
+ * transaction with keys owned only by a single node.
+ * 
+ * IGFS stores information about file system structure (metadata) inside a 
transactional cache configured through
+ * {@link #getMetaCacheName()} property. Metadata updates caused by 
operations on IGFS usually require several
+ * intearnal keys to be updated. As IGFS metadata cache usually operates 
in {@link CacheMode#REPLICATED} mode,
+ * meaning that all nodes have all metadata locally, it makes sense to 
give a hint to Ignite to co-locate
+ * ownership of all metadata keys on a single node. This will decrease 
amount of network trips required to update
+ * metadata and hence could improve performance.
+ * 
+ * This property should be disabled if you see excessive CPU and network 
load on a single node, which
+ * degrades performance and cannot be explained by business logic of your 
application.
+ * 
+ * This settings is only used if metadata cache is configured in {@code 
CacheMode#REPLICATED} mode. Otherwise it
+ * is ignored.
+ * 
+ * Defaults to {@link #DFLT_COLOCATE_META}.
+ *
+ * @return {@code True} if metadata co-location is enabled.
+ */
+public boolean isColocateMetadata() {
+return colocateMeta;
+}
+
+/**
+ * Set metadata co-location flag.
+ * 
+ * See {@link #isColocateMetadata()} for more information.
+  

[39/47] ignite git commit: Added detail info about keys count in partitions for offheap and swap.

2016-04-05 Thread vkulichenko
Added detail info about keys count in partitions for offheap and swap.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0412c9bf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0412c9bf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0412c9bf

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 0412c9bfd89b8d2a377588e908f1012c845ac5bc
Parents: 59705e0
Author: Alexey Kuznetsov 
Authored: Wed Mar 30 11:43:19 2016 +0700
Committer: Alexey Kuznetsov 
Committed: Wed Mar 30 11:43:19 2016 +0700

--
 .../processors/cache/GridCacheSwapManager.java  |  26 -
 .../internal/visor/cache/VisorCacheV3.java  | 108 +++
 .../visor/node/VisorNodeDataCollectorJob.java   |  31 +++---
 3 files changed, 152 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/0412c9bf/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 cbf09bc..a35bb3f 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
@@ -305,6 +305,18 @@ public class GridCacheSwapManager extends 
GridCacheManagerAdapter {
 }
 
 /**
+ * @param partId Partition ID to get swap entries count for.
+ * @return Number of swap entries.
+ * @throws IgniteCheckedException If failed.
+ */
+public long swapEntriesCount(int partId) throws IgniteCheckedException {
+if (!swapEnabled)
+return 0;
+
+return swapMgr.swapKeys(spaceName, Collections.singleton(partId));
+}
+
+/**
  * @param primary If {@code true} includes primary entries.
  * @param backup If {@code true} includes backup entries.
  * @param topVer Topology version.
@@ -328,6 +340,18 @@ public class GridCacheSwapManager extends 
GridCacheManagerAdapter {
 }
 
 /**
+ * @param partId Partition ID to get entries count for.
+ * @return Number of offheap entries.
+ * @throws IgniteCheckedException If failed.
+ */
+public long offheapEntriesCount(int partId) throws IgniteCheckedException {
+if (!offheapEnabled)
+return 0;
+
+return offheap.entriesCount(spaceName, Collections.singleton(partId));
+}
+
+/**
  * Gets number of swap entries (keys).
  *
  * @return Swap keys count.
@@ -2523,4 +2547,4 @@ public class GridCacheSwapManager extends 
GridCacheManagerAdapter {
 throw new UnsupportedOperationException();
 }
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0412c9bf/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV3.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV3.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV3.java
new file mode 100644
index 000..bd9a3ce
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV3.java
@@ -0,0 +1,108 @@
+/*
+ * 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.visor.cache;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+import org.apache.ignite.internal.processors.cache.GridCacheSwapManager;
+import org.apache.ignite.internal.util.lang.GridTuple3;
+import org.apache.ignite.i

[23/47] ignite git commit: IGNITE-2813: IGFS: Optimized metadata values splitting file and directory into separate classes.

2016-04-05 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfa7bf6c/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index d91b0bc..84e4dae 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -86,8 +86,6 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
 
-import static org.apache.ignite.internal.processors.igfs.IgfsFileInfo.builder;
-
 /**
  * Cache based structure (meta data) manager.
  */
@@ -117,7 +115,7 @@ public class IgfsMetaManager extends IgfsManager {
 private CountDownLatch metaCacheStartLatch;
 
 /** File ID to file info projection. */
-private IgniteInternalCache id2InfoPrj;
+private IgniteInternalCache id2InfoPrj;
 
 /** Predefined key for sampling mode value. */
 private GridCacheInternal sampling;
@@ -175,7 +173,7 @@ public class IgfsMetaManager extends IgfsManager {
 }
 });
 
-id2InfoPrj = (IgniteInternalCache)metaCache.cache();
+id2InfoPrj = (IgniteInternalCache)metaCache.cache();
 
 locNode = igfsCtx.kernalContext().discovery().localNode();
 
@@ -440,17 +438,17 @@ public class IgfsMetaManager extends IgfsManager {
  * @return File info.
  * @throws IgniteCheckedException If failed.
  */
-@Nullable public IgfsFileInfo info(@Nullable IgniteUuid fileId) throws 
IgniteCheckedException {
+@Nullable public IgfsEntryInfo info(@Nullable IgniteUuid fileId) throws 
IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
 if (fileId == null)
 return null;
 
-IgfsFileInfo info = getInfo(fileId);
+IgfsEntryInfo info = getInfo(fileId);
 
 // Force root ID always exist in cache.
 if (info == null && IgfsUtils.ROOT_ID.equals(fileId))
-info = createSystemEntryIfAbsent(fileId);
+info = createSystemDirectoryIfAbsent(fileId);
 
 return info;
 }
@@ -469,7 +467,7 @@ public class IgfsMetaManager extends IgfsManager {
  * @return Files details.
  * @throws IgniteCheckedException If failed.
  */
-public Map infos(Collection fileIds) 
throws IgniteCheckedException {
+public Map infos(Collection 
fileIds) throws IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
 validTxState(false);
@@ -479,13 +477,13 @@ public class IgfsMetaManager extends IgfsManager {
 if (F.isEmpty(fileIds))
 return Collections.emptyMap();
 
-Map map = getInfos(fileIds);
+Map map = getInfos(fileIds);
 
 // Force root ID always exist in cache.
 if (fileIds.contains(IgfsUtils.ROOT_ID) && 
!map.containsKey(IgfsUtils.ROOT_ID)) {
 map = new GridLeanMap<>(map);
 
-map.put(IgfsUtils.ROOT_ID, 
createSystemEntryIfAbsent(IgfsUtils.ROOT_ID));
+map.put(IgfsUtils.ROOT_ID, 
createSystemDirectoryIfAbsent(IgfsUtils.ROOT_ID));
 }
 
 return map;
@@ -506,7 +504,7 @@ public class IgfsMetaManager extends IgfsManager {
  * @return Locked file info or {@code null} if file cannot be locked or 
doesn't exist.
  * @throws IgniteCheckedException If the file with such id does not exist, 
or on another failure.
  */
-public @Nullable IgfsFileInfo lock(IgniteUuid fileId, boolean delete) 
throws IgniteCheckedException {
+public @Nullable IgfsEntryInfo lock(IgniteUuid fileId, boolean delete) 
throws IgniteCheckedException {
 if (busyLock.enterBusy()) {
 try {
 validTxState(false);
@@ -517,7 +515,7 @@ public class IgfsMetaManager extends IgfsManager {
 
 try {
 // Lock file ID for this transaction.
-IgfsFileInfo oldInfo = info(fileId);
+IgfsEntryInfo oldInfo = info(fileId);
 
 if (oldInfo == null)
 return null;
@@ -525,7 +523,7 @@ public class IgfsMetaManager extends IgfsManager {
 if (oldInfo.lockId() != null)
 return null; // The file is already locked, we cannot 
lock it.
 
-IgfsFileInfo newInfo = invokeLock(fileId, delete);
+IgfsEntryInfo newInfo = invokeLock(fileId, delete);
 
 tx.commit();
 
@@ -566,7 +564,7 @@ public class IgfsMetaManager extends IgfsManage

[01/47] ignite git commit: Support optional IO policy resolver in DataStreamer.

2016-04-05 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/gridgain-7.5.11-vk [created] 433fd031a


Support optional IO policy resolver in DataStreamer.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/08f59815
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/08f59815
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/08f59815

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 08f5981509711e65c0d4c6fc1209068f8958eb06
Parents: 53a8729
Author: vozerov-gridgain 
Authored: Mon Mar 28 12:24:16 2016 +0300
Committer: vozerov-gridgain 
Committed: Mon Mar 28 14:51:08 2016 +0300

--
 .../managers/communication/GridIoManager.java   | 43 +---
 .../processors/cache/GridCacheAdapter.java  |  2 +-
 .../datastreamer/DataStreamProcessor.java   |  8 +++-
 .../datastreamer/DataStreamerImpl.java  | 37 -
 4 files changed, 81 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/08f59815/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 3a615e6..0438b64 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -113,6 +113,9 @@ public class GridIoManager extends 
GridManagerAdapter CUR_PLC = new ThreadLocal<>();
+
 /** Listeners by topic. */
 private final ConcurrentMap lsnrMap = new 
ConcurrentHashMap8<>();
 
@@ -742,7 +745,7 @@ public class GridIoManager extends 
GridManagerAdapter t = 
msgs.poll(); t != null; t = msgs.poll()) {
 try {
-lsnr.onMessage(
-nodeId,
-t.get1().message());
+invokeListener(plc, lsnr, nodeId, t.get1().message());
 }
 finally {
 if (t.get3() != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/08f59815/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 54046a9..b8fcfb6 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
@@ -5996,7 +5996,7 @@ public abstract class GridCacheAdapter implements 
IgniteInternalCachehttp://git-wip-us.apache.org/repos/asf/ignite/blob/08f59815/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
index d899c67..c7c1f5e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
@@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.managers.communication.GridIoManager;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
@@ -339,7 +340,12 @@ public class DataStreamProcessor extends 
GridProcessorAdapter {
 DataStreamerResponse res = new DataStreamerResponse(reqId, errBytes, 
forceLocDep);
 
 try {
-ctx.io().send(nodeId, resTopic, res, PUBLIC_POOL);
+Byte plc = GridIoManager.currentPolicy();
+
+if (plc == null)
+plc = PUBLIC_POOL;
+
+ctx.io().send(nodeId, resTopic, res, plc);
 }
 catch (IgniteCheckedException e) {
 if (ctx.discovery().alive(nodeId))

http://git-wip-us.apache.org/rep

[35/47] ignite git commit: IGFS: Added misssing "final" modifiers to FileSystemConfiguration defaults.

2016-04-05 Thread vkulichenko
IGFS: Added misssing "final" modifiers to FileSystemConfiguration defaults.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/26f11573
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/26f11573
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/26f11573

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 26f115734e7262d4b4b60f1c6016783f67c66986
Parents: b286fac
Author: vozerov-gridgain 
Authored: Tue Mar 22 12:46:23 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:20 2016 +0300

--
 .../org/apache/ignite/configuration/FileSystemConfiguration.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/26f11573/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index 0d7f3cc..518bbf6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -86,10 +86,10 @@ public class FileSystemConfiguration {
 public static final boolean DFLT_INIT_DFLT_PATH_MODES = true;
 
 /** Default value of metadata co-location flag. */
-public static boolean DFLT_COLOCATE_META = true;
+public static final boolean DFLT_COLOCATE_META = true;
 
 /** Default value of relaxed consistency flag. */
-public static boolean DFLT_RELAXED_CONSISTENCY = true;
+public static final boolean DFLT_RELAXED_CONSISTENCY = true;
 
 /** IGFS instance name. */
 private String name;



[40/47] ignite git commit: Minor change to Visor classes: added setters for name and queryMetrics properties.

2016-04-05 Thread vkulichenko
Minor change to Visor classes: added setters for name and queryMetrics 
properties.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/28d2a7bf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/28d2a7bf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/28d2a7bf

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 28d2a7bf7f35ec4b51fba872ace47cdbc255ded8
Parents: 0412c9b
Author: Alexey Kuznetsov 
Authored: Wed Mar 30 14:42:12 2016 +0700
Committer: Alexey Kuznetsov 
Committed: Wed Mar 30 14:42:12 2016 +0700

--
 .../ignite/internal/visor/cache/VisorCache.java   |  9 +
 .../internal/visor/cache/VisorCacheMetrics.java   | 18 ++
 2 files changed, 27 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/28d2a7bf/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index 7cd0669..b5151c7 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -301,6 +301,15 @@ public class VisorCache implements Serializable {
 }
 
 /**
+ * Sets new value for cache name.
+ *
+ * @param name New cache name.
+ */
+public void name(String name) {
+this.name = name;
+}
+
+/**
  * @return Dynamic deployment ID.
  */
 public IgniteUuid dynamicDeploymentId() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/28d2a7bf/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 1a88813..0397fe0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -238,6 +238,15 @@ public class VisorCacheMetrics implements Serializable {
 }
 
 /**
+ * Sets cache name.
+ *
+ * @param name New value for cache name.
+ */
+public void name(String name) {
+this.name = name;
+}
+
+/**
  * @return Cache mode.
  */
 public CacheMode mode() {
@@ -406,6 +415,15 @@ public class VisorCacheMetrics implements Serializable {
 }
 
 /**
+ * Sets cache query metrics.
+ *
+ * @param qryMetrics New value for query metrics.
+ */
+public void queryMetrics(VisorCacheQueryMetrics qryMetrics) {
+this.qryMetrics = qryMetrics;
+}
+
+/**
  * @return Current size of evict queue used to batch up evictions.
  */
 public int dhtEvictQueueCurrentSize() {



[36/47] ignite git commit: IGNITE-2878: IGFS: Optimzied serialization of IgfsListingEntry and properties map.

2016-04-05 Thread vkulichenko
IGNITE-2878: IGFS: Optimzied serialization of IgfsListingEntry and properties 
map.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/00a0e4b5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/00a0e4b5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/00a0e4b5

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 00a0e4b51c299871ff690bbe6d462cf80dae045e
Parents: 26f1157
Author: vozerov-gridgain 
Authored: Thu Mar 24 10:35:43 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:14:24 2016 +0300

--
 .../ignite/internal/binary/BinaryContext.java   |   2 +
 .../internal/processors/igfs/IgfsBlockKey.java  |  30 -
 .../processors/igfs/IgfsDirectoryInfo.java  |  33 -
 .../internal/processors/igfs/IgfsEntryInfo.java |   8 +-
 .../internal/processors/igfs/IgfsUtils.java | 127 +++
 .../meta/IgfsMetaDirectoryCreateProcessor.java  |  24 ++--
 .../IgfsMetaDirectoryListingAddProcessor.java   |   6 +-
 ...gfsMetaDirectoryListingReplaceProcessor.java |   4 +-
 .../igfs/meta/IgfsMetaFileCreateProcessor.java  |  16 ++-
 .../meta/IgfsMetaUpdatePropertiesProcessor.java |   5 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |  11 ++
 .../IgfsPrimaryOptimziedMarshallerSelfTest.java |  28 
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +
 13 files changed, 261 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/00a0e4b5/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index b357345..4d8c293 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -65,6 +65,7 @@ import 
org.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey;
 import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
 import 
org.apache.ignite.internal.processors.datastructures.CollocatedQueueItemKey;
 import 
org.apache.ignite.internal.processors.datastructures.CollocatedSetItemKey;
+import org.apache.ignite.internal.processors.igfs.IgfsBlockKey;
 import org.apache.ignite.internal.processors.igfs.IgfsDirectoryInfo;
 import org.apache.ignite.internal.processors.igfs.IgfsFileAffinityRange;
 import org.apache.ignite.internal.processors.igfs.IgfsFileInfo;
@@ -118,6 +119,7 @@ public class BinaryContext {
 // IGFS classes.
 sysClss.add(IgfsPath.class.getName());
 
+sysClss.add(IgfsBlockKey.class.getName());
 sysClss.add(IgfsDirectoryInfo.class.getName());
 sysClss.add(IgfsFileAffinityRange.class.getName());
 sysClss.add(IgfsFileInfo.class.getName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/00a0e4b5/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
index 06a2e1c..c366ae3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
@@ -22,6 +22,14 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.nio.ByteBuffer;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -37,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
  * File's binary data block key.
  */
 @GridInternal
-public final class IgfsBlockKey implements Message, Externalizable, 
Comparable {
+public final class IgfsBlockKey implements Message, Externalizable, 
Binarylizable, Comparable {
 /** */
 private static final long serialVersionUID = 0L;
 
@@ -150,6 +158,26 @@ public final class IgfsBlockKey implements Message, 
Externalizable, Comparable>> 32));
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/00a0e4b5/modules/core/src/main/java/org/a

[06/47] ignite git commit: IGNITE-1788: Removed duplicate check of a single invariant from IgfsProcessor. This closes #221.

2016-04-05 Thread vkulichenko
IGNITE-1788: Removed duplicate check of a single invariant from IgfsProcessor.  
This closes #221.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/85a675b7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/85a675b7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/85a675b7

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 85a675b7bfbc54745ee9ce95d5786b5bae5be963
Parents: 9e62b66
Author: iveselovskiy 
Authored: Mon Jan 18 17:28:42 2016 +0300
Committer: vozerov-gridgain 
Committed: Tue Mar 29 15:11:58 2016 +0300

--
 .../org/apache/ignite/internal/processors/igfs/IgfsProcessor.java | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/85a675b7/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 5b8cf86..21446e1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -297,9 +297,6 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 if (GridQueryProcessor.isEnabled(metaCacheCfg))
 throw new IgniteCheckedException("IGFS metadata cache cannot 
start with enabled query indexing.");
 
-if (GridQueryProcessor.isEnabled(metaCacheCfg))
-throw new IgniteCheckedException("IGFS metadata cache cannot 
start with enabled query indexing.");
-
 if (metaCacheCfg.getAtomicityMode() != TRANSACTIONAL)
 throw new IgniteCheckedException("Meta cache should be 
transactional: " + cfg.getMetaCacheName());
 



[45/47] ignite git commit: IGNITE-2822 Continuous query local listener can be notified with empty list of events

2016-04-05 Thread vkulichenko
IGNITE-2822
Continuous query local listener can be notified with empty list of events


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2397552d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2397552d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2397552d

Branch: refs/heads/gridgain-7.5.11-vk
Commit: 2397552daf6d8cff9b59515c1c8983abdc60f5f4
Parents: d33b434
Author: vdpyatkov 
Authored: Tue Apr 5 18:03:55 2016 +0300
Committer: vdpyatkov 
Committed: Tue Apr 5 18:03:55 2016 +0300

--
 .../continuous/CacheContinuousQueryHandler.java |   3 +-
 ...acheContinuousQueryExecuteInPrimaryTest.java | 306 +++
 .../IgniteCacheQuerySelfTestSuite3.java |   2 +
 3 files changed, 310 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/2397552d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 6243af7..767697a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -382,7 +382,8 @@ public class CacheContinuousQueryHandler implements 
GridContinuousHandler
 }
 );
 
-locLsnr.onUpdated(evts);
+if (!F.isEmpty(evts))
+locLsnr.onUpdated(evts);
 
 if (!internal && !skipPrimaryCheck)
 
sendBackupAcknowledge(ackBuf.onAcknowledged(entry), routineId, ctx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/2397552d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryExecuteInPrimaryTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryExecuteInPrimaryTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryExecuteInPrimaryTest.java
new file mode 100644
index 000..1a52909
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryExecuteInPrimaryTest.java
@@ -0,0 +1,306 @@
+/*
+ * 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.query.continuous;
+
+import javax.cache.Cache;
+import javax.cache.configuration.FactoryBuilder;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.query.ContinuousQuery;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.jetbrains.annotations.NotNull;
+
+import javax.cache.event.CacheEntryEvent;
+import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.CacheEntryUpdatedListener;
+import javax.cache.processor.EntryPr

[43/47] ignite git commit: ignite-2835: Fixed BinaryObjectOffHeapImpl leakage to public code

2016-04-05 Thread vkulichenko
ignite-2835: Fixed BinaryObjectOffHeapImpl leakage to public code


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e85a7170
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e85a7170
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e85a7170

Branch: refs/heads/gridgain-7.5.11-vk
Commit: e85a7170534cb66f40386cba689cfe632f4e66db
Parents: ec2ec99
Author: ashutak 
Authored: Tue Apr 5 14:56:01 2016 +0300
Committer: ashutak 
Committed: Tue Apr 5 14:56:01 2016 +0300

--
 .../processors/cache/GridCacheMapEntry.java |   7 +-
 .../transactions/IgniteTxLocalAdapter.java  |   2 +-
 .../BinaryObjectOffHeapUnswapTemporaryTest.java | 370 +++
 .../GridCacheBinaryObjectsAbstractSelfTest.java | 181 ++---
 .../IgniteBinaryObjectsTestSuite.java   |   4 +-
 5 files changed, 510 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/e85a7170/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 5519070..83f5d5c 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
@@ -34,6 +34,7 @@ import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
 import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.eviction.EvictableEntry;
+import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -898,9 +899,12 @@ public abstract class GridCacheMapEntry extends 
GridMetadataAwareAdapter impleme
 }
 }
 
-if (ret != null)
+if (ret != null) {
+assert tmp || !(ret instanceof BinaryObjectOffheapImpl);
+
 // If return value is consistent, then done.
 return retVer ? new T2<>(ret, resVer) : ret;
+}
 
 boolean loadedFromStore = false;
 
@@ -974,6 +978,7 @@ public abstract class GridCacheMapEntry extends 
GridMetadataAwareAdapter impleme
 }
 
 assert ret == null || !retVer;
+assert tmp || !(ret instanceof BinaryObjectOffheapImpl);
 
 return ret;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e85a7170/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 fef91c8..785e937 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
@@ -1893,7 +1893,7 @@ public abstract class IgniteTxLocalAdapter extends 
IgniteTxAdapter
 /*unmarshal*/true,
 /*metrics*/true,
 /*events*/!skipVals,
-/*temporary*/true,
+/*temporary*/false,
 
CU.subjectId(IgniteTxLocalAdapter.this, cctx),
 transformClo,
 resolveTaskName(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/e85a7170/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
new file mode 100644
index 000..4272a14
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java
@@ -0,0 +1,370 @@
+/*

[ignite] Git Push Summary

2016-04-05 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-2949 [created] acb7aed2e


[ignite] Git Push Summary

2016-04-05 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/igntie-2949 [deleted] acb7aed2e


[ignite] Git Push Summary

2016-04-06 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/gridgain-7.5.11-vk [deleted] 433fd031a


ignite git commit: IGNITE-2951 - Stability fixes for cluster with many clients

2016-04-06 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master da47901f0 -> 5e2661537


IGNITE-2951 - Stability fixes for cluster with many clients


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5e266153
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5e266153
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5e266153

Branch: refs/heads/master
Commit: 5e266153707021a8866e91dfa3f958066f80fc99
Parents: da47901
Author: Valentin Kulichenko 
Authored: Wed Apr 6 18:10:45 2016 -0700
Committer: Valentin Kulichenko 
Committed: Wed Apr 6 23:25:03 2016 -0700

--
 .../GridDhtPartitionsExchangeFuture.java|  2 +-
 .../continuous/GridContinuousProcessor.java | 13 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java|  2 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java| 44 +---
 .../spi/discovery/tcp/TcpDiscoverySpi.java  | 23 --
 .../IgniteClientReconnectAbstractTest.java  |  7 ++--
 .../tcp/TcpClientDiscoverySpiSelfTest.java  |  8 ++--
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 39 +
 .../TcpDiscoverySpiFailureTimeoutSelfTest.java  | 23 --
 .../spi/discovery/tcp/TestTcpDiscoverySpi.java  |  5 ++-
 10 files changed, 80 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/5e266153/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index bbfc71a..82e9bda 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -931,7 +931,7 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapterhttp://git-wip-us.apache.org/repos/asf/ignite/blob/5e266153/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index abafe85..d7838f3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -393,7 +393,18 @@ public class GridContinuousProcessor extends 
GridProcessorAdapter {
 /** {@inheritDoc} */
 @Override @Nullable public Serializable collectDiscoveryData(UUID nodeId) {
 if (!nodeId.equals(ctx.localNodeId()) || !locInfos.isEmpty()) {
-DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos);
+Map> clientInfos0 = 
U.newHashMap(clientInfos.size());
+
+for (Map.Entry> e : 
clientInfos.entrySet()) {
+Map copy = 
U.newHashMap(e.getValue().size());
+
+for (Map.Entry e0 : 
e.getValue().entrySet())
+copy.put(e0.getKey(), e0.getValue());
+
+clientInfos0.put(e.getKey(), copy);
+}
+
+DiscoveryData data = new DiscoveryData(ctx.localNodeId(), 
clientInfos0);
 
 // Collect listeners information (will be sent to joining node 
during discovery process).
 for (Map.Entry e : locInfos.entrySet()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/5e266153/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 950c680..31d614f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -1062,7 +1062,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 try {
 if (ack) {
 synchronized (mux) {
-assert unackedMsg == null : unackedMsg;
+assert unack

ignite git commit: Fixed service proxy failure in case of client reconnect

2016-04-11 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/master bfba2a3db -> 222f9c13c


Fixed service proxy failure in case of client reconnect


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/222f9c13
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/222f9c13
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/222f9c13

Branch: refs/heads/master
Commit: 222f9c13c98bcc2169d5cf7cd73adbcc6a94cb9f
Parents: bfba2a3
Author: Valentin Kulichenko 
Authored: Mon Apr 11 16:07:39 2016 -0700
Committer: Valentin Kulichenko 
Committed: Mon Apr 11 16:07:39 2016 -0700

--
 .../affinity/GridAffinityProcessor.java |   6 +-
 .../service/GridServiceProcessor.java   |   2 +-
 .../processors/service/GridServiceProxy.java|   5 +-
 ...GridServiceProxyClientReconnectSelfTest.java | 124 +++
 .../GridServiceProxyNodeStopSelfTest.java   |   2 +-
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 6 files changed, 133 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/222f9c13/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 6b289e1..0d3d36d 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
@@ -30,6 +30,7 @@ import java.util.UUID;
 import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.affinity.Affinity;
 import org.apache.ignite.cache.affinity.AffinityFunction;
@@ -38,7 +39,6 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.events.DiscoveryEvent;
 import org.apache.ignite.events.Event;
-import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
@@ -66,7 +66,7 @@ import static org.apache.ignite.cache.CacheMode.LOCAL;
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
 import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
-import static org.apache.ignite.internal.GridClosureCallMode.BALANCE;
+import static org.apache.ignite.internal.GridClosureCallMode.BROADCAST;
 import static 
org.apache.ignite.internal.processors.affinity.GridAffinityUtils.affinityJob;
 import static 
org.apache.ignite.internal.processors.affinity.GridAffinityUtils.unmarshall;
 
@@ -422,7 +422,7 @@ public class GridAffinityProcessor extends 
GridProcessorAdapter {
 private AffinityInfo affinityInfoFromNode(@Nullable String cacheName, 
AffinityTopologyVersion topVer, ClusterNode n)
 throws IgniteCheckedException {
 GridTuple3 t = ctx.closure()
-.callAsyncNoFailover(BALANCE, affinityJob(cacheName, topVer), 
F.asList(n), true/*system pool*/).get();
+.callAsyncNoFailover(BROADCAST, affinityJob(cacheName, topVer), 
F.asList(n), true/*system pool*/).get();
 
 AffinityFunction f = (AffinityFunction)unmarshall(ctx, n.id(), 
t.get1());
 AffinityKeyMapper m = (AffinityKeyMapper)unmarshall(ctx, n.id(), 
t.get2());

http://git-wip-us.apache.org/repos/asf/ignite/blob/222f9c13/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 8aa69a7..eded5e1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -573,7 +573,7 @@ public class GridServiceProcessor extends 
GridProcessorAdapter {
 
 if (node.version().compareTo(ServiceTopologyCallable.SINCE_VER) >= 0) {
 return ctx.closure().callAsyncNoFailover(
-GridClosureCallMode.BALANCE,
+ 

[30/43] ignite git commit: Added test.

2016-04-11 Thread vkulichenko
Added test.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/083acbda
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/083acbda
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/083acbda

Branch: refs/heads/ignite-2949
Commit: 083acbda83a0167b95c096aea406a5adb7a8451b
Parents: cead1e0
Author: sboikov 
Authored: Fri Apr 8 13:52:53 2016 +0300
Committer: sboikov 
Committed: Fri Apr 8 13:52:53 2016 +0300

--
 .../MarshallerCacheJobRunNodeRestartTest.java   | 237 +++
 1 file changed, 237 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/083acbda/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/MarshallerCacheJobRunNodeRestartTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/MarshallerCacheJobRunNodeRestartTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/MarshallerCacheJobRunNodeRestartTest.java
new file mode 100644
index 000..482edee
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/MarshallerCacheJobRunNodeRestartTest.java
@@ -0,0 +1,237 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.util.concurrent.Callable;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class MarshallerCacheJobRunNodeRestartTest extends 
GridCommonAbstractTest {
+/** */
+private static TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
+
+/** */
+private boolean client;
+
+/** {@inheritDoc} */
+@Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+cfg.setClientMode(client);
+
+return cfg;
+}
+
+/**
+ * @throws Exception If failed.
+ */
+public void testJobRun() throws Exception {
+for (int i = 0; i < 5; i++) {
+U.resolveWorkDirectory("marshaller", true);
+
+log.info("Iteration: " + i);
+
+final int NODES = 3;
+
+startGridsMultiThreaded(NODES);
+
+client = true;
+
+startGrid(NODES);
+
+client = false;
+
+final IgniteInternalFuture fut = GridTestUtils.runAsync(new 
Callable() {
+@Override public Void call() throws Exception {
+for (int i = 0; i < 3; i++) {
+startGrid(NODES + 1);
+
+U.sleep(1000);
+
+stopGrid(NODES + 1);
+}
+
+return null;
+}
+});
+
+GridTestUtils.runMultiThreaded(new IgniteInClosure() {
+@Override public void apply(Integer integer) {
+Ignite ignite = ignite(integer % 4);
+
+while (!fut.isDone()) {
+for (int i = 0; i < 10; i++)
+ignite.compute().broadcast(job(i));
+}
+}
+}, (NODES + 1) * 5, "test");
+
+stopAllGrids();
+}
+}
+
+/**
+ * @param idx Job class i

[03/43] ignite git commit: ignite-324 Partition exchange: node should be assigned as primary only after preloading is finished Implemented 'late affinity assignment', also fixes: - fixed BinaryObject/

2016-04-11 Thread vkulichenko
http://git-wip-us.apache.org/repos/asf/ignite/blob/e7e223f7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
--
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
index 151167a..1259f3e 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
@@ -22,6 +22,8 @@ import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import javax.cache.processor.EntryProcessor;
@@ -41,6 +43,7 @@ import 
org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
@@ -58,21 +61,16 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends 
GridCommonAbstractTes
 private static final int GRID_CNT = 2;
 
 /** Number of increment iterations. */
-private static final int NUM_SETS = 50;
+private static final int INCREMENTS = 100;
+
+/** */
+private static final int KEYS = 50;
 
 /** {@inheritDoc} */
 @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
 IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-CacheConfiguration cache = new CacheConfiguration();
-
-cache.setCacheMode(PARTITIONED);
-cache.setAtomicityMode(atomicityMode());
-cache.setWriteSynchronizationMode(FULL_SYNC);
-cache.setBackups(1);
-cache.setRebalanceMode(SYNC);
-
-cfg.setCacheConfiguration(cache);
+cfg.setCacheConfiguration(cacheConfiguration());
 
 TcpDiscoverySpi disco = new TcpDiscoverySpi();
 
@@ -90,6 +88,21 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends 
GridCommonAbstractTes
 }
 
 /**
+ * @return Cache configuration.
+ */
+private CacheConfiguration cacheConfiguration() {
+CacheConfiguration cache = new CacheConfiguration();
+
+cache.setCacheMode(PARTITIONED);
+cache.setAtomicityMode(atomicityMode());
+cache.setWriteSynchronizationMode(FULL_SYNC);
+cache.setBackups(1);
+cache.setRebalanceMode(SYNC);
+
+return cache;
+}
+
+/**
  * @return Atomicity mode.
  */
 protected CacheAtomicityMode atomicityMode() {
@@ -121,6 +134,76 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends 
GridCommonAbstractTes
 }
 
 /**
+ * @throws Exception If failed.
+ */
+public void testEntryProcessorNodeLeave() throws Exception {
+startGrid(GRID_CNT);
+
+// TODO: IGNITE-1525 (test fails with one-phase commit).
+boolean createCache = atomicityMode() == TRANSACTIONAL;
+
+String cacheName = null;
+
+if (createCache) {
+CacheConfiguration ccfg = cacheConfiguration();
+
+ccfg.setName("cache-2");
+ccfg.setBackups(2);
+
+ignite(0).createCache(ccfg);
+
+cacheName = ccfg.getName();
+}
+
+try {
+int NODES = GRID_CNT + 1;
+
+final int RESTART_IDX = GRID_CNT + 1;
+
+for (int iter = 0; iter < 10; iter++) {
+log.info("Iteration: " + iter);
+
+startGrid(RESTART_IDX);
+
+awaitPartitionMapExchange();
+
+final CountDownLatch latch = new CountDownLatch(1);
+
+IgniteInternalFuture fut = GridTestUtils.runAsync(new 
Callable() {
+@Override public Object call() throws Exception {
+latch.await();
+
+stopGrid(RESTART_IDX);
+
+return null;
+}
+}, "stop-thread");
+
+int increments = checkIncrement(cacheName, iter % 2 == 2, fut, 
latch);
+
+assert increments >= INCREMENTS;
+
+fut.get();
+
+for (int i = 0; i < KEYS; i++) {
+for (int g = 0; g < NODES; g++) {
+Set vals = ignite(g).>cache(cacheName).get("set-" + i)

[32/43] ignite git commit: IGNITE-472 Fixed check for system cache in case of clear, stop and swap commands.

2016-04-11 Thread vkulichenko
IGNITE-472 Fixed check for system cache in case of clear, stop and swap 
commands.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/22188753
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/22188753
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/22188753

Branch: refs/heads/ignite-2949
Commit: 22188753fa2050f7548927d414776a4cf7a0216f
Parents: 77225c0
Author: Alexey Kuznetsov 
Authored: Mon Apr 11 12:56:45 2016 +0700
Committer: Alexey Kuznetsov 
Committed: Mon Apr 11 12:56:45 2016 +0700

--
 .../apache/ignite/visor/commands/cache/VisorCacheCommand.scala  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/22188753/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 45429c4..b4ed6b8 100755
--- 
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
@@ -259,8 +259,7 @@ class VisorCacheCommand {
 
 if (hasArgFlagIn("clear", "swap", "scan", "stop")) {
 if (cacheName.isEmpty)
-askForCache("Select cache from:", node, showSystem && 
!hasArgFlagIn("clear", "swap", "stop"),
-aggrData) match {
+askForCache("Select cache from:", node, showSystem && 
!hasArgFlagIn("clear", "swap", "stop"), aggrData) match {
 case Some(name) =>
 argLst = argLst ++ Seq("c" -> name)
 
@@ -273,7 +272,7 @@ class VisorCacheCommand {
 if (hasArgFlag("scan", argLst))
 VisorCacheScanCommand().scan(argLst, node)
 else {
-if (!aggrData.exists(cache => safeEquals(cache.name(), 
name) && cache.system())) {
+if (aggrData.nonEmpty && !aggrData.exists(cache => 
safeEquals(cache.name(), name) && cache.system())) {
 if (hasArgFlag("clear", argLst))
 VisorCacheClearCommand().clear(argLst, node)
 else if (hasArgFlag("swap", argLst))



  1   2   3   4   5   6   7   8   9   10   >