public class MetaStoreSchemaInfo extends Object implements IMetaStoreSchemaInfo
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CREATE_USER_PREFIX |
protected String |
dbType |
protected static String |
INIT_FILE_PREFIX |
protected static String |
PRE_UPGRADE_PREFIX |
protected static String |
UPGRADE_FILE_PREFIX |
protected static String |
VERSION_UPGRADE_LIST |
SQL_FILE_EXTENSION| Constructor and Description |
|---|
MetaStoreSchemaInfo(String metastoreHome,
String dbType) |
| Modifier and Type | Method and Description |
|---|---|
String |
generateInitFileName(String toVersion)
Get the name of the script to initialize the schema for given version
|
String |
getCreateUserScript()
Get SQL script that will create the user and database for Metastore to use.
|
String |
getHiveSchemaVersion()
Get hive distribution schema version.
|
String |
getMetaStoreSchemaVersion(HiveSchemaHelper.MetaStoreConnectionInfo connectionInfo)
Get the schema version from the backend database.
|
String |
getMetaStoreScriptDir()
Find the directory of metastore scripts
|
String |
getPreUpgradeScriptName(int index,
String upgradeScriptName)
Get the pre-upgrade script for a given script name.
|
List<String> |
getUpgradeScripts(String fromVersion)
Get the list of sql scripts required to upgrade from the give version to current
|
boolean |
isVersionCompatible(String hiveVersion,
String dbVersion)
A dbVersion is compatible with hive version if it is greater or equal to the hive version.
|
protected static final String UPGRADE_FILE_PREFIX
protected static final String INIT_FILE_PREFIX
protected static final String VERSION_UPGRADE_LIST
protected static final String PRE_UPGRADE_PREFIX
protected static final String CREATE_USER_PREFIX
protected final String dbType
public MetaStoreSchemaInfo(String metastoreHome, String dbType) throws HiveMetaException
HiveMetaExceptionpublic List<String> getUpgradeScripts(String fromVersion) throws HiveMetaException
getUpgradeScripts in interface IMetaStoreSchemaInfofromVersion - HiveMetaExceptionpublic String generateInitFileName(String toVersion) throws HiveMetaException
generateInitFileName in interface IMetaStoreSchemaInfotoVersion - Target version. If it's null, then the current server version is usedHiveMetaExceptionpublic String getCreateUserScript() throws HiveMetaException
IMetaStoreSchemaInfogetCreateUserScript in interface IMetaStoreSchemaInfoHiveMetaException - if something goes wrong.public String getMetaStoreScriptDir()
getMetaStoreScriptDir in interface IMetaStoreSchemaInfopublic String getPreUpgradeScriptName(int index, String upgradeScriptName)
IMetaStoreSchemaInfogetPreUpgradeScriptName in interface IMetaStoreSchemaInfoindex - - index number of the file. The preupgrade script name is derived using the given
indexupgradeScriptName - - upgrade script namepublic String getHiveSchemaVersion()
IMetaStoreSchemaInfogetHiveSchemaVersion in interface IMetaStoreSchemaInfopublic boolean isVersionCompatible(String hiveVersion, String dbVersion)
IMetaStoreSchemaInfoisVersionCompatible in interface IMetaStoreSchemaInfohiveVersion - version of hive softwaredbVersion - version of metastore rdbms schemapublic String getMetaStoreSchemaVersion(HiveSchemaHelper.MetaStoreConnectionInfo connectionInfo) throws HiveMetaException
IMetaStoreSchemaInfogetMetaStoreSchemaVersion in interface IMetaStoreSchemaInfoconnectionInfo - Connection information needed to connect to the backend
databaseHiveMetaException - when unable to fetch the schema versionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.