You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/27 13:22:26 UTC
[GitHub] [pulsar] eolivelli opened a new pull request #10057: Implement PulsarObject - Allow GenericRecord to wrap any Java Object
eolivelli opened a new pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057
This is a draft.
Contents:
- allow AutoConsumeSchema to deal with every Schema type
- in case of non Struct schema, like for primitives, wrap the result into a PrimiteRecord class
- introduce new high level interface PulsarObject, that does not expose all of the fields of GenericRecord like getFields() that are supposed to work only for Structs
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] jerrypeng commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
jerrypeng commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603667095
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericRecord.java
##########
@@ -82,7 +83,8 @@ default SchemaType getSchemaType() {
* @return the internal representation of the record
* @throws UnsupportedOperationException if the operation is not supported
*/
- default Object getNativeRecord() {
+ @Override
+ default Object getNativeObject() {
Review comment:
This is a BC break change to an API that is already marked as stable. Why do we need to change the name?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603471459
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
Would it be useful to use generics here so that code using this API wouldn't need to use casts that require suppressing warnings?
something like:
```
<T> T getNativeObject(Class<T> objectType);
```
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r604271884
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
Review comment:
done
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603801345
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/PrimitiveRecord.java
##########
@@ -0,0 +1,90 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class PrimitiveRecord implements GenericRecord {
Review comment:
@jerrypeng good point
I have now renamed this class to GenericObjectWrapper
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r604272190
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
+ return new GenericObjectWrapper(nativeRecord, schemaType);
+ }
+
+ private GenericObjectWrapper(Object nativeObject, SchemaType schemaType) {
+ this.nativeObject = nativeObject;
+ this.schemaType = Objects.requireNonNull(schemaType, "SchemaType is required");
+ }
+
+ @Override
+ public byte[] getSchemaVersion() {
+ return null;
Review comment:
done
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
+ return new GenericObjectWrapper(nativeRecord, schemaType);
+ }
+
+ private GenericObjectWrapper(Object nativeObject, SchemaType schemaType) {
+ this.nativeObject = nativeObject;
+ this.schemaType = Objects.requireNonNull(schemaType, "SchemaType is required");
+ }
+
+ @Override
+ public byte[] getSchemaVersion() {
+ return null;
+ }
+
+ @Override
+ public List<Field> getFields() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public Object getField(String fieldName) {
+ return null;
+ }
+
+ @Override
+ public SchemaType getSchemaType() {
+ return schemaType;
+ }
+
+ @Override
+ public Object getNativeObject() {
+ return nativeObject;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toString(nativeObject);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(nativeObject);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (! (other instanceof GenericObjectWrapper)) {
Review comment:
done
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603778958
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
> anyway the user has to use "instanceof" and/or make a cast in order to use the result.
How come? Isn't that the reason to have the type parameter so that there would be no need for instanceof or casting? The expected type could be detected based on the enum from `SchemaType getSchemaType()`. No?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603801134
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericRecord.java
##########
@@ -82,7 +83,8 @@ default SchemaType getSchemaType() {
* @return the internal representation of the record
* @throws UnsupportedOperationException if the operation is not supported
*/
- default Object getNativeRecord() {
+ @Override
+ default Object getNativeObject() {
Review comment:
@jerrypeng this is a new method introduced a couple of weeks ago with https://github.com/apache/pulsar/pull/9614
we are free to change it now, and it is better to do it now, that we have not released 2.8 yet
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603495524
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
That was my initial proposal when I send the getNativeRecord patch.
In the end we decided (with @sijie ) to not add this additional parameter because anyway the user has to use "instanceof" and/or make a cast in order to use the 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] jerrypeng commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
jerrypeng commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r607404694
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
Review comment:
Is there a reason why we need this interface as all. Shouldn't having these additional methods in `GenericRecord` suffice?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603800796
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
@lhotari please check this discussion with @sijie on the PR that introduced getNativeRecord a couple of weeks ago
https://github.com/apache/pulsar/pull/9614#discussion_r589185278
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603843848
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
@eolivelli It's fine for me. I'll open a separate issue once this PR is merged.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r608490891
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
Review comment:
@jerrypeng
the idea is to let users user "GenericObject" instead of GenericRecord while dealing with "Any object", on the Consumer/Sink side, because GenericRecord for many users is related to a Struct type (like AVRO GenericRecord), and it carries "getFields()"
`If so, can you write some tests that has consumers / producers that uses this new type of Schema?`
I added tests about GenericObjectWrapper.
The main goal is to have Sink<GenericObject> and having the ability to write Sinks that are not bound to a specific Schema at compile time.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] jerrypeng commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
jerrypeng commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603670059
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/PrimitiveRecord.java
##########
@@ -0,0 +1,90 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class PrimitiveRecord implements GenericRecord {
Review comment:
I think the naming of the class can be misleading. A primitive in java is a int, byte, long, etc. It seems like the purpose of this class is to represent a generic object as a record.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] jerrypeng commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
jerrypeng commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r607403128
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
Review comment:
Is this interface suppose to be used as a schema type for producers or consumers, .e.g. Consumer<GenericObject> ? If so, can you write some tests that has consumers / producers that uses this new type of Schema?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603840952
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
@lhotari we can move this discussion in a separate issue, this patch is only about introducing GenericObject.
I am renaming the method only for consistency, because now that method may return any Java object
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r604271976
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
Review comment:
moved to the impl package, good idea
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r603826955
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObject.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.schema.SchemaType;
+
+/**
+ * This is an abstraction over the logical value that is store into a Message.
+ * Pulsar decodes the payload of the Message using the Schema that is configured for the topic.
+ */
+public interface GenericObject {
+
+ /**
+ * Return the schema tyoe.
+ *
+ * @return the schema type
+ * @throws UnsupportedOperationException if this feature is not implemented
+ * @see SchemaType#BYTES when the topic has no schema information
+ * @see SchemaType#STRING
+ * @see SchemaType#AVRO
+ * @see SchemaType#PROTOBUF_NATIVE
+ * @see SchemaType#JSON
+ */
+ SchemaType getSchemaType();
+
+ /**
+ * Return the internal native representation of the Object,
+ * like a AVRO GenericRecord, a String or a byte[].
+ *
+ * @return the decoded object
+ * @throws UnsupportedOperationException if the operation is not supported
+ */
+ Object getNativeObject();
Review comment:
@sijie I checked the discussion that @eolivelli [is referring to](https://github.com/apache/pulsar/pull/9614#discussion_r589185278).
I believe it's a common solution to have API methods such as `<T> T getNativeObject(Class<T> objectType)` .
For example, Jackson uses a similar solution, there is [`public <T> T readValue(String content, Class<T> valueType)` method in `ObjectMapper`](https://github.com/FasterXML/jackson-databind/blob/28862205ea6d17ae371a057cea07280ccea6416e/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java#L1545).
Isn't this also the style of Flink Java APIs? (/cc @addisonj)
WDYT?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#issuecomment-811711869
@sijie CI passed.
can you please take a look again ?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] sijie commented on a change in pull request #10057: Implement GenericObject - Allow GenericRecord to wrap any Java Object
Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #10057:
URL: https://github.com/apache/pulsar/pull/10057#discussion_r604222369
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
+ return new GenericObjectWrapper(nativeRecord, schemaType);
+ }
+
+ private GenericObjectWrapper(Object nativeObject, SchemaType schemaType) {
+ this.nativeObject = nativeObject;
+ this.schemaType = Objects.requireNonNull(schemaType, "SchemaType is required");
+ }
+
+ @Override
+ public byte[] getSchemaVersion() {
+ return null;
Review comment:
why does this return `null`? If the message has a schema, it should have a schema version, correct?
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
Review comment:
```suggestion
public static GenericObjectWrapper of(Object nativeObject, SchemaType schemaType) {
```
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public class GenericObjectWrapper implements GenericRecord {
+
+ private final Object nativeObject;
+ private final SchemaType schemaType;
+
+ public static GenericObjectWrapper of(Object nativeRecord, SchemaType schemaType) {
+ return new GenericObjectWrapper(nativeRecord, schemaType);
+ }
+
+ private GenericObjectWrapper(Object nativeObject, SchemaType schemaType) {
+ this.nativeObject = nativeObject;
+ this.schemaType = Objects.requireNonNull(schemaType, "SchemaType is required");
+ }
+
+ @Override
+ public byte[] getSchemaVersion() {
+ return null;
+ }
+
+ @Override
+ public List<Field> getFields() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public Object getField(String fieldName) {
+ return null;
+ }
+
+ @Override
+ public SchemaType getSchemaType() {
+ return schemaType;
+ }
+
+ @Override
+ public Object getNativeObject() {
+ return nativeObject;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toString(nativeObject);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(nativeObject);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (! (other instanceof GenericObjectWrapper)) {
Review comment:
```suggestion
if (!(other instanceof GenericObjectWrapper)) {
```
##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/GenericObjectWrapper.java
##########
@@ -0,0 +1,92 @@
+/**
+ * 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.pulsar.client.api.schema;
+
+import org.apache.pulsar.common.classification.InterfaceAudience;
+import org.apache.pulsar.common.classification.InterfaceStability;
+import org.apache.pulsar.common.schema.SchemaType;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * An interface represents a message with schema for non Struct types.
+ */
+@InterfaceAudience.Private
Review comment:
If this would be `Private`, why can't you add it to the implementation package?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org