You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vi...@apache.org on 2018/07/19 19:55:24 UTC
[25/51] [partial] hive git commit: HIVE-20188 : Split server-specific
code outside of standalone metastore-common (Alexander Kolbasov reviewed by
Vihang Karajgaonkar)
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadTableEvent.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadTableEvent.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadTableEvent.java
deleted file mode 100644
index beec72b..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadTableEvent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.Table;
-
-/**
- * Table read event
- */
-@InterfaceAudience.Public
-@InterfaceStability.Stable
-public class PreReadTableEvent extends PreEventContext {
-
- private final Table table;
-
- public PreReadTableEvent(Table table, IHMSHandler handler) {
- super(PreEventType.READ_TABLE, handler);
- this.table = table;
- }
-
- /**
- * @return the table
- */
- public Table getTable() {
- return table;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadhSchemaVersionEvent.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadhSchemaVersionEvent.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadhSchemaVersionEvent.java
deleted file mode 100644
index fbe4879..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/events/PreReadhSchemaVersionEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.hive.metastore.IHMSHandler;
-import org.apache.hadoop.hive.metastore.api.SchemaVersion;
-
-import java.util.List;
-
-public class PreReadhSchemaVersionEvent extends PreEventContext {
- private final List<SchemaVersion> schemaVersions;
-
- public PreReadhSchemaVersionEvent(IHMSHandler handler, List<SchemaVersion> schemaVersions) {
- super(PreEventType.READ_SCHEMA_VERSION, handler);
- this.schemaVersions = schemaVersions;
- }
-
- public List<SchemaVersion> getSchemaVersions() {
- return schemaVersions;
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/hooks/JDOConnectionURLHook.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/hooks/JDOConnectionURLHook.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/hooks/JDOConnectionURLHook.java
deleted file mode 100644
index eefb505..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/hooks/JDOConnectionURLHook.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.hooks;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.classification.InterfaceStability;
-import org.apache.hadoop.conf.Configuration;
-
-/**
- * JDOConnectURLHook is used to get the URL that JDO uses to connect to the
- * database that stores the metastore data. Classes implementing this must be
- * thread-safe (for Thrift server).
- */
-@InterfaceAudience.Public
-@InterfaceStability.Stable
-public interface JDOConnectionURLHook {
-
- /**
- * Gets the connection URL to supply to JDO. In addition to initialization,
- * this method will be called after a connection failure for each reconnect
- * attempt.
- *
- * @param conf The configuration used to initialize this instance of the HMS
- * @return the connection URL
- * @throws Exception
- */
- String getJdoConnectionUrl(Configuration conf) throws Exception;
-
- /**
- * Alerts this that the connection URL was bad. Can be used to collect stats,
- * etc.
- *
- * @param url
- */
- void notifyBadConnectionUrl(String url);
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AbortTxnMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AbortTxnMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AbortTxnMessage.java
deleted file mode 100644
index 1f75585..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AbortTxnMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/* * 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.messaging;
-
-/**
- * HCat message sent when an abort transaction is done.
- */
-public abstract class AbortTxnMessage extends EventMessage {
-
- protected AbortTxnMessage() {
- super(EventType.ABORT_TXN);
- }
-
- /**
- * Get the transaction id to be aborted.
- *
- * @return The TxnId
- */
- public abstract Long getTxnId();
-
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AcidWriteMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AcidWriteMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AcidWriteMessage.java
deleted file mode 100644
index e2c9ccf..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AcidWriteMessage.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.api.Table;
-import java.util.List;
-
-/**
- * HCat message sent when an ACID write is done.
- */
-public abstract class AcidWriteMessage extends EventMessage {
-
- protected AcidWriteMessage() {
- super(EventType.ACID_WRITE);
- }
-
- public abstract Long getTxnId();
-
- public abstract String getTable();
-
- public abstract Long getWriteId();
-
- public abstract String getPartition();
-
- public abstract List<String> getFiles();
-
- public abstract Table getTableObj() throws Exception;
-
- public abstract Partition getPartitionObj() throws Exception;
-
- public abstract String getTableObjStr();
-
- public abstract String getPartitionObjStr();
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddForeignKeyMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddForeignKeyMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddForeignKeyMessage.java
deleted file mode 100644
index db8a7d7..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddForeignKeyMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.messaging;
-
-import java.util.List;
-
-import org.apache.hadoop.hive.metastore.api.SQLForeignKey;
-
-public abstract class AddForeignKeyMessage extends EventMessage {
- protected AddForeignKeyMessage() {
- super(EventType.ADD_FOREIGNKEY);
- }
-
- /**
- * Getter for list of foreign keys.
- * @return List of SQLForeignKey
- */
- public abstract List<SQLForeignKey> getForeignKeys() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddNotNullConstraintMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddNotNullConstraintMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddNotNullConstraintMessage.java
deleted file mode 100644
index 07fbe64..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddNotNullConstraintMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.messaging;
-
-import java.util.List;
-
-import org.apache.hadoop.hive.metastore.api.SQLNotNullConstraint;
-
-public abstract class AddNotNullConstraintMessage extends EventMessage {
- protected AddNotNullConstraintMessage() {
- super(EventType.ADD_NOTNULLCONSTRAINT);
- }
-
- /**
- * Getter for list of not null constraints.
- * @return List of SQLNotNullConstraint
- */
- public abstract List<SQLNotNullConstraint> getNotNullConstraints() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPartitionMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPartitionMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPartitionMessage.java
deleted file mode 100644
index 3262b52..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPartitionMessage.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.api.Table;
-
-import java.util.List;
-import java.util.Map;
-
-public abstract class AddPartitionMessage extends EventMessage {
-
- protected AddPartitionMessage() {
- super(EventType.ADD_PARTITION);
- }
-
- /**
- * Getter for name of table (where partitions are added).
- * @return Table-name (String).
- */
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract Table getTableObj() throws Exception;
-
- /**
- * Getter for list of partitions added.
- * @return List of maps, where each map identifies values for each partition-key, for every added partition.
- */
- public abstract List<Map<String, String>> getPartitions ();
-
- public abstract Iterable<Partition> getPartitionObjs() throws Exception;
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null)
- throw new IllegalStateException("Table name unset.");
- if (getPartitions() == null)
- throw new IllegalStateException("Partition-list unset.");
- return super.checkValid();
- }
-
- /**
- * Get iterable of partition name and file lists created as a result of this DDL operation
- *
- * @return The iterable of partition PartitionFiles
- */
- public abstract Iterable<PartitionFiles> getPartitionFilesIter();
-
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPrimaryKeyMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPrimaryKeyMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPrimaryKeyMessage.java
deleted file mode 100644
index 37f2b46..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddPrimaryKeyMessage.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.messaging;
-
-import java.util.List;
-
-import org.apache.hadoop.hive.metastore.api.SQLPrimaryKey;
-
-public abstract class AddPrimaryKeyMessage extends EventMessage {
- protected AddPrimaryKeyMessage() {
- super(EventType.ADD_PRIMARYKEY);
- }
-
- /**
- * Getter for list of primary keys.
- * @return List of SQLPrimaryKey
- */
- public abstract List<SQLPrimaryKey> getPrimaryKeys() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddUniqueConstraintMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddUniqueConstraintMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddUniqueConstraintMessage.java
deleted file mode 100644
index 5c71f22..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AddUniqueConstraintMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.messaging;
-
-import java.util.List;
-
-import org.apache.hadoop.hive.metastore.api.SQLUniqueConstraint;
-
-public abstract class AddUniqueConstraintMessage extends EventMessage {
- protected AddUniqueConstraintMessage() {
- super(EventType.ADD_UNIQUECONSTRAINT);
- }
-
- /**
- * Getter for list of unique constraints.
- * @return List of SQLUniqueConstraint
- */
- public abstract List<SQLUniqueConstraint> getUniqueConstraints() throws Exception;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AllocWriteIdMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AllocWriteIdMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AllocWriteIdMessage.java
deleted file mode 100644
index 0766d02..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AllocWriteIdMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.TxnToWriteId;
-
-import java.util.List;
-
-/**
- * HCat message sent when an alloc write id is done.
- */
-public abstract class AllocWriteIdMessage extends EventMessage {
- protected AllocWriteIdMessage() {
- super(EventType.ALLOC_WRITE_ID);
- }
-
- public abstract String getTableName();
-
- public abstract List<TxnToWriteId> getTxnToWriteIdList();
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterCatalogMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterCatalogMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterCatalogMessage.java
deleted file mode 100644
index 175d6ef..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterCatalogMessage.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Catalog;
-
-public abstract class AlterCatalogMessage extends EventMessage {
- protected AlterCatalogMessage() {
- super(EventType.ALTER_CATALOG);
- }
-
- public abstract Catalog getCatObjBefore() throws Exception;
- public abstract Catalog getCatObjAfter() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterDatabaseMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterDatabaseMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterDatabaseMessage.java
deleted file mode 100644
index 07a18bc..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterDatabaseMessage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Database;
-
-/**
- * AlterDatabaseMessage.
- * Abstract class to store the Alter database message
- */
-public abstract class AlterDatabaseMessage extends EventMessage {
-
- protected AlterDatabaseMessage() {
- super(EventType.ALTER_DATABASE);
- }
-
- public abstract Database getDbObjBefore() throws Exception;
- public abstract Database getDbObjAfter() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterPartitionMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterPartitionMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterPartitionMessage.java
deleted file mode 100644
index aaa7ef5..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterPartitionMessage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.api.Table;
-
-import java.util.Map;
-
-public abstract class AlterPartitionMessage extends EventMessage {
-
- protected AlterPartitionMessage() {
- super(EventType.ALTER_PARTITION);
- }
-
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract boolean getIsTruncateOp();
-
- public abstract Map<String,String> getKeyValues();
-
- public abstract Table getTableObj() throws Exception;
-
- public abstract Partition getPtnObjBefore() throws Exception;
-
- public abstract Partition getPtnObjAfter() throws Exception;
- @Override
- public EventMessage checkValid() {
- if (getTable() == null) throw new IllegalStateException("Table name unset.");
- if (getKeyValues() == null) throw new IllegalStateException("Partition values unset");
- try {
- if (getTableObj() == null){
- throw new IllegalStateException("Table object not set.");
- }
- if (getPtnObjAfter() == null){
- throw new IllegalStateException("Partition object(after) not set.");
- }
- if (getPtnObjBefore() == null){
- throw new IllegalStateException("Partition object(before) not set.");
- }
- } catch (Exception e) {
- if (! (e instanceof IllegalStateException)){
- throw new IllegalStateException("Event not set up correctly",e);
- } else {
- throw (IllegalStateException) e;
- }
- }
- return super.checkValid();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterTableMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterTableMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterTableMessage.java
deleted file mode 100644
index 30e2862..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/AlterTableMessage.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Table;
-
-public abstract class AlterTableMessage extends EventMessage {
-
- protected AlterTableMessage() {
- super(EventType.ALTER_TABLE);
- }
-
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract boolean getIsTruncateOp();
-
- public abstract Table getTableObjBefore() throws Exception;
-
- public abstract Table getTableObjAfter() throws Exception;
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null) throw new IllegalStateException("Table name unset.");
- try {
- if (getTableObjAfter() == null){
- throw new IllegalStateException("Table object(after) not set.");
- }
- if (getTableObjBefore() == null){
- throw new IllegalStateException("Table object(before) not set.");
- }
- } catch (Exception e) {
- if (! (e instanceof IllegalStateException)){
- throw new IllegalStateException("Event not set up correctly",e);
- } else {
- throw (IllegalStateException) e;
- }
- }
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CommitTxnMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CommitTxnMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CommitTxnMessage.java
deleted file mode 100644
index 9733039..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CommitTxnMessage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.hadoop.hive.metastore.api.WriteEventInfo;
-
-import java.util.List;
-
-/**
- * HCat message sent when an commit transaction is done.
- */
-public abstract class CommitTxnMessage extends EventMessage {
-
- protected CommitTxnMessage() {
- super(EventType.COMMIT_TXN);
- }
-
- /**
- * Get the transaction id to be committed.
- *
- * @return The TxnId
- */
- public abstract Long getTxnId();
-
- public abstract List<Long> getWriteIds();
-
- public abstract List<String> getDatabases();
-
- public abstract List<String> getTables();
-
- public abstract List<String> getPartitions();
-
- public abstract Table getTableObj(int idx) throws Exception;
-
- public abstract Partition getPartitionObj(int idx) throws Exception;
-
- public abstract String getFiles(int idx);
-
- public abstract List<String> getFilesList();
-
- public abstract void addWriteEventInfo(List<WriteEventInfo> writeEventInfoList);
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateCatalogMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateCatalogMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateCatalogMessage.java
deleted file mode 100644
index cbb0f4e..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateCatalogMessage.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.messaging;
-
-public abstract class CreateCatalogMessage extends EventMessage {
-
- protected CreateCatalogMessage() {
- super(EventType.CREATE_CATALOG);
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateDatabaseMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateDatabaseMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateDatabaseMessage.java
deleted file mode 100644
index 7cdeeda..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateDatabaseMessage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Database;
-
-public abstract class CreateDatabaseMessage extends EventMessage {
-
- protected CreateDatabaseMessage() {
- super(EventType.CREATE_DATABASE);
- }
-
- public abstract Database getDatabaseObject() throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateFunctionMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateFunctionMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateFunctionMessage.java
deleted file mode 100644
index 5478143..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateFunctionMessage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Function;
-
-public abstract class CreateFunctionMessage extends EventMessage {
-
- protected CreateFunctionMessage() {
- super(EventType.CREATE_FUNCTION);
- }
-
- public abstract Function getFunctionObj() throws Exception;
-
- @Override
- public EventMessage checkValid() {
- try {
- if (getFunctionObj() == null)
- throw new IllegalStateException("Function object unset.");
- } catch (Exception e) {
- if (! (e instanceof IllegalStateException)){
- throw new IllegalStateException("Event not set up correctly", e);
- } else {
- throw (IllegalStateException) e;
- }
- }
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateTableMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateTableMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateTableMessage.java
deleted file mode 100644
index 49732ff..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/CreateTableMessage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Table;
-
-public abstract class CreateTableMessage extends EventMessage {
-
- protected CreateTableMessage() {
- super(EventType.CREATE_TABLE);
- }
-
- /**
- * Getter for the name of table created
- * @return Table-name (String).
- */
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract Table getTableObj() throws Exception;
-
- /**
- * Get list of files created as a result of this DML operation
- *
- * @return The iterable of files
- */
- public abstract Iterable<String> getFiles();
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null)
- throw new IllegalStateException("Table name unset.");
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropCatalogMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropCatalogMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropCatalogMessage.java
deleted file mode 100644
index 0e731ce..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropCatalogMessage.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.messaging;
-
-public abstract class DropCatalogMessage extends EventMessage {
-
- protected DropCatalogMessage() {
- super(EventType.DROP_CATALOG);
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropConstraintMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropConstraintMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropConstraintMessage.java
deleted file mode 100644
index 95c9f9f..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropConstraintMessage.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.messaging;
-
-public abstract class DropConstraintMessage extends EventMessage {
- protected DropConstraintMessage() {
- super(EventType.DROP_CONSTRAINT);
- }
-
- public abstract String getTable();
-
- public abstract String getConstraint();
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropDatabaseMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropDatabaseMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropDatabaseMessage.java
deleted file mode 100644
index a450d47..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropDatabaseMessage.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.messaging;
-
-public abstract class DropDatabaseMessage extends EventMessage {
-
- protected DropDatabaseMessage() {
- super(EventType.DROP_DATABASE);
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropFunctionMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropFunctionMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropFunctionMessage.java
deleted file mode 100644
index c418feb..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropFunctionMessage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.messaging;
-
-public abstract class DropFunctionMessage extends EventMessage {
-
- public abstract String getFunctionName();
-
- protected DropFunctionMessage() {
- super(EventType.DROP_FUNCTION);
- }
-
- @Override
- public EventMessage checkValid() {
- if (getFunctionName() == null){
- throw new IllegalStateException("Function name unset.");
- }
- return super.checkValid();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropPartitionMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropPartitionMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropPartitionMessage.java
deleted file mode 100644
index fa7c9db..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropPartitionMessage.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.messaging;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.hadoop.hive.metastore.api.Table;
-
-public abstract class DropPartitionMessage extends EventMessage {
-
- protected DropPartitionMessage() {
- super(EventType.DROP_PARTITION);
- }
-
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract Table getTableObj() throws Exception;
-
- public abstract List<Map<String, String>> getPartitions ();
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null)
- throw new IllegalStateException("Table name unset.");
- if (getPartitions() == null)
- throw new IllegalStateException("Partition-list unset.");
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropTableMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropTableMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropTableMessage.java
deleted file mode 100644
index b8e0e78..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/DropTableMessage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Table;
-
-public abstract class DropTableMessage extends EventMessage {
-
- protected DropTableMessage() {
- super(EventType.DROP_TABLE);
- }
-
- /**
- * Getter for the name of the table being dropped.
- * @return Table-name (String).
- */
- public abstract String getTable();
-
- public abstract String getTableType();
-
- public abstract Table getTableObj() throws Exception;
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null)
- throw new IllegalStateException("Table name unset.");
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventMessage.java
deleted file mode 100644
index f24b419..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventMessage.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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.messaging;
-
-/**
- * Class representing messages emitted when Metastore operations are done.
- * (E.g. Creation and deletion of databases, tables and partitions.)
- */
-public abstract class EventMessage {
-
- /**
- * Enumeration of all supported types of Metastore operations.
- */
- public enum EventType {
-
- CREATE_DATABASE(MessageFactory.CREATE_DATABASE_EVENT),
- DROP_DATABASE(MessageFactory.DROP_DATABASE_EVENT),
- CREATE_TABLE(MessageFactory.CREATE_TABLE_EVENT),
- DROP_TABLE(MessageFactory.DROP_TABLE_EVENT),
- ADD_PARTITION(MessageFactory.ADD_PARTITION_EVENT),
- DROP_PARTITION(MessageFactory.DROP_PARTITION_EVENT),
- ALTER_DATABASE(MessageFactory.ALTER_DATABASE_EVENT),
- ALTER_TABLE(MessageFactory.ALTER_TABLE_EVENT),
- ALTER_PARTITION(MessageFactory.ALTER_PARTITION_EVENT),
- INSERT(MessageFactory.INSERT_EVENT),
- CREATE_FUNCTION(MessageFactory.CREATE_FUNCTION_EVENT),
- DROP_FUNCTION(MessageFactory.DROP_FUNCTION_EVENT),
-
- ADD_PRIMARYKEY(MessageFactory.ADD_PRIMARYKEY_EVENT),
- ADD_FOREIGNKEY(MessageFactory.ADD_FOREIGNKEY_EVENT),
- ADD_UNIQUECONSTRAINT(MessageFactory.ADD_UNIQUECONSTRAINT_EVENT),
- ADD_NOTNULLCONSTRAINT(MessageFactory.ADD_NOTNULLCONSTRAINT_EVENT),
- DROP_CONSTRAINT(MessageFactory.DROP_CONSTRAINT_EVENT),
- CREATE_ISCHEMA(MessageFactory.CREATE_ISCHEMA_EVENT),
- ALTER_ISCHEMA(MessageFactory.ALTER_ISCHEMA_EVENT),
- DROP_ISCHEMA(MessageFactory.DROP_ISCHEMA_EVENT),
- ADD_SCHEMA_VERSION(MessageFactory.ADD_SCHEMA_VERSION_EVENT),
- ALTER_SCHEMA_VERSION(MessageFactory.ALTER_SCHEMA_VERSION_EVENT),
- DROP_SCHEMA_VERSION(MessageFactory.DROP_SCHEMA_VERSION_EVENT),
- CREATE_CATALOG(MessageFactory.CREATE_CATALOG_EVENT),
- DROP_CATALOG(MessageFactory.DROP_CATALOG_EVENT),
- OPEN_TXN(MessageFactory.OPEN_TXN_EVENT),
- COMMIT_TXN(MessageFactory.COMMIT_TXN_EVENT),
- ABORT_TXN(MessageFactory.ABORT_TXN_EVENT),
- ALLOC_WRITE_ID(MessageFactory.ALLOC_WRITE_ID_EVENT),
- ALTER_CATALOG(MessageFactory.ALTER_CATALOG_EVENT),
- ACID_WRITE(MessageFactory.ACID_WRITE_EVENT);
-
- private String typeString;
-
- EventType(String typeString) {
- this.typeString = typeString;
- }
-
- @Override
- public String toString() { return typeString; }
- }
-
- protected EventType eventType;
-
- protected EventMessage(EventType eventType) {
- this.eventType = eventType;
- }
-
- public EventType getEventType() {
- return eventType;
- }
-
- /**
- * Getter for HCatalog Server's URL.
- * (This is where the event originates from.)
- * @return HCatalog Server's URL (String).
- */
- public abstract String getServer();
-
- /**
- * Getter for the Kerberos principal of the HCatalog service.
- * @return HCatalog Service Principal (String).
- */
- public abstract String getServicePrincipal();
-
- /**
- * Getter for the name of the Database on which the Metastore operation is done.
- * @return Database-name (String).
- */
- public abstract String getDB();
-
- /**
- * Getter for the timestamp associated with the operation.
- * @return Timestamp (Long - seconds since epoch).
- */
- public abstract Long getTimestamp();
-
- /**
- * Class invariant. Checked after construction or deserialization.
- */
- public EventMessage checkValid() {
- if (getServer() == null || getServicePrincipal() == null) {
- throw new IllegalStateException("Server-URL/Service-Principal shouldn't be null.");
- }
- if (getEventType() == null) {
- throw new IllegalStateException("Event-type unset.");
- }
- if (getDB() == null) {
- throw new IllegalArgumentException("DB-name unset.");
- }
-
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventUtils.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventUtils.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventUtils.java
deleted file mode 100644
index 2b16897..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/EventUtils.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.IMetaStoreClient;
-import org.apache.hadoop.hive.metastore.api.NotificationEvent;
-import org.apache.hadoop.hive.metastore.api.NotificationEventsCountRequest;
-import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
-import org.apache.hadoop.hive.metastore.messaging.event.filters.DatabaseAndTableFilter;
-import org.apache.thrift.TException;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class EventUtils {
-
- public interface NotificationFetcher {
- int getBatchSize() throws IOException;
- long getCurrentNotificationEventId() throws IOException;
- long getDbNotificationEventsCount(long fromEventId, String dbName) throws IOException;
- List<NotificationEvent> getNextNotificationEvents(
- long pos, IMetaStoreClient.NotificationFilter filter) throws IOException;
- }
-
- // MetaStoreClient-based impl of NotificationFetcher
- public static class MSClientNotificationFetcher implements NotificationFetcher{
-
- private IMetaStoreClient msc = null;
- private Integer batchSize = null;
-
- public MSClientNotificationFetcher(IMetaStoreClient msc){
- this.msc = msc;
- }
-
- @Override
- public int getBatchSize() throws IOException {
- if (batchSize == null){
- try {
- batchSize = Integer.parseInt(
- msc.getConfigValue(MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX.toString(), "50"));
- // TODO: we're asking the metastore what its configuration for this var is - we may
- // want to revisit to pull from client side instead. The reason I have it this way
- // is because the metastore is more likely to have a reasonable config for this than
- // an arbitrary client.
- } catch (TException e) {
- throw new IOException(e);
- }
- }
- return batchSize;
- }
-
- @Override
- public long getCurrentNotificationEventId() throws IOException {
- try {
- return msc.getCurrentNotificationEventId().getEventId();
- } catch (TException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public long getDbNotificationEventsCount(long fromEventId, String dbName) throws IOException {
- try {
- NotificationEventsCountRequest rqst
- = new NotificationEventsCountRequest(fromEventId, dbName);
- return msc.getNotificationEventsCount(rqst).getEventsCount();
- } catch (TException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public List<NotificationEvent> getNextNotificationEvents(
- long pos, IMetaStoreClient.NotificationFilter filter) throws IOException {
- try {
- return msc.getNextNotification(pos,getBatchSize(), filter).getEvents();
- } catch (TException e) {
- throw new IOException(e.getMessage(), e);
- }
- }
- }
-
- public static class NotificationEventIterator implements Iterator<NotificationEvent> {
-
- private NotificationFetcher nfetcher;
- private IMetaStoreClient.NotificationFilter filter;
- private int maxEvents;
-
- private Iterator<NotificationEvent> batchIter = null;
- private List<NotificationEvent> batch = null;
- private long pos;
- private long maxPos;
- private int eventCount;
-
- public NotificationEventIterator(
- NotificationFetcher nfetcher, long eventFrom, int maxEvents,
- String dbName, String tableName) throws IOException {
- init(nfetcher, eventFrom, maxEvents, new DatabaseAndTableFilter(dbName, tableName));
- // using init(..) instead of this(..) because the EventUtils.getDbTblNotificationFilter
- // is an operation that needs to run before delegating to the other ctor, and this messes up chaining
- // ctors
- }
-
- public NotificationEventIterator(
- NotificationFetcher nfetcher, long eventFrom, int maxEvents,
- IMetaStoreClient.NotificationFilter filter) throws IOException {
- init(nfetcher,eventFrom,maxEvents,filter);
- }
-
- private void init(
- NotificationFetcher nfetcher, long eventFrom, int maxEvents,
- IMetaStoreClient.NotificationFilter filter) throws IOException {
- this.nfetcher = nfetcher;
- this.filter = filter;
- this.pos = eventFrom;
- if (maxEvents < 1){
- // 0 or -1 implies fetch everything
- this.maxEvents = Integer.MAX_VALUE;
- } else {
- this.maxEvents = maxEvents;
- }
-
- this.eventCount = 0;
- this.maxPos = nfetcher.getCurrentNotificationEventId();
- }
-
- private void fetchNextBatch() throws IOException {
- batch = nfetcher.getNextNotificationEvents(pos, filter);
- int batchSize = nfetcher.getBatchSize();
- while ( ((batch == null) || (batch.isEmpty())) && (pos < maxPos) ){
- // no valid events this batch, but we're still not done processing events
- pos += batchSize;
- batch = nfetcher.getNextNotificationEvents(pos,filter);
- }
-
- if (batch == null){
- batch = new ArrayList<>();
- // instantiate empty list so that we don't error out on iterator fetching.
- // If we're here, then the next check of pos will show our caller that
- // that we've exhausted our event supply
- }
- batchIter = batch.iterator();
- }
-
- @Override
- public boolean hasNext() {
- if (eventCount >= maxEvents){
- // If we've already satisfied the number of events we were supposed to deliver, we end it.
- return false;
- }
- if ((batchIter != null) && (batchIter.hasNext())){
- // If we have a valid batchIter and it has more elements, return them.
- return true;
- }
- // If we're here, we want more events, and either batchIter is null, or batchIter
- // has reached the end of the current batch. Let's fetch the next batch.
- try {
- fetchNextBatch();
- } catch (IOException e) {
- // Regrettable that we have to wrap the IOException into a RuntimeException,
- // but throwing the exception is the appropriate result here, and hasNext()
- // signature will only allow RuntimeExceptions. Iterator.hasNext() really
- // should have allowed IOExceptions
- throw new RuntimeException(e.getMessage(), e);
- }
- // New batch has been fetched. If it's not empty, we have more elements to process.
- return !batch.isEmpty();
- }
-
- @Override
- public NotificationEvent next() {
- eventCount++;
- NotificationEvent ev = batchIter.next();
- pos = ev.getEventId();
- return ev;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("remove() not supported on NotificationEventIterator");
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/InsertMessage.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/InsertMessage.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/InsertMessage.java
deleted file mode 100644
index c470097..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/InsertMessage.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.messaging;
-
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.api.Table;
-
-/**
- * HCat message sent when an insert is done to a table or partition.
- */
-public abstract class InsertMessage extends EventMessage {
-
- protected InsertMessage() {
- super(EventType.INSERT);
- }
-
- /**
- * Getter for the name of the table being insert into.
- * @return Table-name (String).
- */
- public abstract String getTable();
-
- public abstract String getTableType();
-
- /**
- * Getter for the replace flag being insert into/overwrite
- * @return Replace flag to represent INSERT INTO or INSERT OVERWRITE (Boolean).
- */
- public abstract boolean isReplace();
-
- /**
- * Get list of file name and checksum created as a result of this DML operation
- *
- * @return The iterable of files
- */
- public abstract Iterable<String> getFiles();
-
- /**
- * Get the table object associated with the insert
- *
- * @return The Json format of Table object
- */
- public abstract Table getTableObj() throws Exception;
-
- /**
- * Get the partition object associated with the insert
- *
- * @return The Json format of Partition object if the table is partitioned else return null.
- */
- public abstract Partition getPtnObj() throws Exception;
-
- @Override
- public EventMessage checkValid() {
- if (getTable() == null)
- throw new IllegalStateException("Table name unset.");
- return super.checkValid();
- }
-}
http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/MessageDeserializer.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/MessageDeserializer.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/MessageDeserializer.java
deleted file mode 100644
index b701d84..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/messaging/MessageDeserializer.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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.messaging;
-
-/**
- * Interface for converting HCat events from String-form back to EventMessage instances.
- */
-public abstract class MessageDeserializer {
-
- /**
- * Method to construct EventMessage from string.
- */
- public EventMessage getEventMessage(String eventTypeString, String messageBody) {
-
- switch (EventMessage.EventType.valueOf(eventTypeString)) {
- case CREATE_DATABASE:
- return getCreateDatabaseMessage(messageBody);
- case ALTER_DATABASE:
- return getAlterDatabaseMessage(messageBody);
- case DROP_DATABASE:
- return getDropDatabaseMessage(messageBody);
- case CREATE_TABLE:
- return getCreateTableMessage(messageBody);
- case ALTER_TABLE:
- return getAlterTableMessage(messageBody);
- case DROP_TABLE:
- return getDropTableMessage(messageBody);
- case ADD_PARTITION:
- return getAddPartitionMessage(messageBody);
- case ALTER_PARTITION:
- return getAlterPartitionMessage(messageBody);
- case DROP_PARTITION:
- return getDropPartitionMessage(messageBody);
- case CREATE_FUNCTION:
- return getCreateFunctionMessage(messageBody);
- case DROP_FUNCTION:
- return getDropFunctionMessage(messageBody);
- case INSERT:
- return getInsertMessage(messageBody);
- case ADD_PRIMARYKEY:
- return getAddPrimaryKeyMessage(messageBody);
- case ADD_FOREIGNKEY:
- return getAddForeignKeyMessage(messageBody);
- case ADD_UNIQUECONSTRAINT:
- return getAddUniqueConstraintMessage(messageBody);
- case ADD_NOTNULLCONSTRAINT:
- return getAddNotNullConstraintMessage(messageBody);
- case DROP_CONSTRAINT:
- return getDropConstraintMessage(messageBody);
- case OPEN_TXN:
- return getOpenTxnMessage(messageBody);
- case COMMIT_TXN:
- return getCommitTxnMessage(messageBody);
- case ABORT_TXN:
- return getAbortTxnMessage(messageBody);
- case ALLOC_WRITE_ID:
- return getAllocWriteIdMessage(messageBody);
- case ACID_WRITE:
- return getAcidWriteMessage(messageBody);
- default:
- throw new IllegalArgumentException("Unsupported event-type: " + eventTypeString);
- }
- }
-
- /**
- * Method to de-serialize CreateDatabaseMessage instance.
- */
- public abstract CreateDatabaseMessage getCreateDatabaseMessage(String messageBody);
-
- /**
- * Method to de-serialize AlterDatabaseMessage instance.
- */
- public abstract AlterDatabaseMessage getAlterDatabaseMessage(String messageBody);
-
- /**
- * Method to de-serialize DropDatabaseMessage instance.
- */
- public abstract DropDatabaseMessage getDropDatabaseMessage(String messageBody);
-
- /**
- * Method to de-serialize CreateTableMessage instance.
- */
- public abstract CreateTableMessage getCreateTableMessage(String messageBody);
-
- /**
- * Method to de-serialize AlterTableMessge
- * @param messageBody string message
- * @return object message
- */
- public abstract AlterTableMessage getAlterTableMessage(String messageBody);
-
- /**
- * Method to de-serialize DropTableMessage instance.
- */
- public abstract DropTableMessage getDropTableMessage(String messageBody);
-
- /**
- * Method to de-serialize AddPartitionMessage instance.
- */
- public abstract AddPartitionMessage getAddPartitionMessage(String messageBody);
-
- /**
- * Method to deserialize AlterPartitionMessage
- * @param messageBody the message in serialized form
- * @return message in object form
- */
- public abstract AlterPartitionMessage getAlterPartitionMessage(String messageBody);
-
- /**
- * Method to de-serialize DropPartitionMessage instance.
- */
- public abstract DropPartitionMessage getDropPartitionMessage(String messageBody);
-
- /**
- * Method to de-serialize CreateFunctionMessage instance.
- */
- public abstract CreateFunctionMessage getCreateFunctionMessage(String messageBody);
-
- /**
- * Method to de-serialize DropFunctionMessage instance.
- */
- public abstract DropFunctionMessage getDropFunctionMessage(String messageBody);
-
- /**
- * Method to deserialize InsertMessage
- * @param messageBody the message in serialized form
- * @return message in object form
- */
- public abstract InsertMessage getInsertMessage(String messageBody);
-
- /**
- * Method to de-serialize AddPrimaryKeyMessage instance.
- */
- public abstract AddPrimaryKeyMessage getAddPrimaryKeyMessage(String messageBody);
-
- /**
- * Method to de-serialize AddForeignKeyMessage instance.
- */
- public abstract AddForeignKeyMessage getAddForeignKeyMessage(String messageBody);
-
- /**
- * Method to de-serialize AddUniqueConstraintMessage instance.
- */
- public abstract AddUniqueConstraintMessage getAddUniqueConstraintMessage(String messageBody);
-
- /**
- * Method to de-serialize AddNotNullConstraintMessage instance.
- */
- public abstract AddNotNullConstraintMessage getAddNotNullConstraintMessage(String messageBody);
-
- /**
- * Method to de-serialize DropConstraintMessage instance.
- */
- public abstract DropConstraintMessage getDropConstraintMessage(String messageBody);
-
- /**
- * Method to de-serialize OpenTxnMessage instance.
- */
- public abstract OpenTxnMessage getOpenTxnMessage(String messageBody);
-
- /**
- * Method to de-serialize CommitTxnMessage instance.
- */
- public abstract CommitTxnMessage getCommitTxnMessage(String messageBody);
-
- /**
- * Method to de-serialize AbortTxnMessage instance.
- */
- public abstract AbortTxnMessage getAbortTxnMessage(String messageBody);
-
- /*
- * Method to de-serialize AllocWriteIdMessage instance.
- */
- public abstract AllocWriteIdMessage getAllocWriteIdMessage(String messageBody);
-
- /*
- * Method to de-serialize AcidWriteMessage instance.
- */
- public abstract AcidWriteMessage getAcidWriteMessage(String messageBody);
-
- // Protection against construction.
- protected MessageDeserializer() {}
-}