public class FilterUtils extends Object
Constructor and Description |
---|
FilterUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkDbAndTableFilters(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
String dbName,
String tblName)
Check if the current user has access to a given database and table name.
|
static Catalog |
filterCatalogIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
Catalog catalog)
Filter the catalog if filtering is enabled; Otherwise, return original object
|
static List<String> |
filterCatalogNamesIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<String> catalogNames)
Filter list of catalog names if filtering is enabled; Otherwise, return original list
|
static GetLatestCommittedCompactionInfoResponse |
filterCommittedCompactionInfoStructIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
String dbName,
String tableName,
GetLatestCommittedCompactionInfoResponse response) |
static List<ShowCompactResponseElement> |
filterCompactionsIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
List<ShowCompactResponseElement> compactions)
Filter the list of compactions if filtering is enabled.
|
static List<String> |
filterDataConnectorsIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<String> connectorNames)
Filter the list of dataconnectors if filtering is enabled.
|
static Database |
filterDbIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
Database db)
Filter the DB if filtering is enabled.
|
static List<String> |
filterDbNamesIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<String> dbNames)
Filter the list of databases if filtering is enabled.
|
static Partition |
filterPartitionIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
Partition p)
Filter the partition if filtering is enabled.
|
static List<String> |
filterPartitionNamesIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
String dbName,
String tableName,
List<String> partitionNames)
Filter the list of partitions if filtering is enabled.
|
static List<Partition> |
filterPartitionsIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<Partition> partitions)
Filter the list of partitions if filtering is enabled.
|
static List<PartitionSpec> |
filterPartitionSpecsIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<PartitionSpec> partitionSpecs)
Filter the list of PartitionSpec if filtering is enabled; Otherwise, return original list
|
static Table |
filterTableIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
Table table)
Filter the table if filtering is enabled.
|
static List<TableMeta> |
filterTableMetasIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
String dbName,
List<TableMeta> tableMetas)
Filter list of meta data of tables if filtering is enabled.
|
static List<String> |
filterTableNamesIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
String catName,
String dbName,
List<String> tableNames)
Filter the list of tables if filtering is enabled.
|
static List<Table> |
filterTablesIfEnabled(boolean isFilterEnabled,
MetaStoreFilterHook filterHook,
List<Table> tables)
Filter the list of tables if filtering is enabled.
|
public static Database filterDbIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, Database db) throws MetaException, NoSuchObjectException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringdb:
- the database object from HMS metadataMetaException
NoSuchObjectException
public static List<String> filterDbNamesIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<String> dbNames) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringdbNames:
- the list of database names to filterMetaException
public static List<String> filterDataConnectorsIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<String> connectorNames) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringconnectorNames:
- the list of dataconnector names to filterMetaException
public static List<String> filterTableNamesIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, String dbName, List<String> tableNames) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringcatName:
- the catalog name of the tablesdbName:
- the database name to the tablestableNames:
- the list of table names to filterMetaException
public static List<Table> filterTablesIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<Table> tables) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringtables:
- the list of table objects to filterMetaException
public static Table filterTableIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, Table table) throws MetaException, NoSuchObjectException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringtable:
- the table object from Hive meta dataMetaException
NoSuchObjectException
public static List<TableMeta> filterTableMetasIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, String dbName, List<TableMeta> tableMetas) throws MetaException, NoSuchObjectException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringcatName:
- the catalog namedbName:
- the database nametableMetas:
- the list of meta data of tablesMetaException
NoSuchObjectException
public static Partition filterPartitionIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, Partition p) throws MetaException, NoSuchObjectException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringp:
- the partition objectMetaException
NoSuchObjectException
public static List<Partition> filterPartitionsIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<Partition> partitions) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringpartitions:
- the list of partitionsMetaException
public static List<String> filterPartitionNamesIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, String dbName, String tableName, List<String> partitionNames) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringcatName:
- the catalog namedbName:
- the database nametableName:
- the table namepartitionNames:
- the list of partition namesMetaException
public static List<PartitionSpec> filterPartitionSpecsIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<PartitionSpec> partitionSpecs) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringpartitionSpecs:
- the list of PartitionSpecMetaException
public static Catalog filterCatalogIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, Catalog catalog) throws MetaException, NoSuchObjectException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringcatalog:
- the catalog objectMetaException
NoSuchObjectException
public static List<String> filterCatalogNamesIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, List<String> catalogNames) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtring is disabled.filterHook:
- the object that does filteringcatalogNames:
- the list of catalog namesMetaException
public static void checkDbAndTableFilters(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, String dbName, String tblName) throws NoSuchObjectException, MetaException
dbName
- the database nametblName
- the table name contained in the databaseNoSuchObjectException
- if the database or table is filtered outMetaException
public static List<ShowCompactResponseElement> filterCompactionsIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, List<ShowCompactResponseElement> compactions) throws MetaException
isFilterEnabled
- true: filtering is enabled; false: filtering is disabled.filterHook
- the object that does filteringcompactions
- the list of compactionsMetaException
public static GetLatestCommittedCompactionInfoResponse filterCommittedCompactionInfoStructIfEnabled(boolean isFilterEnabled, MetaStoreFilterHook filterHook, String catName, String dbName, String tableName, GetLatestCommittedCompactionInfoResponse response) throws MetaException
MetaException
Copyright © 2022 The Apache Software Foundation. All rights reserved.