# ignite-51 merged from sprint-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ffee48d5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ffee48d5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ffee48d5 Branch: refs/heads/ignite-51 Commit: ffee48d5e8539b1a8d090c71d814cd63bf9e4831 Parents: 760182e 12ee896 Author: sboikov <sboi...@gridgain.com> Authored: Wed Feb 25 16:58:23 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Wed Feb 25 16:58:23 2015 +0300 ---------------------------------------------------------------------- .../datagrid/CacheContinuousQueryExample.java | 6 +- .../processors/rest/TestBinaryClient.java | 7 +- .../processors/rest/TestMemcacheClient.java | 45 +- .../protocols/tcp/TcpRestParserSelfTest.java | 14 +- .../ignite/codegen/MessageCodeGenerator.java | 28 +- .../apache/ignite/IgniteSystemProperties.java | 5 + .../CacheRendezvousAffinityFunction.java | 3 +- .../cache/store/jdbc/CacheJdbcPojoStore.java | 28 +- .../IgfsByteDelimiterRecordResolver.java | 5 +- .../ignite/internal/ClusterMetricsSnapshot.java | 205 +++--- .../internal/GridEventConsumeHandler.java | 9 +- .../ignite/internal/GridKernalContext.java | 8 + .../ignite/internal/GridKernalContextImpl.java | 11 + .../internal/GridMessageListenHandler.java | 9 +- .../apache/ignite/internal/IgniteKernal.java | 6 + .../router/impl/GridTcpRouterNioParser.java | 10 +- .../internal/direct/DirectByteBufferStream.java | 4 +- .../igfs/common/IgfsControlResponse.java | 7 +- .../internal/igfs/common/IgfsMarshaller.java | 17 +- .../internal/managers/GridManagerAdapter.java | 5 + .../affinity/GridAffinityMessage.java | 5 +- .../processors/cache/GridCacheEntryInfo.java | 13 +- .../processors/cache/GridCacheUtils.java | 8 +- .../continuous/CacheContinuousQueryEntry.java | 13 +- .../continuous/CacheContinuousQueryHandler.java | 5 +- .../cache/transactions/IgniteTxEntry.java | 24 +- .../transactions/IgniteTxLocalAdapter.java | 8 + .../version/GridCacheRawVersionedEntry.java | 9 +- .../processors/clock/GridClockMessage.java | 25 +- .../continuous/GridContinuousProcessor.java | 4 +- .../processors/igfs/IgfsDataManager.java | 4 +- .../internal/processors/igfs/IgfsServer.java | 5 +- .../processors/rest/GridRestResponse.java | 5 +- .../message/GridClientAbstractMessage.java | 5 +- .../message/GridClientHandshakeRequest.java | 5 +- .../protocols/tcp/GridMemcachedMessage.java | 5 +- .../rest/protocols/tcp/GridTcpRestParser.java | 44 +- .../ignite/internal/util/GridByteArrayList.java | 14 +- .../ignite/internal/util/IgniteByteUtils.java | 705 +++++++++++++++++++ .../internal/util/IgniteExceptionRegistry.java | 259 +++++++ .../ignite/internal/util/IgniteUtils.java | 685 +----------------- .../nio/GridConnectionBytesVerifyFilter.java | 3 +- .../util/nio/GridTcpCommunicationClient.java | 3 +- .../internal/visor/util/VisorTaskUtils.java | 3 +- .../ignite/lang/IgniteProductVersion.java | 7 +- .../org/apache/ignite/mxbean/IgniteMXBean.java | 6 + .../org/apache/ignite/spi/IgniteSpiAdapter.java | 15 + .../org/apache/ignite/spi/IgniteSpiContext.java | 8 + .../communication/tcp/TcpCommunicationSpi.java | 64 +- .../spi/discovery/tcp/TcpDiscoverySpi.java | 84 ++- .../tcp/internal/TcpDiscoveryNode.java | 5 +- .../TcpDiscoveryMulticastIpFinder.java | 7 +- .../messages/TcpDiscoveryAuthFailedMessage.java | 5 +- .../messages/TcpDiscoveryHeartbeatMessage.java | 15 +- .../near/IgniteCacheNearReadCommittedTest.java | 3 + .../igfs/IgfsDataManagerSelfTest.java | 4 +- .../util/IgniteExceptionRegistrySelfTest.java | 89 +++ .../internal/util/IgniteUtilsSelfTest.java | 18 +- .../internal/util/nio/GridNioSelfTest.java | 6 +- .../internal/util/nio/GridRoundTripTest.java | 5 +- .../offheap/GridOffHeapMapAbstractSelfTest.java | 4 +- .../ignite/lang/GridByteArrayListSelfTest.java | 6 +- .../communication/GridTestMessage.java | 5 +- .../file/GridFileSwapSpaceSpiSelfTest.java | 6 +- .../testframework/GridSpiTestContext.java | 6 + .../junits/GridTestKernalContext.java | 2 + .../ignite/testsuites/IgniteCacheTestSuite.java | 3 +- .../testsuites/IgniteUtilSelfTestSuite.java | 1 + .../internal/igfs/hadoop/IgfsHadoopIpcIo.java | 10 +- .../shuffle/GridHadoopShuffleMessage.java | 5 +- .../hadoop/v2/GridHadoopSplitWrapper.java | 6 +- .../http/jetty/GridJettyRestHandler.java | 3 +- 72 files changed, 1662 insertions(+), 1027 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java ---------------------------------------------------------------------- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java index 88ac033,c8e563b..d27f32f --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java @@@ -234,79 -262,77 +235,79 @@@ public class GridCacheEntryInfo impleme /** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { - out.writeInt(cacheId); - out.writeBoolean(keyBytesSent); - out.writeBoolean(valBytesSent); - - if (keyBytesSent) - IgniteByteUtils.writeByteArray(out, keyBytes); - else - out.writeObject(key); - - if (valBytesSent) - IgniteByteUtils.writeByteArray(out, valBytes); - else { - if (val != null && val instanceof byte[]) { - out.writeBoolean(true); - - IgniteByteUtils.writeByteArray(out, (byte[]) val); - } - else { - out.writeBoolean(false); - - out.writeObject(val); - } - } - - out.writeLong(ttl); - - long remaining; - - // 0 means never expires. - if (expireTime == 0) - remaining = -1; - else { - remaining = expireTime - U.currentTimeMillis(); - - if (remaining < 0) - remaining = 0; - } - - // Write remaining time. - out.writeLong(remaining); - - CU.writeVersion(out, ver); +// TODO IGNITE-51. +// out.writeInt(cacheId); +// out.writeBoolean(keyBytesSent); +// out.writeBoolean(valBytesSent); +// +// if (keyBytesSent) - // U.writeByteArray(out, keyBytes); ++// IgniteByteUtils.writeByteArray(out, keyBytes); +// else +// out.writeObject(key); +// +// if (valBytesSent) - // U.writeByteArray(out, valBytes); ++// IgniteByteUtils.writeByteArray(out, valBytes); +// else { +// if (val != null && val instanceof byte[]) { +// out.writeBoolean(true); +// - // U.writeByteArray(out, (byte[])val); ++// IgniteByteUtils.writeByteArray(out, (byte[]) val); +// } +// else { +// out.writeBoolean(false); +// +// out.writeObject(val); +// } +// } +// +// out.writeLong(ttl); +// +// long remaining; +// +// // 0 means never expires. +// if (expireTime == 0) +// remaining = -1; +// else { +// remaining = expireTime - U.currentTimeMillis(); +// +// if (remaining < 0) +// remaining = 0; +// } +// +// // Write remaining time. +// out.writeLong(remaining); +// +// CU.writeVersion(out, ver); } /** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - cacheId = in.readInt(); - keyBytesSent = in.readBoolean(); - valBytesSent = in.readBoolean(); - - if (keyBytesSent) - keyBytes = IgniteByteUtils.readByteArray(in); - else - key = (K)in.readObject(); - - if (valBytesSent) - valBytes = IgniteByteUtils.readByteArray(in); - else - val = in.readBoolean() ? (V) IgniteByteUtils.readByteArray(in) : (V)in.readObject(); - - ttl = in.readLong(); - - long remaining = in.readLong(); - - expireTime = remaining < 0 ? 0 : U.currentTimeMillis() + remaining; - - // Account for overflow. - if (expireTime < 0) - expireTime = 0; - - ver = CU.readVersion(in); +// TODO IGNITE-51. +// cacheId = in.readInt(); +// keyBytesSent = in.readBoolean(); +// valBytesSent = in.readBoolean(); +// +// if (keyBytesSent) - // keyBytes = U.readByteArray(in); ++// keyBytes = IgniteByteUtils.readByteArray(in); +// else +// key = (K)in.readObject(); +// +// if (valBytesSent) - // valBytes = U.readByteArray(in); ++// valBytes = IgniteByteUtils.readByteArray(in); +// else - // val = in.readBoolean() ? (V)U.readByteArray(in) : (V)in.readObject(); ++// val = in.readBoolean() ? (V) IgniteByteUtils.readByteArray(in) : (V)in.readObject(); +// +// ttl = in.readLong(); +// +// long remaining = in.readLong(); +// +// expireTime = remaining < 0 ? 0 : U.currentTimeMillis() + remaining; +// +// // Account for overflow. +// if (expireTime < 0) +// expireTime = 0; +// +// ver = CU.readVersion(in); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java ---------------------------------------------------------------------- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java index e915a37,5e4426f..c9781af --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java @@@ -785,70 -835,69 +786,71 @@@ public class IgniteTxEntry implements G /** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { - out.writeBoolean(depEnabled); - - if (depEnabled) { - IgniteByteUtils.writeByteArray(out, keyBytes); - IgniteByteUtils.writeByteArray(out, transformClosBytes); - IgniteByteUtils.writeByteArray(out, filterBytes); - } - else { - out.writeObject(key); - U.writeCollection(out, entryProcessorsCol); - U.writeArray(out, filters); - } - - out.writeInt(cacheId); - - val.writeTo(out); - - out.writeLong(ttl); - - CU.writeVersion(out, explicitVer); - out.writeBoolean(grpLock); - - if (conflictExpireTime != CU.EXPIRE_TIME_CALCULATE) { - out.writeBoolean(true); - out.writeLong(conflictExpireTime); - } - else - out.writeBoolean(false); - - CU.writeVersion(out, conflictVer); - - out.writeObject(transferExpiryPlc ? new IgniteExternalizableExpiryPolicy(expiryPlc) : null); +// TODO IGNITE-51. +// out.writeBoolean(depEnabled); +// +// if (depEnabled) { - // U.writeByteArray(out, keyBytes); - // U.writeByteArray(out, transformClosBytes); - // U.writeByteArray(out, filterBytes); ++// IgniteByteUtils.writeByteArray(out, keyBytes); ++// IgniteByteUtils.writeByteArray(out, transformClosBytes); ++// IgniteByteUtils.writeByteArray(out, filterBytes); +// } +// else { +// out.writeObject(key); +// U.writeCollection(out, entryProcessorsCol); +// U.writeArray(out, filters); +// } +// +// out.writeInt(cacheId); +// +// val.writeTo(out); +// +// out.writeLong(ttl); +// +// CU.writeVersion(out, explicitVer); +// out.writeBoolean(grpLock); +// +// if (conflictExpireTime != CU.EXPIRE_TIME_CALCULATE) { +// out.writeBoolean(true); +// out.writeLong(conflictExpireTime); +// } +// else +// out.writeBoolean(false); +// +// CU.writeVersion(out, conflictVer); +// +// out.writeObject(transferExpiryPlc ? new IgniteExternalizableExpiryPolicy(expiryPlc) : null); } /** {@inheritDoc} */ @SuppressWarnings({"unchecked"}) @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - depEnabled = in.readBoolean(); - - if (depEnabled) { - keyBytes = IgniteByteUtils.readByteArray(in); - transformClosBytes = IgniteByteUtils.readByteArray(in); - filterBytes = IgniteByteUtils.readByteArray(in); - } - else { - key = (K)in.readObject(); - entryProcessorsCol = U.readCollection(in); - filters = GridCacheUtils.readEntryFilterArray(in); - } - - cacheId = in.readInt(); - - val.readFrom(in); - - ttl = in.readLong(); - - explicitVer = CU.readVersion(in); - grpLock = in.readBoolean(); - - conflictExpireTime = in.readBoolean() ? in.readLong() : CU.EXPIRE_TIME_CALCULATE; - conflictVer = CU.readVersion(in); - - expiryPlc = (ExpiryPolicy)in.readObject(); +// TODO IGNITE-51. +// depEnabled = in.readBoolean(); +// +// if (depEnabled) { - // keyBytes = U.readByteArray(in); - // transformClosBytes = U.readByteArray(in); - // filterBytes = U.readByteArray(in); ++// keyBytes = IgniteByteUtils.readByteArray(in); ++// transformClosBytes = IgniteByteUtils.readByteArray(in); ++// filterBytes = IgniteByteUtils.readByteArray(in); +// } +// else { +// key = (K)in.readObject(); +// entryProcessorsCol = U.readCollection(in); +// filters = GridCacheUtils.readEntryFilterArray(in); +// } +// +// cacheId = in.readInt(); +// +// val.readFrom(in); +// +// ttl = in.readLong(); - // conflictExpireTime = in.readLong(); +// +// explicitVer = CU.readVersion(in); +// grpLock = in.readBoolean(); ++// ++// conflictExpireTime = in.readBoolean() ? in.readLong() : CU.EXPIRE_TIME_CALCULATE; +// conflictVer = CU.readVersion(in); +// +// expiryPlc = (ExpiryPolicy)in.readObject(); } /** {@inheritDoc} */ @@@ -1006,28 -1087,27 +1008,28 @@@ * @throws IOException If failed. */ public void writeTo(ObjectOutput out) throws IOException { - out.writeBoolean(hasWriteVal); - out.writeBoolean(valBytesSent); - - if (hasWriteVal) { - if (valBytesSent) - IgniteByteUtils.writeByteArray(out, valBytes); - else { - if (val != null && val instanceof byte[]) { - out.writeBoolean(true); - - IgniteByteUtils.writeByteArray(out, (byte[]) val); - } - else { - out.writeBoolean(false); - - out.writeObject(val); - } - } - } - - out.writeInt(op.ordinal()); +// TODO IGNITE-51. +// out.writeBoolean(hasWriteVal); +// out.writeBoolean(valBytesSent); +// +// if (hasWriteVal) { +// if (valBytesSent) - // U.writeByteArray(out, valBytes); ++// IgniteByteUtils.writeByteArray(out, valBytes); +// else { +// if (val != null && val instanceof byte[]) { +// out.writeBoolean(true); +// - // U.writeByteArray(out, (byte[])val); ++// IgniteByteUtils.writeByteArray(out, (byte[]) val); +// } +// else { +// out.writeBoolean(false); +// +// out.writeObject(val); +// } +// } +// } +// +// out.writeInt(op.ordinal()); } /** @@@ -1037,18 -1117,17 +1039,18 @@@ */ @SuppressWarnings("unchecked") public void readFrom(ObjectInput in) throws IOException, ClassNotFoundException { - hasWriteVal = in.readBoolean(); - valBytesSent = in.readBoolean(); - - if (hasWriteVal) { - if (valBytesSent) - valBytes = IgniteByteUtils.readByteArray(in); - else - val = in.readBoolean() ? (V) IgniteByteUtils.readByteArray(in) : (V)in.readObject(); - } - - op = fromOrdinal(in.readInt()); +// TODO IGNITE-51. +// hasWriteVal = in.readBoolean(); +// valBytesSent = in.readBoolean(); +// +// if (hasWriteVal) { +// if (valBytesSent) - // valBytes = U.readByteArray(in); ++// valBytes = IgniteByteUtils.readByteArray(in); +// else - // val = in.readBoolean() ? (V)U.readByteArray(in) : (V)in.readObject(); ++// val = in.readBoolean() ? (V) IgniteByteUtils.readByteArray(in) : (V)in.readObject(); +// } +// +// op = fromOrdinal(in.readInt()); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ffee48d5/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java ----------------------------------------------------------------------