src_fm_fc_ms_ff stringlengths 43 86.8k | target stringlengths 20 276k |
|---|---|
AdvancedRepresenter extends Representer { @Override protected NodeTuple representJavaBeanProperty( Object javaBean, Property property, Object propertyValue, Tag customTag) { setDefaultScalarStyle(ScalarStyle.PLAIN); NodeTuple nodeTuple = super.representJavaBeanProperty(javaBean, property, propertyValue, customTag); Nod... | @Test public void notNullProperty() throws Exception { bean.setProperty("value"); Property property = new MethodProperty(getPropertyDescriptor("property")); NodeTuple nodeTuple = representer.representJavaBeanProperty(bean, property, bean.getProperty(), null); assertThat(nodeTuple, is(notNullValue())); assertThat(nodeTu... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Type get_type(String name) throws MetaException, NoSuchObjectException, TException { return getPrimaryClient().get_type(name); } FederatedHMSHandle... | @Test public void get_type() throws TException { handler.get_type("name"); verify(primaryClient).get_type("name"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean create_type(Type type) throws AlreadyExistsException, InvalidObjectException, MetaException, TException { return getPrimaryClient().create_... | @Test public void create_type() throws TException { Type type = new Type(); handler.create_type(type); verify(primaryClient).create_type(type); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_type(String type) throws MetaException, NoSuchObjectException, TException { return getPrimaryClient().drop_type(type); } FederatedHMSH... | @Test public void drop_type() throws TException { handler.drop_type("name"); verify(primaryClient).drop_type("name"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Map<String, Type> get_type_all(String name) throws MetaException, TException { return getPrimaryClient().get_type_all(name); } FederatedHMSHandler(... | @Test public void get_type_all() throws TException { handler.get_type_all("name"); verify(primaryClient).get_type_all("name"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_fields(String db_name, String table_name) throws MetaException, UnknownTableException, UnknownDBException, TException { Datab... | @Test public void get_fields() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); handler.get_fields(DB_P, "table"); verify(primaryClient).get_fields("inbound", "table"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<FieldSchema> get_schema(String db_name, String table_name) throws MetaException, UnknownTableException, UnknownDBException, TException { Datab... | @Test public void get_schema() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); handler.get_schema(DB_P, "table"); verify(primaryClient).get_schema("inbound", "table"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void create_table(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { DatabaseMapp... | @Test public void create_table() throws TException { Table table = new Table(); table.setDbName(DB_P); Table inboundTable = new Table(); inboundTable.setDbName("inbound"); when(primaryMapping.transformInboundTable(table)).thenReturn(inboundTable); handler.create_table(table); verify(primaryMapping).checkWritePermission... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void create_table_with_environment_context(Table tbl, EnvironmentContext environment_context) throws AlreadyExistsException, InvalidObjectException... | @Test public void create_table_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Table table = new Table(); table.setDbName(DB_P); Table inboundTable = new Table(); inboundTable.setDbName("inbound"); when(primaryMapping.transformInboundTable(table)).thenRet... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void drop_table(String dbname, String name, boolean deleteData) throws NoSuchObjectException, MetaException, TException { DatabaseMapping mapping =... | @Test public void drop_table() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); handler.drop_table(DB_P, "table", false); verify(primaryMapping).checkWritePermissions(DB_P); verify(primaryClient).drop_table("inbound", "table", false); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void drop_table_with_environment_context( String dbname, String name, boolean deleteData, EnvironmentContext environment_context) throws NoSuchObje... | @Test public void drop_table_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); handler.drop_table_with_environment_context(DB_P, "table", false, environmentContext); verify(prima... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_tables(String db_name, String pattern) throws MetaException, TException { DatabaseMapping mapping = databaseMappingService.databas... | @Test public void get_tables() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); List<String> tables = Lists.newArrayList("table1"); when(primaryClient.get_tables("inbound", "*")).thenReturn(tables); List<String> result = handler.get_tables(DB_P, "*"); assertThat(result,... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_all_tables(String db_name) throws MetaException, TException { DatabaseMapping mapping = databaseMappingService.databaseMapping(db_... | @Test public void get_all_tables() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); List<String> tables = Lists.newArrayList("table1"); when(primaryClient.get_all_tables("inbound")).thenReturn(tables); List<String> result = handler.get_all_tables(DB_P); assertThat(resul... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Table get_table(String dbname, String tbl_name) throws MetaException, NoSuchObjectException, TException { DatabaseMapping mapping = databaseMapping... | @Test public void get_table() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); Table table = new Table(); Table outbound = new Table(); when(primaryClient.get_table("inbound", "table")).thenReturn(table); when(primaryMapping.transformOutboundTable(table)).thenReturn(out... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<Table> get_table_objects_by_name(String dbname, List<String> tbl_names) throws MetaException, InvalidOperationException, UnknownDBException, T... | @Test public void get_table_objects_by_name() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); Table table = new Table(); Table outbound = new Table(); when(primaryClient.get_table_objects_by_name("inbound", Lists.newArrayList("table"))) .thenReturn(Lists.newArrayList(t... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_table_names_by_filter(String dbname, String filter, short max_tables) throws MetaException, InvalidOperationException, UnknownDBEx... | @Test public void get_table_names_by_filter() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); List<String> tables = Lists.newArrayList("table1"); when(primaryClient.get_table_names_by_filter("inbound", "*", (short) 2)).thenReturn(tables); List<String> result = handler.... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_table(String dbname, String tbl_name, Table new_tbl) throws InvalidOperationException, MetaException, TException { DatabaseMapping mappi... | @Test public void alter_table() throws TException { Table table = new Table(); table.setDbName(DB_P); Table inbound = new Table(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryMapping.transformInboundTable(table)).thenReturn(inbound); handler.alter_table(DB_P, "table", tabl... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_table_with_environment_context( String dbname, String tbl_name, Table new_tbl, EnvironmentContext environment_context) throws InvalidOpe... | @Test public void alter_table_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Table table = new Table(); table.setDbName(DB_P); Table inbound = new Table(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryMapping... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition add_partition(Partition new_part) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { DatabaseMapping mapp... | @Test public void add_partition() throws TException { Partition newPartition = new Partition(); newPartition.setDbName(DB_P); Partition inbound = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundPartition(newPartition)).thenReturn(inbound); when(primaryClient.add_partition(inbo... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition add_partition_with_environment_context(Partition new_part, EnvironmentContext environment_context) throws InvalidObjectException, Already... | @Test public void add_partition_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Partition newPartition = new Partition(); newPartition.setDbName(DB_P); Partition inbound = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transfor... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public int add_partitions(List<Partition> new_parts) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { if (!new_parts.isE... | @Test public void add_partitions() throws TException { Partition newPartition1 = new Partition(); newPartition1.setDbName(DB_P); Partition newPartition2 = new Partition(); newPartition2.setDbName(DB_P); List<Partition> inbound = Lists.newArrayList(new Partition()); List<Partition> partitions = Lists.newArrayList(newPar... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public int add_partitions_pspec(List<PartitionSpec> new_parts) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { if (!new... | @Test public void add_partitions_pspec() throws TException { PartitionSpec newPartitionPSpec1 = new PartitionSpec(); newPartitionPSpec1.setDbName(DB_P); PartitionSpec newPartitionPspec2 = new PartitionSpec(); newPartitionPspec2.setDbName(DB_P); List<PartitionSpec> inbound = Lists.newArrayList(new PartitionSpec()); List... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition append_partition(String db_name, String tbl_name, List<String> part_vals) throws InvalidObjectException, AlreadyExistsException, MetaExce... | @Test public void append_partition() throws TException { Partition inbound = new Partition(); Partition outbound = new Partition(); List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.append_partition("inbound", "table1", partVa... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public AddPartitionsResult add_partitions_req(AddPartitionsRequest request) throws InvalidObjectException, AlreadyExistsException, MetaException, TExcepti... | @Test public void add_partitions_req() throws TException { Partition newPartition1 = new Partition(); newPartition1.setDbName(DB_P); Partition newPartition2 = new Partition(); newPartition2.setDbName(DB_P); List<Partition> partitions = Lists.newArrayList(newPartition1, newPartition2); AddPartitionsRequest request = new... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition append_partition_with_environment_context( String db_name, String tbl_name, List<String> part_vals, EnvironmentContext environment_contex... | @Test public void append_partition_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Partition inbound = new Partition(); Partition outbound = new Partition(); List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition append_partition_by_name(String db_name, String tbl_name, String part_name) throws InvalidObjectException, AlreadyExistsException, MetaEx... | @Test public void append_partition_by_name() throws TException { Partition inbound = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.append_partition_by_name("inbound", "table1", "partName")).thenReturn(inbound); wh... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition append_partition_by_name_with_environment_context( String db_name, String tbl_name, String part_name, EnvironmentContext environment_cont... | @Test public void append_partition_by_name_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Partition inbound = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(prima... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_partition(String db_name, String tbl_name, List<String> part_vals, boolean deleteData) throws NoSuchObjectException, MetaException, TE... | @Test public void drop_partition() throws TException { List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.drop_partition("inbound", "table1", partVals, false)).thenReturn(true); boolean result = handler.drop_partition(DB_P, "ta... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_partition_with_environment_context( String db_name, String tbl_name, List<String> part_vals, boolean deleteData, EnvironmentContext en... | @Test public void drop_partition_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when( primaryClient.drop_partition_with_environme... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_partition_by_name(String db_name, String tbl_name, String part_name, boolean deleteData) throws NoSuchObjectException, MetaException, ... | @Test public void drop_partition_by_name() throws TException { when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.drop_partition_by_name("inbound", "table1", "partName", false)).thenReturn(true); boolean result = handler.drop_partition_by_name(DB_P, "table1", "partName", f... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_partition_by_name_with_environment_context( String db_name, String tbl_name, String part_name, boolean deleteData, EnvironmentContext ... | @Test public void drop_partition_by_name_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient .drop_partition_by_name_with_environment_context("inbound", "table1"... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public DropPartitionsResult drop_partitions_req(DropPartitionsRequest req) throws NoSuchObjectException, MetaException, TException { DatabaseMapping mappi... | @Test public void drop_partitions_req() throws TException { DropPartitionsRequest req = new DropPartitionsRequest(); req.setDbName(DB_P); DropPartitionsRequest inbound = new DropPartitionsRequest(); DropPartitionsResult dropPartitionResult = new DropPartitionsResult(); DropPartitionsResult outbound = new DropPartitions... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition get_partition(String db_name, String tbl_name, List<String> part_vals) throws MetaException, NoSuchObjectException, TException { Database... | @Test public void get_partition() throws TException { List<String> partVals = Lists.newArrayList(); Partition partition = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partition("inbound", "table1", partVals))... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition exchange_partition( Map<String, String> partitionSpecs, String source_db, String source_table_name, String dest_db, String dest_table_nam... | @Test public void exchange_partition() throws TException { Partition partition = new Partition(); Partition outbound = new Partition(); Map<String, String> specs = new HashMap<>(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.exchange_partition(specs, "inbound", "sou... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition get_partition_with_auth( String db_name, String tbl_name, List<String> part_vals, String user_name, List<String> group_names) throws Meta... | @Test public void get_partition_with_auth() throws TException { List<String> partVals = Lists.newArrayList(); Partition partition = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); List<String> groupNames = new ArrayList<>(); when(prim... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Partition get_partition_by_name(String db_name, String tbl_name, String part_name) throws MetaException, NoSuchObjectException, TException { Databa... | @Test public void get_partition_by_name() throws TException { Partition partition = new Partition(); Partition outbound = new Partition(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partition_by_name("inbound", "table1", "partName")).thenReturn(partition); when... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions(String db_name, String tbl_name, short max_parts) throws NoSuchObjectException, MetaException, TExcept... | @Test public void get_partitions() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitions("inbound", "table", (short) 10)).thenReturn(partitio... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions_with_auth( String db_name, String tbl_name, short max_parts, String user_name, List<String> group_name... | @Test public void get_partitions_with_auth() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); List<String> groupNames = new ArrayList<>(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitio... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<PartitionSpec> get_partitions_pspec(String db_name, String tbl_name, int max_parts) throws NoSuchObjectException, MetaException,... | @Test public void get_partitions_pspec() throws TException { List<PartitionSpec> partitionSpecs = Lists.newArrayList(); List<PartitionSpec> outbound = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitions_pspec("inbound", "table", (short) ... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_partition_names(String db_name, String tbl_name, short max_parts) throws MetaException, TException { DatabaseMapping mapping = dat... | @Test public void get_partition_names() throws TException { List<String> partitions = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partition_names("inbound", "table", (short) 10)).thenReturn(partitions); List<String> result = handler.get_par... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions_ps(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws MetaException, NoS... | @Test public void get_partitions_ps() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitions_ps(... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions_ps_with_auth( String db_name, String tbl_name, List<String> part_vals, short max_parts, String user_na... | @Test public void get_partitions_ps_with_auth() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); List<String> partVals = Lists.newArrayList(); List<String> groupNames = new ArrayList<>(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenR... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_partition_names_ps(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws MetaException, NoSuchObjectExc... | @Test public void get_partition_names_ps() throws TException { List<String> partitions = Lists.newArrayList(); List<String> outbound = Lists.newArrayList(); List<String> partVals = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partition_names... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions_by_filter(String db_name, String tbl_name, String filter, short max_parts) throws MetaException, NoSuc... | @Test public void get_partitions_by_filter() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitions_by_filter("inbound", "table", "*", (short)... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<PartitionSpec> get_part_specs_by_filter(String db_name, String tbl_name, String filter, int max_parts) throws MetaException, NoS... | @Test public void get_part_specs_by_filter() throws TException { List<PartitionSpec> partitionSpecs = Lists.newArrayList(); List<PartitionSpec> outbound = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_part_specs_by_filter("inbound", "table", ... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public PartitionsByExprResult get_partitions_by_expr(PartitionsByExprRequest req) throws MetaException, NoSuchObjectException, TException { DatabaseMappin... | @Test public void get_partitions_by_expr() throws TException { PartitionsByExprRequest req = new PartitionsByExprRequest(); req.setDbName(DB_P); PartitionsByExprRequest inbound = new PartitionsByExprRequest(); PartitionsByExprResult partitionResult = new PartitionsByExprResult(); PartitionsByExprResult outbound = new P... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME, prepend=true) public List<Partition> get_partitions_by_names(String db_name, String tbl_name, List<String> names) throws MetaException, NoSuchObjectExcept... | @Test public void get_partitions_by_names() throws TException { List<Partition> partitions = Lists.newArrayList(); List<Partition> outbound = Lists.newArrayList(); List<String> names = Lists.newArrayList(); when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound"); when(primaryClient.get_partitions_... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void flushCache() throws TException { getPrimaryClient().flushCache(); } FederatedHMSHandler(
MappingEventListener databaseMappingService,
... | @Test public void flushCache() throws TException { handler.flushCache(); verify(primaryClient).flushCache(); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetAllFunctionsResponse get_all_functions() throws TException { return databaseMappingService .getPanopticOperationHandler() .getAllFunctions(datab... | @Test public void get_all_functions() throws TException { PanopticOperationHandler panopticHandler = Mockito.mock(PanopticOperationHandler.class); when(databaseMappingService.getPanopticOperationHandler()).thenReturn(panopticHandler); DatabaseMapping mapping = Mockito.mock(DatabaseMapping.class); List<DatabaseMapping> ... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> set_ugi(String user_name, List<String> group_names) throws MetaException, TException { List<DatabaseMapping> mappings = databaseMappin... | @Test public void set_ugi() throws TException { PanopticOperationHandler panopticHandler = Mockito.mock(PanopticOperationHandler.class); when(databaseMappingService.getPanopticOperationHandler()).thenReturn(panopticHandler); String user_name = "user"; List<String> group_names = Lists.newArrayList("group"); when(panopti... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_tables_by_type(String db_name, String pattern, String tableType) throws MetaException, TException { DatabaseMapping mapping = data... | @Test public void get_tables_by_type() throws TException { when(primaryClient.get_tables_by_type(DB_P, "tbl*", "EXTERNAL_TABLE")).thenReturn(Arrays.asList("tbl0", "tbl1")); List<String> tables = handler.get_tables_by_type(DB_P, "tbl*", TableType.EXTERNAL_TABLE.name()); verify(primaryClient).get_tables_by_type(DB_P, "tb... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetTableResult get_table_req(GetTableRequest req) throws MetaException, NoSuchObjectException, TException { DatabaseMapping mapping = databaseMappi... | @Test public void get_table_req() throws TException { Table table = new Table(); table.setDbName(DB_P); table.setTableName("table"); GetTableRequest request = new GetTableRequest(table.getDbName(), table.getTableName()); GetTableResult response = new GetTableResult(table); when(primaryClient.get_table_req(request)).the... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetTablesResult get_table_objects_by_name_req(GetTablesRequest req) throws MetaException, InvalidOperationException, UnknownDBException, TException... | @Test public void get_table_objects_by_name_req() throws TException { Table table0 = new Table(); table0.setDbName(DB_P); table0.setTableName("table0"); Table table1 = new Table(); table1.setDbName(DB_P); table1.setTableName("table1"); GetTablesRequest request = new GetTablesRequest(DB_P); request.setTblNames(Arrays.as... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public ForeignKeysResponse get_foreign_keys(ForeignKeysRequest request) throws MetaException, NoSuchObjectException, TException { DatabaseMapping mapping ... | @Test public void get_foreign_keys() throws TException { ForeignKeysRequest request = new ForeignKeysRequest(); request.setParent_db_name(null); request.setParent_tbl_name(null); request.setForeign_db_name(DB_S); request.setForeign_tbl_name("table"); SQLForeignKey key = new SQLForeignKey(); key.setFktable_db(DB_S); key... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public CompactionResponse compact2(CompactionRequest rqst) throws TException { DatabaseMapping mapping = databaseMappingService.primaryDatabaseMapping(); ... | @Test public void compact2() throws TException { CompactionRequest request = new CompactionRequest(DB_P, "table", CompactionType.MAJOR); CompactionResponse response = new CompactionResponse(0, "state", true); when(primaryClient.compact2(request)).thenReturn(response); when(primaryMapping.transformInboundCompactionReque... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, String user_name, List<String> group_names) throws MetaException, TException { Da... | @Test public void getPrivilegeSet() throws TException { String userName = "user"; List<String> groupNames = Lists.newArrayList("group"); HiveObjectRef hiveObjectRef = new HiveObjectRef(); hiveObjectRef.setDbName(DB_P); when(databaseMappingService.databaseMapping(DB_P)).thenReturn(primaryMapping); when(primaryMapping.tr... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_partition(String db_name, String tbl_name, Partition new_part) throws InvalidOperationException, MetaException, TException { DatabaseMap... | @Test public void alter_partition() throws TException { Partition newPartition = new Partition(); newPartition.setDbName(DB_P); Partition inbound = new Partition(); when(primaryMapping.transformInboundPartition(newPartition)).thenReturn(inbound); handler.alter_partition(DB_P, "table", newPartition); verify(primaryMappi... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_partitions(String db_name, String tbl_name, List<Partition> new_parts) throws InvalidOperationException, MetaException, TException { Dat... | @Test public void alter_partitions() throws TException { Partition newPartition1 = new Partition(); newPartition1.setDbName(DB_P); Partition newPartition2 = new Partition(); newPartition2.setDbName(DB_P); List<Partition> inbound = Lists.newArrayList(new Partition()); List<Partition> partitions = Lists.newArrayList(newP... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_partition_with_environment_context( String db_name, String tbl_name, Partition new_part, EnvironmentContext environment_context) throws ... | @Test public void alter_partition_with_environment_context() throws TException { EnvironmentContext environmentContext = new EnvironmentContext(); Partition newPartition = new Partition(); newPartition.setDbName(DB_P); Partition inbound = new Partition(); when(primaryMapping.transformInboundPartition(newPartition)).the... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void rename_partition(String db_name, String tbl_name, List<String> part_vals, Partition new_part) throws InvalidOperationException, MetaException,... | @Test public void rename_partition() throws TException { Partition newPartition = new Partition(); newPartition.setDbName(DB_P); handler.rename_partition(DB_P, "table", Collections.emptyList(), newPartition); verify(primaryMapping, times(2)).checkWritePermissions(DB_P); verify(primaryClient).rename_partition(DB_P, "tab... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean partition_name_has_valid_characters(List<String> part_vals, boolean throw_exception) throws MetaException, TException { return getPrimaryCl... | @Test public void partition_name_has_valid_characters() throws TException { List<String> partitionValues = Collections.singletonList("name"); when(primaryClient.partition_name_has_valid_characters(partitionValues, true)).thenReturn(true); boolean result = handler.partition_name_has_valid_characters(partitionValues, tru... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public String get_config_value(String name, String defaultValue) throws ConfigValSecurityException, TException { return getPrimaryClient().get_config_valu... | @Test public void get_config_value() throws TException { String expected = "anotherValue"; when(primaryClient.get_config_value("name", "defaultValue")).thenReturn(expected); String result = handler.get_config_value("name", "defaultValue"); assertThat(result, is(expected)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> partition_name_to_vals(String part_name) throws MetaException, TException { return getPrimaryClient().partition_name_to_vals(part_name... | @Test public void partition_name_to_vals() throws TException { List<String> expected = Arrays.asList("name1", "name2"); when(primaryClient.partition_name_to_vals("name")).thenReturn(expected); List<String> result = handler.partition_name_to_vals("name"); assertThat(result, is(expected)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Map<String, String> partition_name_to_spec(String part_name) throws MetaException, TException { return getPrimaryClient().partition_name_to_spec(pa... | @Test public void partition_name_to_spec() throws TException { Map<String, String> expected = new HashMap<>(); when(primaryClient.partition_name_to_spec("name")).thenReturn(expected); Map<String, String> result = handler.partition_name_to_spec("name"); assertThat(result, is(expected)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void markPartitionForEvent( String db_name, String tbl_name, Map<String, String> part_vals, PartitionEventType eventType) throws MetaException, NoS... | @Test public void markPartitionForEvent() throws TException { Map<String, String> partitionValues = new HashMap<>(); PartitionEventType partitionEventType = PartitionEventType.findByValue(1); handler.markPartitionForEvent(DB_P, "table", partitionValues, partitionEventType); verify(primaryMapping).checkWritePermissions(... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean isPartitionMarkedForEvent( String db_name, String tbl_name, Map<String, String> part_vals, PartitionEventType eventType) throws MetaExcepti... | @Test public void isPartitionMarkedForEvent() throws TException { Map<String, String> partitionValues = new HashMap<>(); PartitionEventType partitionEventType = PartitionEventType.findByValue(1); when(primaryClient.isPartitionMarkedForEvent(DB_P, "table", partitionValues, partitionEventType)).thenReturn(true); boolean ... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Index add_index(Index new_index, Table index_table) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { DatabaseMapp... | @Test public void add_index() throws TException { Index newIndex = new Index(); newIndex.setDbName(DB_P); Index inboundIndex = new Index(); Index outboundIndex = new Index(); Table newTable = new Table(); newTable.setDbName(DB_P); Table inboundTable = new Table(); when(primaryMapping.transformInboundIndex(newIndex)).th... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_index(String dbname, String base_tbl_name, String idx_name, Index new_idx) throws InvalidOperationException, MetaException, TException {... | @Test public void alter_index() throws TException { Index newIndex = new Index(); newIndex.setDbName(DB_P); Index inboundIndex = new Index(); when(primaryMapping.transformInboundIndex(newIndex)).thenReturn(inboundIndex); handler.alter_index(DB_P, "table", "index", newIndex); verify(primaryMapping, times(2)).checkWriteP... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_index_by_name(String db_name, String tbl_name, String index_name, boolean deleteData) throws NoSuchObjectException, MetaException, TEx... | @Test public void drop_index_by_name() throws TException { when(primaryClient.drop_index_by_name(DB_P, "table", "index", true)).thenReturn(true); boolean result = handler.drop_index_by_name(DB_P, "table", "index", true); verify(primaryMapping).checkWritePermissions(DB_P); assertThat(result, is(true)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Index get_index_by_name(String db_name, String tbl_name, String index_name) throws MetaException, NoSuchObjectException, TException { DatabaseMappi... | @Test public void get_index_by_name() throws TException { Index index = new Index(); Index outboundIndex = new Index(); when(primaryClient.get_index_by_name(DB_P, "table", "index")).thenReturn(index); when(primaryMapping.transformOutboundIndex(index)).thenReturn(outboundIndex); Index result = handler.get_index_by_name(... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<Index> get_indexes(String db_name, String tbl_name, short max_indexes) throws NoSuchObjectException, MetaException, TException { DatabaseMappi... | @Test public void get_indexes() throws TException { List<Index> indexList = Collections.singletonList(new Index()); List<Index> outboundIndexList = Collections.singletonList(new Index()); when(primaryMapping.transformOutboundIndexes(indexList)).thenReturn(outboundIndexList); when(primaryClient.get_indexes(DB_P, "table"... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_index_names(String db_name, String tbl_name, short max_indexes) throws MetaException, TException { DatabaseMapping mapping = datab... | @Test public void get_index_names() throws TException { List<String> indexNames = Arrays.asList("name1", "name2"); when(primaryClient.get_index_names(DB_P, "table", (short) 2)).thenReturn(indexNames); List<String> result = handler.get_index_names(DB_P, "table", (short) 2); assertThat(result, is(indexNames)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean update_table_column_statistics(ColumnStatistics stats_obj) throws NoSuchObjectException, InvalidObjectException, MetaException, InvalidInpu... | @Test public void update_table_column_statistics() throws TException { ColumnStatisticsDesc columnStatisticsDesc = new ColumnStatisticsDesc(true, DB_P, "table"); ColumnStatistics columnStatistics = new ColumnStatistics(columnStatisticsDesc, Collections.emptyList()); ColumnStatistics inboundColumnStatistics = new Column... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean update_partition_column_statistics(ColumnStatistics stats_obj) throws NoSuchObjectException, InvalidObjectException, MetaException, Invalid... | @Test public void update_partition_column_statistics() throws TException { ColumnStatisticsDesc columnStatisticsDesc = new ColumnStatisticsDesc(true, DB_P, "table"); ColumnStatistics columnStatistics = new ColumnStatistics(columnStatisticsDesc, Collections.emptyList()); ColumnStatistics inboundColumnStatistics = new Co... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public ColumnStatistics get_table_column_statistics(String db_name, String tbl_name, String col_name) throws NoSuchObjectException, MetaException, Invalid... | @Test public void get_table_column_statistics() throws TException { ColumnStatistics columnStatistics = new ColumnStatistics(); ColumnStatistics outboundColumnStatistics = new ColumnStatistics(); when(primaryClient.get_table_column_statistics(DB_P, "table", "columnName")).thenReturn(columnStatistics); when(primaryMappi... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public ColumnStatistics get_partition_column_statistics( String db_name, String tbl_name, String part_name, String col_name) throws NoSuchObjectException,... | @Test public void get_partition_column_statistics() throws TException { ColumnStatistics columnStatistics = new ColumnStatistics(); ColumnStatistics outboundColumnStatistics = new ColumnStatistics(); when(primaryClient.get_partition_column_statistics(DB_P, "table", "partitionName", "columnName")) .thenReturn(columnStat... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public TableStatsResult get_table_statistics_req(TableStatsRequest request) throws NoSuchObjectException, MetaException, TException { DatabaseMapping mapp... | @Test public void get_table_statistics_req() throws TException { TableStatsRequest tableStatsRequest = new TableStatsRequest(DB_P, "table", Collections.emptyList()); TableStatsRequest inboundTableStatsRequest = new TableStatsRequest(); TableStatsResult expected = new TableStatsResult(); when(primaryMapping.transformInb... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public PartitionsStatsResult get_partitions_statistics_req(PartitionsStatsRequest request) throws NoSuchObjectException, MetaException, TException { Datab... | @Test public void get_partitions_statistics_req() throws TException { PartitionsStatsRequest request = new PartitionsStatsRequest(DB_P, "table", Collections.emptyList(), Collections.emptyList()); PartitionsStatsRequest inboundRequest = new PartitionsStatsRequest(); PartitionsStatsResult expected = new PartitionsStatsRe... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public AggrStats get_aggr_stats_for(PartitionsStatsRequest request) throws NoSuchObjectException, MetaException, TException { DatabaseMapping mapping = da... | @Test public void get_aggr_stats_for() throws TException { PartitionsStatsRequest request = new PartitionsStatsRequest(DB_P, "table", Collections.emptyList(), Collections.emptyList()); PartitionsStatsRequest inboundRequest = new PartitionsStatsRequest(); AggrStats expected = new AggrStats(); when(primaryMapping.transfo... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean set_aggr_stats_for(SetPartitionsStatsRequest request) throws NoSuchObjectException, InvalidObjectException, MetaException, InvalidInputExce... | @Test public void set_aggr_stats_for() throws TException { ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(true, DB_P, "table"); ColumnStatistics colStatistics = new ColumnStatistics(statsDesc, Collections.emptyList()); List<ColumnStatistics> colStats = Collections.singletonList(colStatistics); SetPartitionsS... |
Whitelist { public void add(String databaseName) { whiteList.add(Pattern.compile(trimToLowerCase(databaseName))); } Whitelist(); Whitelist(List<String> writableDatabaseWhiteList); void add(String databaseName); boolean contains(String databaseName); } | @Test public void add() { Whitelist whitelist = new Whitelist(); whitelist.add("db"); assertThat(whitelist.size(), is(1)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean delete_partition_column_statistics(String db_name, String tbl_name, String part_name, String col_name) throws NoSuchObjectException, MetaEx... | @Test public void delete_partition_column_statistics() throws TException { when(primaryClient.delete_partition_column_statistics(DB_P, "table", "partition", "column")).thenReturn(true); boolean result = handler.delete_partition_column_statistics(DB_P, "table", "partition", "column"); assertThat(result, is(true)); verif... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean delete_table_column_statistics(String db_name, String tbl_name, String col_name) throws NoSuchObjectException, MetaException, InvalidObject... | @Test public void delete_table_column_statistics() throws TException { when(primaryClient.delete_table_column_statistics(DB_P, "table", "column")).thenReturn(true); boolean result = handler.delete_table_column_statistics(DB_P, "table", "column"); assertThat(result, is(true)); verify(primaryMapping).checkWritePermission... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void create_function(Function func) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { Datab... | @Test public void create_function() throws TException { Function function = new Function(); function.setDbName(DB_P); Function inboundFunction = new Function(); when(primaryMapping.transformInboundFunction(function)).thenReturn(inboundFunction); handler.create_function(function); verify(primaryMapping).checkWritePermis... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void drop_function(String dbName, String funcName) throws NoSuchObjectException, MetaException, TException { DatabaseMapping mapping = checkWritePe... | @Test public void drop_function() throws TException { handler.drop_function(DB_P, "function"); verify(primaryMapping).checkWritePermissions(DB_P); verify(primaryClient).drop_function(DB_P, "function"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public void alter_function(String dbName, String funcName, Function newFunc) throws InvalidOperationException, MetaException, TException { DatabaseMapping... | @Test public void alter_function() throws TException { Function newFunc = new Function(); newFunc.setDbName(DB_P); Function inboundFunction = new Function(); when(primaryMapping.transformInboundFunction(newFunc)).thenReturn(inboundFunction); handler.alter_function(DB_P, "function", newFunc); verify(primaryMapping, time... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_functions(String dbName, String pattern) throws MetaException, TException { DatabaseMapping mapping = databaseMappingService.datab... | @Test public void get_functions() throws TException { List<String> expected = Arrays.asList("func1", "func2"); when(primaryClient.get_functions(DB_P, "pattern")).thenReturn(expected); List<String> result = handler.get_functions(DB_P, "pattern"); assertThat(result, is(expected)); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public Function get_function(String dbName, String funcName) throws MetaException, NoSuchObjectException, TException { DatabaseMapping mapping = databaseM... | @Test public void get_function() throws TException { Function fromClient = new Function(); Function expected = new Function(); when(primaryClient.get_function(DB_P, "funcName")).thenReturn(fromClient); when(primaryMapping.transformOutboundFunction(fromClient)).thenReturn(expected); Function result = handler.get_functio... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean create_role(Role role) throws MetaException, TException { return getPrimaryClient().create_role(role); } FederatedHMSHandler(
Mapping... | @Test public void create_role() throws TException { Role role = new Role(); handler.create_role(role); verify(primaryClient).create_role(role); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean drop_role(String role_name) throws MetaException, TException { return getPrimaryClient().drop_role(role_name); } FederatedHMSHandler(
... | @Test public void drop_role() throws TException { handler.drop_role("role"); verify(primaryClient).drop_role("role"); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<String> get_role_names() throws MetaException, TException { return getPrimaryClient().get_role_names(); } FederatedHMSHandler(
MappingEv... | @Test public void get_role_names() throws TException { List<String> roleNames = Arrays.asList("role1", "role2"); when(primaryClient.get_role_names()).thenReturn(roleNames); assertThat(handler.get_role_names(), is(roleNames)); } |
Whitelist { public boolean contains(String databaseName) { if (databaseName == null) { return true; } databaseName = trimToLowerCase(databaseName); for (Pattern whiteListEntry : whiteList) { Matcher matcher = whiteListEntry.matcher(databaseName); if (matcher.matches()) { return true; } } return false; } Whitelist(); W... | @Test public void containsTrue() { Whitelist whitelist = new Whitelist(ImmutableList.of("db_.*", "user")); assertTrue(whitelist.contains("db_test")); assertTrue(whitelist.contains("user")); }
@Test public void containsFalse() { Whitelist whitelist = new Whitelist(ImmutableList.of("db_.*", "user")); assertFalse(whitelis... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean grant_role( String role_name, String principal_name, PrincipalType principal_type, String grantor, PrincipalType grantorType, boolean grant... | @Test public void grant_role() throws TException { PrincipalType principalType = PrincipalType.findByValue(3); handler.grant_role("role", "principal", principalType, "grantor", principalType, true); verify(primaryClient).grant_role("role", "principal", principalType, "grantor", principalType, true); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean revoke_role(String role_name, String principal_name, PrincipalType principal_type) throws MetaException, TException { return getPrimaryClie... | @Test public void revoke_role() throws TException { PrincipalType principalType = PrincipalType.findByValue(3); handler.revoke_role("role", "principal", principalType); verify(primaryClient).revoke_role("role", "principal", principalType); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<Role> list_roles(String principal_name, PrincipalType principal_type) throws MetaException, TException { return getPrimaryClient().list_roles(... | @Test public void list_roles() throws TException { PrincipalType principalType = PrincipalType.findByValue(3); handler.list_roles("role", principalType); verify(primaryClient).list_roles("role", principalType); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GrantRevokeRoleResponse grant_revoke_role(GrantRevokeRoleRequest request) throws MetaException, TException { return getPrimaryClient().grant_revoke... | @Test public void grant_revoke_role() throws TException { GrantRevokeRoleRequest request = new GrantRevokeRoleRequest(); handler.grant_revoke_role(request); verify(primaryClient).grant_revoke_role(request); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetPrincipalsInRoleResponse get_principals_in_role(GetPrincipalsInRoleRequest request) throws MetaException, TException { return getPrimaryClient()... | @Test public void get_principals_in_role() throws TException { GetPrincipalsInRoleRequest request = new GetPrincipalsInRoleRequest(); handler.get_principals_in_role(request); verify(primaryClient).get_principals_in_role(request); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public GetRoleGrantsForPrincipalResponse get_role_grants_for_principal(GetRoleGrantsForPrincipalRequest request) throws MetaException, TException { return... | @Test public void get_role_grants_for_principal() throws TException { GetRoleGrantsForPrincipalRequest request = new GetRoleGrantsForPrincipalRequest(); handler.get_role_grants_for_principal(request); verify(primaryClient).get_role_grants_for_principal(request); } |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public List<HiveObjectPrivilege> list_privileges( String principal_name, PrincipalType principal_type, HiveObjectRef hiveObject) throws MetaException, TEx... | @Test public void list_privileges() throws TException { PrincipalType principalType = PrincipalType.findByValue(3); HiveObjectRef hiveObjectRef = new HiveObjectRef(); hiveObjectRef.setDbName(DB_P); HiveObjectRef inboundHiveObjectRef = new HiveObjectRef(); when(primaryMapping.transformInboundHiveObjectRef(hiveObjectRef)... |
FederatedHMSHandler extends FacebookBase implements CloseableIHMSHandler { @Override @Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) public boolean grant_privileges(PrivilegeBag privileges) throws MetaException, TException { if (privileges.isSetPrivileges() && !privileges.getPrivileges(... | @Test public void grant_privileges() throws TException { HiveObjectRef hiveObjectRef = new HiveObjectRef(); hiveObjectRef.setDbName(DB_P); HiveObjectPrivilege hiveObjectPrivilege = new HiveObjectPrivilege(); hiveObjectPrivilege.setHiveObject(hiveObjectRef); PrivilegeBag privileges = new PrivilegeBag(Collections.singlet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.