You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vk...@apache.org on 2015/03/04 04:27:07 UTC
[1/2] incubator-ignite git commit: IGNITE-141 - Marshallers
refactoring
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-141 2d5586e25 -> 75b231f74
IGNITE-141 - Marshallers refactoring
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0147c4e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0147c4e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0147c4e1
Branch: refs/heads/ignite-141
Commit: 0147c4e1cb75f33ad1378b9b1b9e7ceb20abe7bd
Parents: 2d5586e
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Mar 3 18:29:38 2015 -0800
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Mar 3 18:29:38 2015 -0800
----------------------------------------------------------------------
.../ignite/internal/MarshallerContextImpl.java | 10 +++++++---
.../apache/ignite/internal/classnames.properties | 17 +++++++++++++++++
.../marshaller/MarshallerContextTestImpl.java | 9 ++++++---
3 files changed, 30 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0147c4e1/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 0491aea..8d0e95a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -51,10 +51,14 @@ public class MarshallerContextImpl implements MarshallerContext {
BufferedReader rdr = new BufferedReader(new InputStreamReader(ldr.getResourceAsStream(CLS_NAMES_FILE)));
- String clsName;
+ String line;
- while ((clsName = rdr.readLine()) != null)
- clsNameById.put(clsName.hashCode(), clsName);
+ while ((line = rdr.readLine()) != null) {
+ if (line.isEmpty() || line.startsWith("#"))
+ continue;
+
+ clsNameById.put(line.hashCode(), line.trim());
+ }
}
catch (IOException e) {
throw new IllegalStateException("Failed to initialize marshaller context.", e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0147c4e1/modules/core/src/main/java/org/apache/ignite/internal/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/classnames.properties b/modules/core/src/main/java/org/apache/ignite/internal/classnames.properties
index 69ea7ed..c5480d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/classnames.properties
+++ b/modules/core/src/main/java/org/apache/ignite/internal/classnames.properties
@@ -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.
+#
+
[B
[C
[D
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0147c4e1/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
index 594a022..2538f74 100644
--- a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
@@ -41,11 +41,14 @@ public class MarshallerContextTestImpl implements MarshallerContext {
BufferedReader rdr = new BufferedReader(new InputStreamReader(ldr.getResourceAsStream(CLS_NAMES_FILE)));
- String clsName;
+ String line;
+
+ while ((line = rdr.readLine()) != null) {
+ if (line.isEmpty() || line.startsWith("#"))
+ continue;
- while ((clsName = rdr.readLine()) != null) {
try {
- Class cls = U.forName(clsName, ldr);
+ Class cls = U.forName(line.trim(), ldr);
map.put(cls.getName().hashCode(), cls);
}
[2/2] incubator-ignite git commit: IGNITE-141 - Marshallers
refactoring
Posted by vk...@apache.org.
IGNITE-141 - Marshallers refactoring
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/75b231f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/75b231f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/75b231f7
Branch: refs/heads/ignite-141
Commit: 75b231f741228cb988c7a51511cdd759e4f772b4
Parents: 0147c4e
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Tue Mar 3 19:11:50 2015 -0800
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Tue Mar 3 19:11:50 2015 -0800
----------------------------------------------------------------------
.../managers/communication/GridIoManager.java | 32 ++++++++++++++++++--
.../processors/igfs/IgfsFileInfoSelfTest.java | 4 +--
.../streamer/GridStreamerFailoverSelfTest.java | 2 +-
3 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75b231f7/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 ca84cb1..3b8eabd 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
@@ -389,6 +389,35 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
/** {@inheritDoc} */
@SuppressWarnings("BusyWait")
@Override public void onKernalStop0(boolean cancel) {
+// // No more communication messages.
+// getSpi().setListener(null);
+//
+// busyLock.writeLock();
+//
+// U.shutdownNow(getClass(), affPool, log);
+//
+// boolean interrupted = false;
+//
+// while (workersCnt.sum() != 0) {
+// try {
+// Thread.sleep(200);
+// }
+// catch (InterruptedException ignored) {
+// interrupted = true;
+// }
+// }
+//
+// if (interrupted)
+// Thread.currentThread().interrupt();
+//
+// GridEventStorageManager evtMgr = ctx.event();
+//
+// if (evtMgr != null && discoLsnr != null)
+// evtMgr.removeLocalEventListener(discoLsnr);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stop(boolean cancel) throws IgniteCheckedException {
// No more communication messages.
getSpi().setListener(null);
@@ -414,10 +443,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
if (evtMgr != null && discoLsnr != null)
evtMgr.removeLocalEventListener(discoLsnr);
- }
- /** {@inheritDoc} */
- @Override public void stop(boolean cancel) throws IgniteCheckedException {
stopSpi();
// Clear cache.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75b231f7/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
index a666a0a..c7eca62 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfoSelfTest.java
@@ -40,6 +40,8 @@ public class IgfsFileInfoSelfTest extends IgfsCommonAbstractTest {
* @throws Exception If failed.
*/
public void testSerialization() throws Exception {
+ marshaller.setContext(new MarshallerContextTestImpl());
+
final int max = Integer.MAX_VALUE;
multithreaded(new Callable<Object>() {
@@ -83,8 +85,6 @@ public class IgfsFileInfoSelfTest extends IgfsCommonAbstractTest {
* @throws IgniteCheckedException In case of any marshalling exception.
*/
private <T> T mu(T obj) throws IgniteCheckedException {
- marshaller.setContext(new MarshallerContextTestImpl());
-
return marshaller.unmarshal(marshaller.marshal(obj), null);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75b231f7/modules/core/src/test/java/org/apache/ignite/internal/processors/streamer/GridStreamerFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/streamer/GridStreamerFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/streamer/GridStreamerFailoverSelfTest.java
index 201d5d4..a7f99d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/streamer/GridStreamerFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/streamer/GridStreamerFailoverSelfTest.java
@@ -162,7 +162,7 @@ public class GridStreamerFailoverSelfTest extends GridCommonAbstractTest {
return null;
}
- }, 1);
+ }, 1, "restarter");
final Collection<Object> failed = new ConcurrentLinkedQueue<>();