You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/01/18 15:58:43 UTC
[GitHub] [ignite-3] rpuch opened a new pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
rpuch opened a new pull request #564:
URL: https://github.com/apache/ignite-3/pull/564
https://issues.apache.org/jira/browse/IGNITE-16258
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] SammyVimes merged pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
Posted by GitBox <gi...@apache.org>.
SammyVimes merged pull request #564:
URL: https://github.com/apache/ignite-3/pull/564
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] SammyVimes commented on a change in pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
Posted by GitBox <gi...@apache.org>.
SammyVimes commented on a change in pull request #564:
URL: https://github.com/apache/ignite-3/pull/564#discussion_r787556330
##########
File path: modules/network/src/main/java/org/apache/ignite/internal/network/serialization/marshal/Classes.java
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.network.serialization.marshal;
+
+import java.io.Serializable;
+
+/**
+ * Utilities to work with classes.
+ */
+class Classes {
+ static boolean isSerializable(Class<?> objectClass) {
+ return Serializable.class.isAssignableFrom(objectClass);
+ }
+
+ static boolean isLambda(Class<?> objectClass) {
+ return objectClass.getSimpleName().contains("$$Lambda$") && objectClass.isSynthetic()
Review comment:
I wonder if this "$$Lambda$" is JVM specific
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] rpuch commented on a change in pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
Posted by GitBox <gi...@apache.org>.
rpuch commented on a change in pull request #564:
URL: https://github.com/apache/ignite-3/pull/564#discussion_r787608757
##########
File path: modules/network/src/main/java/org/apache/ignite/internal/network/serialization/marshal/Classes.java
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.network.serialization.marshal;
+
+import java.io.Serializable;
+
+/**
+ * Utilities to work with classes.
+ */
+class Classes {
+ static boolean isSerializable(Class<?> objectClass) {
+ return Serializable.class.isAssignableFrom(objectClass);
+ }
+
+ static boolean isLambda(Class<?> objectClass) {
+ return objectClass.getSimpleName().contains("$$Lambda$") && objectClass.isSynthetic()
Review comment:
Yes, it's JVM specific. Actually, when checking for a lambda here, we actually want to know that the class cannot be loaded by name, so it makes sense to check this property directly.
Reworked the fix to detect whether we can load the class by name (and that it's not a primitive or an array); along with `isSynthetic()` it should yield the correct result.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] rpuch commented on pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
Posted by GitBox <gi...@apache.org>.
rpuch commented on pull request #564:
URL: https://github.com/apache/ignite-3/pull/564#issuecomment-1016292459
@semyon Indeed, sorry for that :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] semyon commented on pull request #564: IGNITE-16258 Support Serializable lambdas marshalling in User Object Serialization
Posted by GitBox <gi...@apache.org>.
semyon commented on pull request #564:
URL: https://github.com/apache/ignite-3/pull/564#issuecomment-1016284972
Gentlemen, I think you've tagged a wrong Semyon :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org