This is an automated email from the ASF dual-hosted git repository.
nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 119fc236342 IGNITE-28970 Remove stale methods from OptimizedMarshaller
(#13457)
119fc236342 is described below
commit 119fc236342398438deea23841a36ae4c1110620
Author: Nikolay <[email protected]>
AuthorDate: Mon Aug 10 14:52:06 2026 +0300
IGNITE-28970 Remove stale methods from OptimizedMarshaller (#13457)
---
.../marshaller/optimized/OptimizedMarshaller.java | 34 ---------
.../optimized/OptimizedMarshallerImpl.java | 42 +++-------
.../OptimizedObjectPooledStreamRegistry.java | 89 ----------------------
.../OptimizedObjectSharedStreamRegistry.java | 70 ++++++++++++++---
.../optimized/OptimizedObjectStreamRegistry.java | 87 ---------------------
.../OptimizedMarshallerPooledSelfTest.java | 44 -----------
.../optimized/OptimizedMarshallerTest.java | 39 ++++------
.../optimized/OptimizedObjectStreamSelfTest.java | 28 +++----
.../testsuites/IgniteMarshallerSelfTestSuite.java | 2 -
9 files changed, 94 insertions(+), 341 deletions(-)
diff --git
a/modules/binary/api/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshaller.java
b/modules/binary/api/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshaller.java
index e4733564f76..f392167db26 100644
---
a/modules/binary/api/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshaller.java
+++
b/modules/binary/api/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshaller.java
@@ -70,40 +70,6 @@ import org.apache.ignite.marshaller.Marshaller;
* For information about Spring framework visit <a
href="http://www.springframework.org/">www.springframework.org</a>
*/
public interface OptimizedMarshaller extends Marshaller {
- /**
- * Sets whether marshaller should require {@link Serializable} interface
or not.
- *
- * @param requireSer Whether to require {@link Serializable}.
- * @return {@code this} for chaining.
- */
- public OptimizedMarshaller setRequireSerializable(boolean requireSer);
-
- /**
- * Sets ID mapper.
- *
- * @param mapper ID mapper.
- * @return {@code this} for chaining.
- */
- public OptimizedMarshaller setIdMapper(OptimizedMarshallerIdMapper mapper);
-
- /**
- * Specifies size of cached object streams used by marshaller. Object
streams are cached for
- * performance reason to avoid costly recreation for every serialization
routine. If {@code 0} (default),
- * pool is not used and each thread has its own cached object stream which
it keeps reusing.
- * <p>
- * Since each stream has an internal buffer, creating a stream for each
thread can lead to
- * high memory consumption if many large messages are marshalled or
unmarshalled concurrently.
- * Consider using pool in this case. This will limit number of streams
that can be created and,
- * therefore, decrease memory consumption.
- * <p>
- * NOTE: Using streams pool can decrease performance since streams will be
shared between
- * different threads which will lead to more frequent context switching.
- *
- * @param poolSize Streams pool size. If {@code 0}, pool is not used.
- * @return {@code this} for chaining.
- */
- public OptimizedMarshaller setPoolSize(int poolSize);
-
/**
* Clears the optimized class descriptors cache. This is essential for the
clients
* on disconnect in order to make them register their user types again
(server nodes may
diff --git
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerImpl.java
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerImpl.java
index ec917263ecb..af6f058d540 100644
---
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerImpl.java
+++
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerImpl.java
@@ -86,19 +86,16 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
private final ClassLoader dfltClsLdr = getClass().getClassLoader();
/** Whether or not to require an object to be serializable in order to be
marshalled. */
- private boolean requireSer = true;
-
- /** ID mapper. */
- private OptimizedMarshallerIdMapper mapper;
+ private final boolean requireSer;
/** Class descriptors by class. */
private final ConcurrentMap<Class, OptimizedClassDescriptor> clsMap = new
ConcurrentHashMap<>();
/** */
- private OptimizedObjectStreamRegistry registry = new
OptimizedObjectSharedStreamRegistry();
+ private final OptimizedObjectSharedStreamRegistry registry = new
OptimizedObjectSharedStreamRegistry();
/** Non cached registry. */
- private OptimizedObjectSharedStreamRegistry nonCachedRegistry = new
OptimizedObjectSharedStreamRegistry();
+ private final OptimizedObjectSharedStreamRegistry nonCachedRegistry = new
OptimizedObjectSharedStreamRegistry();
/**
* Creates new marshaller will all defaults.
@@ -106,6 +103,8 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
* @throws IgniteException If this marshaller is not supported on the
current JVM.
*/
public OptimizedMarshallerImpl() {
+ this.requireSer = true;
+
if (!available())
throw new IgniteException("Using OptimizedMarshaller on
unsupported JVM version (some of " +
"JVM-private APIs required for the marshaller to work are
missing).");
@@ -121,29 +120,6 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
this.requireSer = requireSer;
}
- /** {@inheritDoc} */
- @Override public OptimizedMarshaller setRequireSerializable(boolean
requireSer) {
- this.requireSer = requireSer;
-
- return this;
- }
-
- /** {@inheritDoc} */
- @Override public OptimizedMarshaller
setIdMapper(OptimizedMarshallerIdMapper mapper) {
- this.mapper = mapper;
-
- return this;
- }
-
- /** {@inheritDoc} */
- @Override public OptimizedMarshaller setPoolSize(int poolSize) {
- registry = poolSize > 0 ?
- new OptimizedObjectPooledStreamRegistry(poolSize) :
- new OptimizedObjectSharedStreamRegistry();
-
- return this;
- }
-
/** {@inheritDoc} */
@Override protected void marshal0(@Nullable Object obj, OutputStream out)
throws IgniteCheckedException {
assert out != null;
@@ -153,7 +129,7 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
try {
objOut = registry.out();
- objOut.context(clsMap, ctx, mapper, requireSer);
+ objOut.context(clsMap, ctx, null, requireSer);
objOut.out().outputStream(out);
@@ -174,7 +150,7 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
try {
objOut = registry.out();
- objOut.context(clsMap, ctx, mapper, requireSer);
+ objOut.context(clsMap, ctx, null, requireSer);
objOut.writeObject(obj);
@@ -199,7 +175,7 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
try {
objIn = !useCache ? nonCachedRegistry.in() : registry.in();
- objIn.context(clsMap, ctx, mapper, clsLdr != null ? clsLdr :
dfltClsLdr);
+ objIn.context(clsMap, ctx, null, clsLdr != null ? clsLdr :
dfltClsLdr);
objIn.in().inputStream(in);
@@ -232,7 +208,7 @@ public class OptimizedMarshallerImpl extends
AbstractNodeNameAwareMarshaller imp
try {
objIn = registry.in();
- objIn.context(clsMap, ctx, mapper, clsLdr != null ? clsLdr :
dfltClsLdr);
+ objIn.context(clsMap, ctx, null, clsLdr != null ? clsLdr :
dfltClsLdr);
objIn.in().bytes(arr, arr.length);
diff --git
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectPooledStreamRegistry.java
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectPooledStreamRegistry.java
deleted file mode 100644
index 1ff85173d9d..00000000000
---
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectPooledStreamRegistry.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.marshaller.optimized;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.util.CommonUtils;
-
-/**
- *
- */
-public class OptimizedObjectPooledStreamRegistry extends
OptimizedObjectStreamRegistry {
- /** Output streams pool. */
- private final BlockingQueue<OptimizedObjectOutputStream> outPool;
-
- /** Input streams pool. */
- private final BlockingQueue<OptimizedObjectInputStream> inPool;
-
- /**
- * @param size Pool size.
- */
- OptimizedObjectPooledStreamRegistry(int size) {
- assert size > 0 : "size must be positive for pooled stream registry: "
+ size;
-
- outPool = new LinkedBlockingQueue<>(size);
- inPool = new LinkedBlockingQueue<>(size);
-
- for (int i = 0; i < size; i++) {
- outPool.offer(createOut());
- inPool.offer(createIn());
- }
- }
-
- /** {@inheritDoc} */
- @Override OptimizedObjectOutputStream out() throws
IgniteInterruptedCheckedException {
- try {
- return outPool.take();
- }
- catch (InterruptedException e) {
- throw new IgniteInterruptedCheckedException(
- "Failed to take output object stream from pool (thread
interrupted).", e);
- }
- }
-
- /** {@inheritDoc} */
- @Override OptimizedObjectInputStream in() throws
IgniteInterruptedCheckedException {
- try {
- return inPool.take();
- }
- catch (InterruptedException e) {
- throw new IgniteInterruptedCheckedException(
- "Failed to take input object stream from pool (thread
interrupted).", e);
- }
- }
-
- /** {@inheritDoc} */
- @Override void closeOut(OptimizedObjectOutputStream out) {
- CommonUtils.close(out, null);
-
- boolean b = outPool.offer(out);
-
- assert b;
- }
-
- /** {@inheritDoc} */
- @Override void closeIn(OptimizedObjectInputStream in) {
- CommonUtils.close(in, null);
-
- boolean b = inPool.offer(in);
-
- assert b;
- }
-}
diff --git
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectSharedStreamRegistry.java
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectSharedStreamRegistry.java
index c27f2b0b517..6cfcc9909f3 100644
---
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectSharedStreamRegistry.java
+++
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectSharedStreamRegistry.java
@@ -17,27 +17,45 @@
package org.apache.ignite.internal.marshaller.optimized;
+import java.io.IOException;
+import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.util.CommonUtils;
+import org.apache.ignite.internal.util.io.GridUnsafeDataInput;
+import org.apache.ignite.internal.util.io.GridUnsafeDataOutput;
/**
- *
+ * Storage for object streams.
*/
-public class OptimizedObjectSharedStreamRegistry extends
OptimizedObjectStreamRegistry {
+class OptimizedObjectSharedStreamRegistry {
/** */
private static final ThreadLocal<StreamHolder> holders = new
ThreadLocal<>();
- /** {@inheritDoc} */
- @Override OptimizedObjectOutputStream out() {
+ /**
+ * Gets output stream.
+ *
+ * @return Object output stream.
+ * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If
thread is interrupted while trying to take holder from pool.
+ */
+ OptimizedObjectOutputStream out() {
return holder().acquireOut();
}
- /** {@inheritDoc} */
- @Override OptimizedObjectInputStream in() {
+ /**
+ * Gets input stream.
+ *
+ * @return Object input stream.
+ * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If
thread is interrupted while trying to take holder from pool.
+ */
+ OptimizedObjectInputStream in() {
return holder().acquireIn();
}
- /** {@inheritDoc} */
- @Override void closeOut(OptimizedObjectOutputStream out) {
+ /**
+ * Closes and releases output stream.
+ *
+ * @param out Object output stream.
+ */
+ void closeOut(OptimizedObjectOutputStream out) {
CommonUtils.close(out, null);
StreamHolder holder = holders.get();
@@ -46,8 +64,12 @@ public class OptimizedObjectSharedStreamRegistry extends
OptimizedObjectStreamRe
holder.releaseOut();
}
- /** {@inheritDoc} */
- @Override void closeIn(OptimizedObjectInputStream in) {
+ /**
+ * Closes and releases input stream.
+ *
+ * @param in Object input stream.
+ */
+ void closeIn(OptimizedObjectInputStream in) {
CommonUtils.close(in, null);
StreamHolder holder = holders.get();
@@ -73,6 +95,34 @@ public class OptimizedObjectSharedStreamRegistry extends
OptimizedObjectStreamRe
}
}
+ /**
+ * Creates output stream.
+ *
+ * @return Object output stream.
+ */
+ static OptimizedObjectOutputStream createOut() {
+ try {
+ return new OptimizedObjectOutputStream(new GridUnsafeDataOutput(4
* 1024));
+ }
+ catch (IOException e) {
+ throw new IgniteException("Failed to create object output
stream.", e);
+ }
+ }
+
+ /**
+ * Creates input stream.
+ *
+ * @return Object input stream.
+ */
+ static OptimizedObjectInputStream createIn() {
+ try {
+ return new OptimizedObjectInputStream(new GridUnsafeDataInput());
+ }
+ catch (IOException e) {
+ throw new IgniteException("Failed to create object input stream.",
e);
+ }
+ }
+
/**
* Gets holder from pool or thread local.
*
diff --git
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamRegistry.java
b/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamRegistry.java
deleted file mode 100644
index 158cb051e95..00000000000
---
a/modules/binary/impl/src/main/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamRegistry.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.marshaller.optimized;
-
-import java.io.IOException;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.util.io.GridUnsafeDataInput;
-import org.apache.ignite.internal.util.io.GridUnsafeDataOutput;
-
-/**
- * Storage for object streams.
- */
-abstract class OptimizedObjectStreamRegistry {
- /**
- * Gets output stream.
- *
- * @return Object output stream.
- * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If
thread is interrupted while trying to take holder from pool.
- */
- abstract OptimizedObjectOutputStream out() throws
IgniteInterruptedCheckedException;
-
- /**
- * Gets input stream.
- *
- * @return Object input stream.
- * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If
thread is interrupted while trying to take holder from pool.
- */
- abstract OptimizedObjectInputStream in() throws
IgniteInterruptedCheckedException;
-
- /**
- * Closes and releases output stream.
- *
- * @param out Object output stream.
- */
- abstract void closeOut(OptimizedObjectOutputStream out);
-
- /**
- * Closes and releases input stream.
- *
- * @param in Object input stream.
- */
- abstract void closeIn(OptimizedObjectInputStream in);
-
- /**
- * Creates output stream.
- *
- * @return Object output stream.
- */
- static OptimizedObjectOutputStream createOut() {
- try {
- return new OptimizedObjectOutputStream(new GridUnsafeDataOutput(4
* 1024));
- }
- catch (IOException e) {
- throw new IgniteException("Failed to create object output
stream.", e);
- }
- }
-
- /**
- * Creates input stream.
- *
- * @return Object input stream.
- */
- static OptimizedObjectInputStream createIn() {
- try {
- return new OptimizedObjectInputStream(new GridUnsafeDataInput());
- }
- catch (IOException e) {
- throw new IgniteException("Failed to create object input stream.",
e);
- }
- }
-}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
deleted file mode 100644
index 15223c9eb6a..00000000000
---
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.marshaller.optimized;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.Marshallers;
-import org.apache.ignite.testframework.junits.common.GridCommonTest;
-
-/**
- * Optimized marshaller self test.
- */
-@GridCommonTest(group = "Marshaller")
-public class OptimizedMarshallerPooledSelfTest extends
OptimizedMarshallerSelfTest {
- /** {@inheritDoc} */
- @Override protected Marshaller marshaller() throws IgniteCheckedException {
- OptimizedMarshaller m =
initTestMarshallerContext(Marshallers.optimized(false));
-
- m.setPoolSize(8);
-
- return m;
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- // Reset static registry.
- Marshallers.optimized().setPoolSize(0);
- }
-}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerTest.java
index 974efa2ee5f..290faf2f33f 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedMarshallerTest.java
@@ -53,9 +53,16 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
* @return Marshaller.
*/
private OptimizedMarshaller marshaller() {
+ return marshaller(true);
+ }
+
+ /**
+ * @return Marshaller.
+ */
+ private OptimizedMarshaller marshaller(boolean requireSer) {
ClassLoaderUtils.clearClassCache();
- OptimizedMarshaller marsh = Marshallers.optimized();
+ OptimizedMarshaller marsh = Marshallers.optimized(requireSer);
marsh.setContext(new MarshallerContextTestImpl());
@@ -69,9 +76,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testNonSerializable() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
NonSerializable outObj = marsh.unmarshal(marsh.marshal(new
NonSerializable(null)), null);
@@ -85,9 +90,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testNonSerializable1() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
byte[] bytes = marsh.marshal(new TcpDiscoveryVmIpFinder());
@@ -107,9 +110,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testNonSerializable2() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
TcpDiscoveryIpFinderAdapter ipFinder = new
TcpDiscoveryIpFinderAdapter() {
@Override public Collection<InetSocketAddress>
getRegisteredAddresses() {
@@ -141,9 +142,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testNonSerializable3() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
byte[] bytes = marsh.marshal(new TestTcpDiscoveryIpFinderAdapter());
@@ -159,9 +158,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testNonSerializable4() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
byte[] bytes = marsh.marshal(new GridMarshallerTestInheritedBean());
@@ -238,15 +235,11 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
assertNotNull(outObj1);
}
- /**
- * Tests {@link OptimizedMarshaller#setRequireSerializable(boolean)}.
- */
+ /** */
@Test
public void testRequireSerializable() {
OptimizedMarshaller marsh = marshaller();
- marsh.setRequireSerializable(true);
-
try {
marsh.marshal(new NonSerializable(null));
@@ -264,9 +257,7 @@ public class OptimizedMarshallerTest extends
GridCommonAbstractTest {
*/
@Test
public void testProxy() throws IgniteCheckedException {
- OptimizedMarshaller marsh = marshaller();
-
- marsh.setRequireSerializable(false);
+ OptimizedMarshaller marsh = marshaller(false);
SomeItf inItf = (SomeItf)Proxy.newProxyInstance(
OptimizedMarshallerTest.class.getClassLoader(), new Class[]
{SomeItf.class},
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamSelfTest.java
index b34517f6de1..fab7a38ac75 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamSelfTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/marshaller/optimized/OptimizedObjectStreamSelfTest.java
@@ -340,7 +340,7 @@ public class OptimizedObjectStreamSelfTest extends
GridCommonAbstractTest {
* @throws Exception If failed.
*/
@Test
- public void testPool() throws Exception {
+ public void testMultithreadMarshalling() throws Exception {
final TestObject obj = new TestObject();
obj.longVal = 100L;
@@ -354,22 +354,14 @@ public class OptimizedObjectStreamSelfTest extends
GridCommonAbstractTest {
final OptimizedMarshaller marsh = Marshallers.optimized();
marsh.setContext(CTX);
+ multithreaded(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ for (int i = 0; i < 50; i++)
+ assertEquals(obj, marsh.unmarshal(marsh.marshal(obj),
null));
- marsh.setPoolSize(5);
-
- try {
- multithreaded(new Callable<Object>() {
- @Override public Object call() throws Exception {
- for (int i = 0; i < 50; i++)
- assertEquals(obj, marsh.unmarshal(marsh.marshal(obj),
null));
-
- return null;
- }
- }, 20);
- }
- finally {
- marsh.setPoolSize(0);
- }
+ return null;
+ }
+ }, 20);
}
/**
@@ -1027,7 +1019,7 @@ public class OptimizedObjectStreamSelfTest extends
GridCommonAbstractTest {
*/
@Test
public void testReadToArray() throws Exception {
- OptimizedObjectStreamRegistry reg = new
OptimizedObjectSharedStreamRegistry();
+ OptimizedObjectSharedStreamRegistry reg = new
OptimizedObjectSharedStreamRegistry();
OptimizedObjectInputStream in = reg.in();
@@ -1181,7 +1173,7 @@ public class OptimizedObjectStreamSelfTest extends
GridCommonAbstractTest {
OptimizedObjectOutputStream out = null;
OptimizedObjectInputStream in = null;
- OptimizedObjectStreamRegistry reg = new
OptimizedObjectSharedStreamRegistry();
+ OptimizedObjectSharedStreamRegistry reg = new
OptimizedObjectSharedStreamRegistry();
try {
out = reg.out();
diff --git
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
index 3872d67eec6..6c53eda3ec2 100644
---
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
+++
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
@@ -20,7 +20,6 @@ package org.apache.ignite.testsuites;
import org.apache.ignite.internal.direct.DirectMarshallingMessagesTest;
import
org.apache.ignite.internal.direct.stream.DirectByteBufferStreamImplByteOrderSelfTest;
import
org.apache.ignite.internal.marshaller.optimized.OptimizedMarshallerEnumSelfTest;
-import
org.apache.ignite.internal.marshaller.optimized.OptimizedMarshallerPooledSelfTest;
import
org.apache.ignite.internal.marshaller.optimized.OptimizedMarshallerSelfTest;
import
org.apache.ignite.internal.marshaller.optimized.OptimizedMarshallerSerialPersistentFieldsSelfTest;
import org.apache.ignite.internal.marshaller.optimized.OptimizedMarshallerTest;
@@ -49,7 +48,6 @@ import org.junit.runners.Suite;
OptimizedMarshallerSerialPersistentFieldsSelfTest.class,
DirectByteBufferStreamImplByteOrderSelfTest.class,
GridHandleTableSelfTest.class,
- OptimizedMarshallerPooledSelfTest.class,
MarshallerEnumDeadlockMultiJvmTest.class,
DirectMarshallingMessagesTest.class,
ObjectInputStreamFilteringTest.class,