You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/09/13 10:52:21 UTC
[1/8] ignite git commit: IGNITE-6229 Fixes in code generation.
Repository: ignite
Updated Branches:
refs/heads/ignite-5896 d1a7af6c8 -> 05147bae9
IGNITE-6229 Fixes in code generation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d753e900
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d753e900
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d753e900
Branch: refs/heads/ignite-5896
Commit: d753e9005c5a86cb4adde090149d600177d87a13
Parents: 0542c76
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Wed Sep 13 17:09:03 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Sep 13 17:09:03 2017 +0700
----------------------------------------------------------------------
.../generator/AbstractTransformer.js | 4 +-
.../generator/ConfigurationGenerator.js | 70 +++++++++++---------
.../generator/JavaTransformer.service.js | 7 +-
.../generator/SpringTransformer.service.js | 2 +-
4 files changed, 46 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d753e900/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js b/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
index 7e89fbd..a67f7b9 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
@@ -134,8 +134,8 @@ export default class AbstractTransformer {
}
// Generate memory configuration group.
- static clusterMemory(memoryConfiguration) {
- return this.toSection(this.generator.clusterMemory(memoryConfiguration));
+ static clusterMemory(memoryConfiguration, available) {
+ return this.toSection(this.generator.clusterMemory(memoryConfiguration, available));
}
// Generate marshaller group.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d753e900/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
index 24dc0d3..428a8d0 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
@@ -91,7 +91,7 @@ export default class IgniteConfigurationGenerator {
// Since ignite 2.0
if (available('2.0.0'))
- this.clusterMemory(cluster.memoryConfiguration, cfg);
+ this.clusterMemory(cluster.memoryConfiguration, available, cfg);
this.clusterMisc(cluster, available, cfg);
this.clusterMetrics(cluster, available, cfg);
@@ -974,6 +974,35 @@ export default class IgniteConfigurationGenerator {
return discoSpi;
}
+ // Execute event filtration in accordance to generated project version.
+ static filterEvents(eventGrps, available) {
+ if (available('2.0.0')) {
+ return _.reduce(eventGrps, (acc, eventGrp) => {
+ switch (eventGrp.value) {
+ case 'EVTS_SWAPSPACE':
+ // Removed.
+
+ break;
+ case 'EVTS_CACHE':
+ const eventGrpX2 = _.cloneDeep(eventGrp);
+
+ eventGrpX2.events = _.filter(eventGrpX2.events, (ev) =>
+ !_.includes(['EVT_CACHE_OBJECT_SWAPPED', 'EVT_CACHE_OBJECT_UNSWAPPED'], ev));
+
+ acc.push(eventGrpX2);
+
+ break;
+ default:
+ acc.push(eventGrp);
+ }
+
+ return acc;
+ }, []);
+ }
+
+ return eventGrps;
+ }
+
// Generate events group.
static clusterEvents(cluster, available, cfg = this.igniteConfigurationBean(cluster)) {
const eventStorage = cluster.eventStorage;
@@ -1009,33 +1038,7 @@ export default class IgniteConfigurationGenerator {
if (_.nonEmpty(cluster.includeEventTypes)) {
const eventGrps = _.filter(this.eventGrps, ({value}) => _.includes(cluster.includeEventTypes, value));
- if (available('2.0.0')) {
- const events = _.reduce(eventGrps, (acc, eventGrp) => {
- switch (eventGrp.value) {
- case 'EVTS_SWAPSPACE':
- // Removed.
-
- break;
- case 'EVTS_CACHE':
- const eventGrpX2 = _.cloneDeep(eventGrp);
-
- eventGrpX2.events = _.filter(eventGrpX2.events, (ev) =>
- !_.includes(['EVT_CACHE_OBJECT_SWAPPED', 'EVT_CACHE_OBJECT_UNSWAPPED'], ev));
-
- acc.push(eventGrpX2);
-
- break;
- default:
- acc.push(eventGrp);
- }
-
- return acc;
- }, []);
-
- cfg.eventTypes('evts', 'includeEventTypes', events);
- }
- else
- cfg.eventTypes('evts', 'includeEventTypes', eventGrps);
+ cfg.eventTypes('evts', 'includeEventTypes', this.filterEvents(eventGrps, available));
}
}
@@ -1282,8 +1285,8 @@ export default class IgniteConfigurationGenerator {
return cfg;
}
- // Generate logger group.
- static clusterMemory(memoryConfiguration, cfg = this.igniteConfigurationBean()) {
+ // Generate memory configuration.
+ static clusterMemory(memoryConfiguration, available, cfg = this.igniteConfigurationBean()) {
const memoryBean = new Bean('org.apache.ignite.configuration.MemoryConfiguration', 'memoryConfiguration', memoryConfiguration, clusterDflts.memoryConfiguration);
memoryBean.intProperty('pageSize')
@@ -1307,10 +1310,13 @@ export default class IgniteConfigurationGenerator {
.enumProperty('pageEvictionMode')
.doubleProperty('evictionThreshold')
.intProperty('emptyPagesPoolSize')
- .intProperty('subIntervals')
- .longProperty('rateTimeInterval')
.boolProperty('metricsEnabled');
+ if (available('2.1.0')) {
+ plcBean.intProperty('subIntervals')
+ .longProperty('rateTimeInterval');
+ }
+
if (plcBean.isEmpty()) return;
policies.push(plcBean);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d753e900/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js b/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
index 8739608..64fc172 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/JavaTransformer.service.js
@@ -778,7 +778,8 @@ export default class IgniteJavaTransformer extends AbstractTransformer {
break;
case 'ARRAY':
- imports.push(prop.typeClsName);
+ if (!prop.varArg)
+ imports.push(prop.typeClsName);
if (this._isBean(prop.typeClsName))
_.forEach(prop.items, (item) => imports.push(...this.collectBeanImports(item)));
@@ -1589,7 +1590,7 @@ export default class IgniteJavaTransformer extends AbstractTransformer {
const sb = new StringBuilder();
- const imports = ['org.apache.ignite.Ignition', 'org.apache.ignite.Ignite'];
+ const imports = ['org.apache.ignite.Ignition'];
if (demo) {
imports.push('org.h2.tools.Server', 'java.sql.Connection', 'java.sql.PreparedStatement',
@@ -1650,6 +1651,8 @@ export default class IgniteJavaTransformer extends AbstractTransformer {
}
if ((_.nonEmpty(clientNearCaches) || demo) && shortFactoryCls) {
+ imports.push('org.apache.ignite.Ignite');
+
sb.append(`Ignite ignite = Ignition.start(${cfgRef});`);
_.forEach(clientNearCaches, (cache, idx) => {
http://git-wip-us.apache.org/repos/asf/ignite/blob/d753e900/modules/web-console/frontend/app/modules/configuration/generator/SpringTransformer.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/SpringTransformer.service.js b/modules/web-console/frontend/app/modules/configuration/generator/SpringTransformer.service.js
index eda590c..f0bfdb6 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/SpringTransformer.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/SpringTransformer.service.js
@@ -94,7 +94,7 @@ export default class IgniteSpringTransformer extends AbstractTransformer {
case 'java.lang.Class':
return this.javaTypes.fullClassName(item);
case 'long':
- return `${item}L`;
+ return `${item}`;
case 'java.lang.String':
case 'PATH':
return this.escapeXml(item);
[4/8] ignite git commit: IGNITE-6356 - Fixed overflow when using
number of partitions greater than Short.MAX_VALUE
Posted by vo...@apache.org.
IGNITE-6356 - Fixed overflow when using number of partitions greater than Short.MAX_VALUE
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1aa59a69
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1aa59a69
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1aa59a69
Branch: refs/heads/ignite-5896
Commit: 1aa59a69fa7e6a38938090ca9dfdaba3dfa307d5
Parents: fdfd473
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Sep 13 13:42:31 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Sep 13 13:42:31 2017 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 2 +-
.../dht/preloader/GridDhtPartitionMap.java | 4 +-
.../distributed/Cache64kPartitionsTest.java | 86 ++++++++++++++++++++
.../testsuites/IgniteCacheTestSuite5.java | 4 +-
4 files changed, 92 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa59a69/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 2b4ec1d..6c43d13 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -77,7 +77,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
private static final long serialVersionUID = 0L;
/** Maximum number of partitions. */
- public static final int MAX_PARTITIONS_COUNT = 0xFFFF;
+ public static final int MAX_PARTITIONS_COUNT = 65000;
/** Default size of rebalance thread pool. */
@Deprecated
http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa59a69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
index 5173a01..cb69714 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
@@ -293,8 +293,8 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext
map = new GridPartitionStateMap();
for (int i = 0; i < size; i++) {
- int ordinal = in.readByte();
- int part = in.readShort();
+ int ordinal = in.readUnsignedByte();
+ int part = in.readUnsignedShort();
put(part, GridDhtPartitionState.fromOrdinal(ordinal));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa59a69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java
new file mode 100644
index 0000000..fe139ba
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed;
+
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.PersistentStoreConfiguration;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class Cache64kPartitionsTest extends GridCommonAbstractTest {
+ /** */
+ private boolean persistenceEnabled;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ CacheConfiguration ccfg = new CacheConfiguration("default");
+
+ ccfg.setAffinity(new RendezvousAffinityFunction(false, CacheConfiguration.MAX_PARTITIONS_COUNT));
+
+ cfg.setCacheConfiguration(ccfg);
+
+ cfg.setActiveOnStart(false);
+
+ if (persistenceEnabled)
+ cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testManyPartitionsNoPersistence() throws Exception {
+ checkManyPartitions();
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testManyPartitionsWithPersistence() throws Exception {
+ persistenceEnabled = true;
+
+ checkManyPartitions();
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ private void checkManyPartitions() throws Exception {
+ try {
+ startGrids(4);
+
+ grid(0).active(true);
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ GridTestUtils.deleteDbFiles();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa59a69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index 953c789..38ffb4c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@ -35,9 +35,9 @@ import org.apache.ignite.internal.processors.cache.IgniteCachePutStackOverflowSe
import org.apache.ignite.internal.processors.cache.IgniteCacheReadThroughEvictionsVariationsSuite;
import org.apache.ignite.internal.processors.cache.IgniteCacheStoreCollectionTest;
import org.apache.ignite.internal.processors.cache.PartitionsExchangeOnDiscoveryHistoryOverflowTest;
+import org.apache.ignite.internal.processors.cache.distributed.Cache64kPartitionsTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentNodeJoinValidationTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentTest;
-import org.apache.ignite.internal.processors.cache.distributed.GridCachePartitionEvictionDuringReadThroughSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheGroupsPartitionLossPolicySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCachePartitionLossPolicySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheTxIteratorSelfTest;
@@ -96,6 +96,8 @@ public class IgniteCacheTestSuite5 extends TestSuite {
suite.addTestSuite(NotMappedPartitionInTxTest.class);
+ suite.addTestSuite(Cache64kPartitionsTest.class);
+
return suite;
}
}
[7/8] ignite git commit: Merge branch 'master' into ignite-5896
Posted by vo...@apache.org.
Merge branch 'master' into ignite-5896
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e8eb3c72
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e8eb3c72
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e8eb3c72
Branch: refs/heads/ignite-5896
Commit: e8eb3c728947565f34f642a0d55ed0bbbfebaebf
Parents: fa5ddae c105f03
Author: devozerov <vo...@gridgain.com>
Authored: Wed Sep 13 13:49:56 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Sep 13 13:49:56 2017 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 2 +-
.../dht/preloader/GridDhtPartitionMap.java | 4 +-
.../processors/odbc/SqlListenerNioListener.java | 11 +--
.../processors/odbc/SqlListenerRequest.java | 16 +---
.../processors/odbc/SqlListenerRequestNoId.java | 28 +++++++
.../processors/odbc/jdbc/JdbcRequest.java | 4 +-
.../processors/odbc/odbc/OdbcRequest.java | 4 +-
.../distributed/Cache64kPartitionsTest.java | 86 ++++++++++++++++++++
.../testsuites/IgniteCacheTestSuite5.java | 4 +-
.../generator/AbstractTransformer.js | 4 +-
.../generator/ConfigurationGenerator.js | 70 ++++++++--------
.../generator/JavaTransformer.service.js | 7 +-
.../generator/SpringTransformer.service.js | 2 +-
.../agent/handlers/AbstractListener.java | 14 ++--
14 files changed, 183 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e8eb3c72/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
----------------------------------------------------------------------
[6/8] ignite git commit: Merge remote-tracking branch 'origin/master'
Posted by vo...@apache.org.
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/c105f03f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c105f03f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c105f03f
Branch: refs/heads/ignite-5896
Commit: c105f03f8d89905e60f195533ae9370d6a217747
Parents: 22b1578 1aa59a6
Author: devozerov <vo...@gridgain.com>
Authored: Wed Sep 13 13:47:08 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Sep 13 13:47:08 2017 +0300
----------------------------------------------------------------------
.../configuration/CacheConfiguration.java | 2 +-
.../dht/preloader/GridDhtPartitionMap.java | 4 +-
.../distributed/Cache64kPartitionsTest.java | 86 ++++++++++++++++++++
.../testsuites/IgniteCacheTestSuite5.java | 4 +-
.../generator/AbstractTransformer.js | 4 +-
.../generator/ConfigurationGenerator.js | 70 ++++++++--------
.../generator/JavaTransformer.service.js | 7 +-
.../generator/SpringTransformer.service.js | 2 +-
.../agent/handlers/AbstractListener.java | 14 ++--
9 files changed, 146 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
[2/8] ignite git commit: IGNITE-6223 Fixed NPE when data is null on
job fail.
Posted by vo...@apache.org.
IGNITE-6223 Fixed NPE when data is null on job fail.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fdfd4736
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fdfd4736
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fdfd4736
Branch: refs/heads/ignite-5896
Commit: fdfd47367756816104620a1f324e0e38f6a68d8f
Parents: d753e90
Author: vsisko <vs...@gridgain.com>
Authored: Wed Aug 30 16:43:17 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Sep 13 17:25:53 2017 +0700
----------------------------------------------------------------------
.../console/agent/handlers/AbstractListener.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdfd4736/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/handlers/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/handlers/AbstractListener.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/handlers/AbstractListener.java
index faf864b..2eec89b 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/handlers/AbstractListener.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/handlers/AbstractListener.java
@@ -76,15 +76,17 @@ abstract class AbstractListener implements Emitter.Listener {
if (res instanceof RestResult) {
RestResult restRes = (RestResult) res;
- ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
- Base64OutputStream b64os = new Base64OutputStream(baos);
- GZIPOutputStream gzip = new GZIPOutputStream(b64os);
+ if (restRes.getData() != null) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
+ Base64OutputStream b64os = new Base64OutputStream(baos);
+ GZIPOutputStream gzip = new GZIPOutputStream(b64os);
- gzip.write(restRes.getData().getBytes());
+ gzip.write(restRes.getData().getBytes());
- gzip.close();
+ gzip.close();
- restRes.zipData(baos.toString());
+ restRes.zipData(baos.toString());
+ }
}
cb.call(null, toJSON(res));
[3/8] ignite git commit: Cosmetics.
Posted by vo...@apache.org.
Cosmetics.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fa5ddae4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fa5ddae4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fa5ddae4
Branch: refs/heads/ignite-5896
Commit: fa5ddae42d2c8e3f60382a5a1bf4e5fcfa69bf3a
Parents: d1a7af6
Author: devozerov <vo...@gridgain.com>
Authored: Wed Sep 13 13:31:26 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Sep 13 13:31:26 2017 +0300
----------------------------------------------------------------------
.../processors/platform/client/ClientBooleanResponse.java | 8 ++++----
.../processors/platform/client/ClientObjectResponse.java | 8 ++++----
.../internal/processors/platform/client/ClientRequest.java | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa5ddae4/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
index fd17646..7ab3dc7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientBooleanResponse.java
@@ -27,12 +27,12 @@ public class ClientBooleanResponse extends ClientResponse {
private final boolean val;
/**
- * Ctor.
+ * Constructor.
*
- * @param requestId Request id.
+ * @param reqId Request id.
*/
- public ClientBooleanResponse(long requestId, boolean val) {
- super(requestId);
+ public ClientBooleanResponse(long reqId, boolean val) {
+ super(reqId);
this.val = val;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa5ddae4/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
index 730872f..fc851a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientObjectResponse.java
@@ -27,12 +27,12 @@ public class ClientObjectResponse extends ClientResponse {
private final Object val;
/**
- * Ctor.
+ * Constructor.
*
- * @param requestId Request id.
+ * @param reqId Request id.
*/
- public ClientObjectResponse(long requestId, Object val) {
- super(requestId);
+ public ClientObjectResponse(long reqId, Object val) {
+ super(reqId);
this.val = val;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa5ddae4/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
index 134b011..0a15d6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
@@ -29,7 +29,7 @@ public class ClientRequest extends SqlListenerRequest {
private final long requestId;
/**
- * Ctor.
+ * Constructor.
*
* @param reader Reader.
*/
[8/8] ignite git commit: Splitted request.
Posted by vo...@apache.org.
Splitted request.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/05147bae
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/05147bae
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/05147bae
Branch: refs/heads/ignite-5896
Commit: 05147bae9d8716b298165b2dd1553f4e56d21f41
Parents: e8eb3c7
Author: devozerov <vo...@gridgain.com>
Authored: Wed Sep 13 13:52:09 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Sep 13 13:52:09 2017 +0300
----------------------------------------------------------------------
.../processors/platform/client/ClientRequest.java | 18 +++++++-----------
.../binary/ClientGetBinaryTypeNameRequest.java | 2 +-
.../binary/ClientGetBinaryTypeSchemaRequest.java | 2 +-
.../ClientRegisterBinaryTypeNameRequest.java | 2 +-
.../client/cache/ClientCacheGetRequest.java | 2 +-
5 files changed, 11 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/05147bae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
index 0a15d6a..c16d481 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientRequest.java
@@ -24,9 +24,9 @@ import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
/**
* Thin client request.
*/
-public class ClientRequest extends SqlListenerRequest {
+public class ClientRequest implements SqlListenerRequest {
/** Request id. */
- private final long requestId;
+ private final long reqId;
/**
* Constructor.
@@ -34,16 +34,12 @@ public class ClientRequest extends SqlListenerRequest {
* @param reader Reader.
*/
public ClientRequest(BinaryRawReader reader) {
- requestId = reader.readLong();
+ reqId = reader.readLong();
}
- /**
- * Gets the request id.
- *
- * @return Data.
- */
- public long getRequestId() {
- return requestId;
+ /** {@inheritDoc} */
+ @Override public long requestId() {
+ return reqId;
}
/**
@@ -52,6 +48,6 @@ public class ClientRequest extends SqlListenerRequest {
* @return Response.
*/
public ClientResponse process(GridKernalContext ctx) {
- return new ClientResponse(requestId);
+ return new ClientResponse(reqId);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/05147bae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeNameRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeNameRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeNameRequest.java
index d434fe1..7ea5f1d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeNameRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeNameRequest.java
@@ -51,7 +51,7 @@ public class ClientGetBinaryTypeNameRequest extends ClientRequest {
try {
String typeName = ctx.marshallerContext().getClassName(platformId, typeId);
- return new ClientGetBinaryTypeNameResponse(getRequestId(), typeName);
+ return new ClientGetBinaryTypeNameResponse(requestId(), typeName);
} catch (ClassNotFoundException | IgniteCheckedException e) {
throw new BinaryObjectException(e);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/05147bae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeSchemaRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeSchemaRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeSchemaRequest.java
index bbde1ba..72c3cc2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeSchemaRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientGetBinaryTypeSchemaRequest.java
@@ -50,6 +50,6 @@ public class ClientGetBinaryTypeSchemaRequest extends ClientRequest {
@Override public ClientResponse process(GridKernalContext ctx) {
int[] schema = PlatformUtils.getSchema((CacheObjectBinaryProcessorImpl)ctx.cacheObjects(), typeId, schemaId);
- return new ClientGetBinaryTypeSchemaResponse(getRequestId(), schema);
+ return new ClientGetBinaryTypeSchemaResponse(requestId(), schema);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/05147bae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientRegisterBinaryTypeNameRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientRegisterBinaryTypeNameRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientRegisterBinaryTypeNameRequest.java
index a3a780b..2f7aa54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientRegisterBinaryTypeNameRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientRegisterBinaryTypeNameRequest.java
@@ -56,7 +56,7 @@ public class ClientRegisterBinaryTypeNameRequest extends ClientRequest {
try {
boolean res = ctx.marshallerContext().registerClassName(platformId, typeId, typeName);
- return new ClientBooleanResponse(getRequestId(), res);
+ return new ClientBooleanResponse(requestId(), res);
} catch (IgniteCheckedException e) {
throw new IgniteException(e);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/05147bae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheGetRequest.java
index 48252d2..38ec788 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheGetRequest.java
@@ -45,6 +45,6 @@ public class ClientCacheGetRequest extends ClientCacheRequest {
@Override public ClientResponse process(GridKernalContext ctx) {
Object val = getCache(ctx).get(key);
- return new ClientObjectResponse(getRequestId(), val);
+ return new ClientObjectResponse(requestId(), val);
}
}
[5/8] ignite git commit: IGNITE-5896: Preparing base client request
for integration with thin client.
Posted by vo...@apache.org.
IGNITE-5896: Preparing base client request for integration with thin client.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/22b15786
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/22b15786
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/22b15786
Branch: refs/heads/ignite-5896
Commit: 22b157865c304be4d13fcca6f435d2fcad842d00
Parents: 0542c76
Author: devozerov <vo...@gridgain.com>
Authored: Wed Sep 13 13:46:13 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Sep 13 13:46:13 2017 +0300
----------------------------------------------------------------------
.../processors/odbc/SqlListenerNioListener.java | 11 +++-----
.../processors/odbc/SqlListenerRequest.java | 16 ++---------
.../processors/odbc/SqlListenerRequestNoId.java | 28 ++++++++++++++++++++
.../processors/odbc/jdbc/JdbcRequest.java | 4 +--
.../processors/odbc/odbc/OdbcRequest.java | 4 +--
5 files changed, 37 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
index e2d444b..98cd8ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerNioListener.java
@@ -47,9 +47,6 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
/** Connection-related metadata key. */
private static final int CONN_CTX_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
- /** Request ID generator. */
- private static final AtomicLong REQ_ID_GEN = new AtomicLong();
-
/** Busy lock. */
private final GridSpinBusyLock busyLock;
@@ -123,15 +120,13 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
assert req != null;
- req.requestId(REQ_ID_GEN.incrementAndGet());
-
try {
long startTime = 0;
if (log.isDebugEnabled()) {
startTime = System.nanoTime();
- log.debug("SQL client request received [reqId=" + req.requestId() + ", addr=" +
+ log.debug("Client request received [reqId=" + req.requestId() + ", addr=" +
ses.remoteAddress() + ", req=" + req + ']');
}
@@ -140,7 +135,7 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
if (log.isDebugEnabled()) {
long dur = (System.nanoTime() - startTime) / 1000;
- log.debug("SQL client request processed [reqId=" + req.requestId() + ", dur(mcs)=" + dur +
+ log.debug("Client request processed [reqId=" + req.requestId() + ", dur(mcs)=" + dur +
", resp=" + resp.status() + ']');
}
@@ -149,7 +144,7 @@ public class SqlListenerNioListener extends GridNioServerListenerAdapter<byte[]>
ses.send(outMsg);
}
catch (Exception e) {
- log.error("Failed to process SQL client request [req=" + req + ']', e);
+ log.error("Failed to process client request [req=" + req + ']', e);
ses.send(parser.encode(handler.handleException(e)));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
index 3c74752..5b1c5fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequest.java
@@ -20,24 +20,12 @@ package org.apache.ignite.internal.processors.odbc;
/**
* SQL listener command request.
*/
-public abstract class SqlListenerRequest {
+public interface SqlListenerRequest {
/** Handshake request. */
public static final int HANDSHAKE = 1;
- /** Request ID. */
- private long reqId;
-
/**
* @return Request ID.
*/
- public long requestId() {
- return reqId;
- }
-
- /**
- * @param reqId Request ID.
- */
- public void requestId(long reqId) {
- this.reqId = reqId;
- }
+ public long requestId();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
new file mode 100644
index 0000000..68dbc5c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/SqlListenerRequestNoId.java
@@ -0,0 +1,28 @@
+/*
+ * 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.odbc;
+
+/**
+ * Client request with no ID.
+ */
+public abstract class SqlListenerRequestNoId implements SqlListenerRequest {
+ /** {@inheritDoc} */
+ @Override public long requestId() {
+ return 0;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
index 4ef75f6..ab97dc5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequest.java
@@ -21,12 +21,12 @@ import org.apache.ignite.IgniteException;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.internal.binary.BinaryReaderExImpl;
import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
+import org.apache.ignite.internal.processors.odbc.SqlListenerRequestNoId;
/**
* JDBC request.
*/
-public class JdbcRequest extends SqlListenerRequest implements JdbcRawBinarylizable {
+public class JdbcRequest extends SqlListenerRequestNoId implements JdbcRawBinarylizable {
/** Execute sql query request. */
static final byte QRY_EXEC = 2;
http://git-wip-us.apache.org/repos/asf/ignite/blob/22b15786/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
index 62c4de3..58ffad6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequest.java
@@ -17,12 +17,12 @@
package org.apache.ignite.internal.processors.odbc.odbc;
-import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
+import org.apache.ignite.internal.processors.odbc.SqlListenerRequestNoId;
/**
* SQL listener command request.
*/
-public class OdbcRequest extends SqlListenerRequest {
+public class OdbcRequest extends SqlListenerRequestNoId {
/** Execute sql query. */
public static final int QRY_EXEC = 2;