[36/50] [abbrv] hive git commit: HIVE-17990 Add Thrift and DB storage for Schema Registry objects
http://git-wip-us.apache.org/repos/asf/hive/blob/a9e1acaf/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py -- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index 5598859..ea9da89 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -211,6 +211,100 @@ class EventRequestType: "DELETE": 3, } +class SerdeType: + HIVE = 1 + SCHEMA_REGISTRY = 2 + + _VALUES_TO_NAMES = { +1: "HIVE", +2: "SCHEMA_REGISTRY", + } + + _NAMES_TO_VALUES = { +"HIVE": 1, +"SCHEMA_REGISTRY": 2, + } + +class SchemaType: + HIVE = 1 + AVRO = 2 + + _VALUES_TO_NAMES = { +1: "HIVE", +2: "AVRO", + } + + _NAMES_TO_VALUES = { +"HIVE": 1, +"AVRO": 2, + } + +class SchemaCompatibility: + NONE = 1 + BACKWARD = 2 + FORWARD = 3 + BOTH = 4 + + _VALUES_TO_NAMES = { +1: "NONE", +2: "BACKWARD", +3: "FORWARD", +4: "BOTH", + } + + _NAMES_TO_VALUES = { +"NONE": 1, +"BACKWARD": 2, +"FORWARD": 3, +"BOTH": 4, + } + +class SchemaValidation: + LATEST = 1 + ALL = 2 + + _VALUES_TO_NAMES = { +1: "LATEST", +2: "ALL", + } + + _NAMES_TO_VALUES = { +"LATEST": 1, +"ALL": 2, + } + +class SchemaVersionState: + INITIATED = 1 + START_REVIEW = 2 + CHANGES_REQUIRED = 3 + REVIEWED = 4 + ENABLED = 5 + DISABLED = 6 + ARCHIVED = 7 + DELETED = 8 + + _VALUES_TO_NAMES = { +1: "INITIATED", +2: "START_REVIEW", +3: "CHANGES_REQUIRED", +4: "REVIEWED", +5: "ENABLED", +6: "DISABLED", +7: "ARCHIVED", +8: "DELETED", + } + + _NAMES_TO_VALUES = { +"INITIATED": 1, +"START_REVIEW": 2, +"CHANGES_REQUIRED": 3, +"REVIEWED": 4, +"ENABLED": 5, +"DISABLED": 6, +"ARCHIVED": 7, +"DELETED": 8, + } + class FunctionType: JAVA = 1 @@ -2897,6 +2991,10 @@ class SerDeInfo: - name - serializationLib - parameters + - description + - serializerClass + - deserializerClass + - serdeType """ thrift_spec = ( @@ -2904,12 +3002,20 @@ class SerDeInfo: (1, TType.STRING, 'name', None, None, ), # 1 (2, TType.STRING, 'serializationLib', None, None, ), # 2 (3, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 3 +(4, TType.STRING, 'description', None, None, ), # 4 +(5, TType.STRING, 'serializerClass', None, None, ), # 5 +(6, TType.STRING, 'deserializerClass', None, None, ), # 6 +(7, TType.I32, 'serdeType', None, None, ), # 7 ) - def __init__(self, name=None, serializationLib=None, parameters=None,): + def __init__(self, name=None, serializationLib=None, parameters=None, description=None, serializerClass=None, deserializerClass=None, serdeType=None,): self.name = name self.serializationLib = serializationLib self.parameters = parameters +self.description = description +self.serializerClass = serializerClass +self.deserializerClass = deserializerClass +self.serdeType = serdeType def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -2941,6 +3047,26 @@ class SerDeInfo: iprot.readMapEnd() else: iprot.skip(ftype) + elif fid == 4: +if ftype == TType.STRING: + self.description = iprot.readString() +else: + iprot.skip(ftype) + elif fid == 5: +if ftype == TType.STRING: + self.serializerClass = iprot.readString() +else: + iprot.skip(ftype) + elif fid == 6: +if ftype == TType.STRING: + self.deserializerClass = iprot.readString() +else: + iprot.skip(ftype) + elif fid == 7: +if ftype == TType.I32: + self.serdeType = iprot.readI32() +else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2967,6 +3093,22 @@ class SerDeInfo: oprot.writeString(viter100) oprot.writeMapEnd() oprot.writeFieldEnd() +if self.description is not None: + oprot.writeFieldBegin('description', TType.STRING, 4) + oprot.writeString(self.description) + oprot.writeFieldEnd() +if self.serializerClass is not None: + oprot.writeFieldBegin('serializerClass', TType.STRING, 5) + oprot.writeString(self.serializerClass) + oprot.writeFieldEnd() +if self.deserializerClass is not None: + oprot.writeFieldBegin('deserializerClass', TType.STRING, 6) + oprot.writeString(self.deserializerClass) + oprot.writeFieldEnd() +if self.serdeType is not None: + oprot.writeFieldBegin('serdeType', TType.I32, 7) +
[36/50] [abbrv] hive git commit: HIVE-17990 Add Thrift and DB storage for Schema Registry objects
http://git-wip-us.apache.org/repos/asf/hive/blob/b3cb8526/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java new file mode 100644 index 000..3df3780 --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java @@ -0,0 +1,44 @@ +/* + * 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.hadoop.hive.metastore.events; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hive.metastore.IHMSHandler; +import org.apache.hadoop.hive.metastore.api.ISchema; + +@InterfaceAudience.Public +@InterfaceStability.Stable +public class PreAlterISchemaEvent extends PreEventContext { + + private final ISchema oldSchema, newSchema; + + public PreAlterISchemaEvent(IHMSHandler handler, ISchema oldSchema, ISchema newSchema) { +super(PreEventType.ALTER_ISCHEMA, handler); +this.oldSchema = oldSchema; +this.newSchema = newSchema; + } + + public ISchema getOldSchema() { +return oldSchema; + } + + public ISchema getNewSchema() { +return newSchema; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/b3cb8526/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java new file mode 100644 index 000..63ddb3b --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java @@ -0,0 +1,45 @@ +/* + * 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.hadoop.hive.metastore.events; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hive.metastore.IHMSHandler; +import org.apache.hadoop.hive.metastore.api.SchemaVersion; + +@InterfaceAudience.Public +@InterfaceStability.Stable +public class PreAlterSchemaVersionEvent extends PreEventContext { + + private final SchemaVersion oldSchemaVersion, newSchemaVersion; + + public PreAlterSchemaVersionEvent(IHMSHandler handler, SchemaVersion oldSchemaVersion, +SchemaVersion newSchemaVersion) { +super(PreEventType.ALTER_SCHEMA_VERSION, handler); +this.oldSchemaVersion = oldSchemaVersion; +this.newSchemaVersion = newSchemaVersion; + } + + public SchemaVersion getOldSchemaVersion() { +return oldSchemaVersion; + } + + public SchemaVersion getNewSchemaVersion() { +return newSchemaVersion; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/b3cb8526/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreCreateISchemaEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop
[36/50] [abbrv] hive git commit: HIVE-17990 Add Thrift and DB storage for Schema Registry objects
http://git-wip-us.apache.org/repos/asf/hive/blob/bd212257/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java new file mode 100644 index 000..3df3780 --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterISchemaEvent.java @@ -0,0 +1,44 @@ +/* + * 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.hadoop.hive.metastore.events; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hive.metastore.IHMSHandler; +import org.apache.hadoop.hive.metastore.api.ISchema; + +@InterfaceAudience.Public +@InterfaceStability.Stable +public class PreAlterISchemaEvent extends PreEventContext { + + private final ISchema oldSchema, newSchema; + + public PreAlterISchemaEvent(IHMSHandler handler, ISchema oldSchema, ISchema newSchema) { +super(PreEventType.ALTER_ISCHEMA, handler); +this.oldSchema = oldSchema; +this.newSchema = newSchema; + } + + public ISchema getOldSchema() { +return oldSchema; + } + + public ISchema getNewSchema() { +return newSchema; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/bd212257/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java new file mode 100644 index 000..63ddb3b --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterSchemaVersionEvent.java @@ -0,0 +1,45 @@ +/* + * 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.hadoop.hive.metastore.events; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hive.metastore.IHMSHandler; +import org.apache.hadoop.hive.metastore.api.SchemaVersion; + +@InterfaceAudience.Public +@InterfaceStability.Stable +public class PreAlterSchemaVersionEvent extends PreEventContext { + + private final SchemaVersion oldSchemaVersion, newSchemaVersion; + + public PreAlterSchemaVersionEvent(IHMSHandler handler, SchemaVersion oldSchemaVersion, +SchemaVersion newSchemaVersion) { +super(PreEventType.ALTER_SCHEMA_VERSION, handler); +this.oldSchemaVersion = oldSchemaVersion; +this.newSchemaVersion = newSchemaVersion; + } + + public SchemaVersion getOldSchemaVersion() { +return oldSchemaVersion; + } + + public SchemaVersion getNewSchemaVersion() { +return newSchemaVersion; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/bd212257/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/PreCreateISchemaEvent.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop