[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171985692
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java
 ##
 @@ -288,6 +288,13 @@ public boolean isGlobal() {
 return cluster == null || 
Constants.GLOBAL_CLUSTER.equalsIgnoreCase(cluster);
 }
 
+public String getSchemaName() {
+return getProperty()
++ "_" + getCluster()
 
 Review comment:
   done.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171985679
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java
 ##
 @@ -288,6 +288,13 @@ public boolean isGlobal() {
 return cluster == null || 
Constants.GLOBAL_CLUSTER.equalsIgnoreCase(cluster);
 }
 
+public String getSchemaName() {
+return getProperty()
++ "_" + getCluster()
 
 Review comment:
   ok, will recursively create directories as needed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171979881
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistry.java
 ##
 @@ -0,0 +1,79 @@
+/**
+ * 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.broker.service.schema;
+
+import com.google.common.base.MoreObjects;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import org.apache.pulsar.common.schema.Schema;
+import org.apache.pulsar.common.schema.SchemaVersion;
+
+public interface SchemaRegistry extends AutoCloseable {
+
+CompletableFuture getSchema(String schemaId);
+
+CompletableFuture getSchema(String schemaId, 
SchemaVersion version);
+
+CompletableFuture putSchema(String schemaId, Schema schema);
+
+CompletableFuture deleteSchema(String schemaId, String 
user);
+
+SchemaVersion versionFromBytes(byte[] version);
+
+class SchemaAndMetadata {
 
 Review comment:
   maybe that was something else. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171979540
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/schema/SchemaVersion.java
 ##
 @@ -0,0 +1,26 @@
+/**
+ * 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.common.schema;
+
+public interface SchemaVersion {
+SchemaVersion Latest = new LatestVersion();
 
 Review comment:
   are you saying you'd rather I use all caps?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171978467
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaStorage.java
 ##
 @@ -0,0 +1,83 @@
+/**
+ * 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.broker.service.schema;
+
+import com.google.common.base.MoreObjects;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import org.apache.pulsar.common.schema.SchemaVersion;
+
+public interface SchemaStorage {
+
+CompletableFuture put(String key, byte[] value);
+
+CompletableFuture get(String key, SchemaVersion version);
+
+CompletableFuture delete(String key);
+
+SchemaVersion versionFromBytes(byte[] version);
+
+void close() throws Exception;
+
+class StoredSchema {
 
 Review comment:
   I will acquiesce.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171977969
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/api/data/SchemaInfo.java
 ##
 @@ -0,0 +1,34 @@
+/**
+ * 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.common.api.data;
+
+import org.apache.pulsar.common.schema.Schema;
+import org.apache.pulsar.common.schema.SchemaVersion;
+
+public class SchemaInfo {
 
 Review comment:
   unused, deleted.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171977696
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java
 ##
 @@ -288,6 +288,13 @@ public boolean isGlobal() {
 return cluster == null || 
Constants.GLOBAL_CLUSTER.equalsIgnoreCase(cluster);
 }
 
+public String getSchemaName() {
+return getProperty()
++ "_" + getCluster()
 
 Review comment:
   zk tends to be unhappy with the '/' since it thinks I'm referencing a path, 
any other suggestions.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171977549
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/schema/SchemaVersion.java
 ##
 @@ -0,0 +1,26 @@
+/**
+ * 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.common.schema;
+
+public interface SchemaVersion {
+SchemaVersion Latest = new LatestVersion();
 
 Review comment:
   It is... since this is an interface 'public' and 'static' are unnecessary.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171977305
 
 

 ##
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/schema/Schema.java
 ##
 @@ -0,0 +1,32 @@
+/**
+ * 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.common.schema;
+
+import java.util.Map;
+import lombok.Builder;
+
+@Builder
+public class Schema {
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171977100
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryFormat.java
 ##
 @@ -0,0 +1,1373 @@
+/**
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976581
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistry.java
 ##
 @@ -0,0 +1,79 @@
+/**
+ * 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.broker.service.schema;
+
+import com.google.common.base.MoreObjects;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import org.apache.pulsar.common.schema.Schema;
+import org.apache.pulsar.common.schema.SchemaVersion;
+
+public interface SchemaRegistry extends AutoCloseable {
+
+CompletableFuture getSchema(String schemaId);
+
+CompletableFuture getSchema(String schemaId, 
SchemaVersion version);
+
+CompletableFuture putSchema(String schemaId, Schema schema);
+
+CompletableFuture deleteSchema(String schemaId, String 
user);
+
+SchemaVersion versionFromBytes(byte[] version);
+
+class SchemaAndMetadata {
 
 Review comment:
   I tried this, for some reason the AJC compiler throws a fit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976424
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Topic.java
 ##
 @@ -125,4 +126,8 @@ void updateRates(NamespaceStats nsStats, 
NamespaceBundleStats currentBundleStats
 PersistentTopicInternalStats getInternalStats();
 
 Position getLastMessageId();
+
+CompletableFuture getSchema();
 
 Review comment:
   It's not used anymore. I will delete it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976281
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Topic.java
 ##
 @@ -125,4 +126,8 @@ void updateRates(NamespaceStats nsStats, 
NamespaceBundleStats currentBundleStats
 PersistentTopicInternalStats getInternalStats();
 
 Position getLastMessageId();
+
+CompletableFuture getSchema();
 
 Review comment:
   yes, I think a name change is in oder 'getLatestSchema()'


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976281
 
 

 ##
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Topic.java
 ##
 @@ -125,4 +126,8 @@ void updateRates(NamespaceStats nsStats, 
NamespaceBundleStats currentBundleStats
 PersistentTopicInternalStats getInternalStats();
 
 Position getLastMessageId();
+
+CompletableFuture getSchema();
 
 Review comment:
   yes, I think a name change is in oder 'getLatestSchema()'


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976063
 
 

 ##
 File path: pulsar-broker/pom.xml
 ##
 @@ -54,6 +54,12 @@
   netty-all
 
 
+
+  com.google.protobuf
+  protobuf-java
+  2.4.1
 
 Review comment:
   it's been removed. I added it back.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] mgodave commented on a change in pull request #1319: Schema registry (2/N)

2018-03-02 Thread GitBox
mgodave commented on a change in pull request #1319: Schema registry (2/N)
URL: https://github.com/apache/incubator-pulsar/pull/1319#discussion_r171976063
 
 

 ##
 File path: pulsar-broker/pom.xml
 ##
 @@ -54,6 +54,12 @@
   netty-all
 
 
+
+  com.google.protobuf
+  protobuf-java
+  2.4.1
 
 Review comment:
   it's been removed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services