You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2025/06/13 11:22:29 UTC

[PR] tidy up metrics exchange [pekko]

pjfanning opened a new pull request, #1899:
URL: https://github.com/apache/pekko/pull/1899

   small adjustments in pekko-cluster-metrics code


-- 
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@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] tidy up metrics exchange [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1899:
URL: https://github.com/apache/pekko/pull/1899#discussion_r2145139188


##########
cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.pekko.cluster.metrics.protobuf
+
+import java.io.{ InputStream, ObjectInputStream, ObjectStreamClass }
+
+import org.apache.pekko
+import pekko.annotation.InternalApi
+
+/**
+ * A special ObjectInputStream that loads will only load built-in primitives or
+ * Number classes.
+ * <p>
+ * This is for internal Pekko use only, and is not intended for public use.
+ * </p>
+ */
+@InternalApi
+private[protobuf] class NumberInputStream(inputStream: InputStream) extends ObjectInputStream(inputStream) {
+
+  private val Loader = classOf[NumberInputStream].getClassLoader()

Review Comment:
   I've changed the code to use the  system.dynamicAccess.classLoader



-- 
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@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] tidy up metrics exchange [pekko]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #1899:
URL: https://github.com/apache/pekko/pull/1899#discussion_r2144875817


##########
cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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
+ *
+ *      https://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.pekko.cluster.metrics.protobuf
+
+import java.io.{
+  InputStream,
+  ObjectInputStream,
+  ObjectStreamClass
+}
+
+/**
+ * A special ObjectInputStream that loads will only load built-in primitives or
+ * Number classes.
+ * <p>
+ * This is for internal Pekko use only, and is not intended for public use.

Review Comment:
   Maybe mark it `@InternalApi`?



-- 
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@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] tidy up metrics exchange [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1899:
URL: https://github.com/apache/pekko/pull/1899#discussion_r2145045876


##########
cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/NumberInputStream.scala:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.pekko.cluster.metrics.protobuf
+
+import java.io.{ InputStream, ObjectInputStream, ObjectStreamClass }
+
+import org.apache.pekko
+import pekko.annotation.InternalApi
+
+/**
+ * A special ObjectInputStream that loads will only load built-in primitives or
+ * Number classes.
+ * <p>
+ * This is for internal Pekko use only, and is not intended for public use.
+ * </p>
+ */
+@InternalApi
+private[protobuf] class NumberInputStream(inputStream: InputStream) extends ObjectInputStream(inputStream) {
+
+  private val Loader = classOf[NumberInputStream].getClassLoader()

Review Comment:
   Why we can't use the `system.dynamicAccess.classLoader` here?



-- 
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@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] tidy up metrics exchange [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1899:
URL: https://github.com/apache/pekko/pull/1899


-- 
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@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org