@Test public void testGetAllTableNames() throws SQLException { when(conn.createStatement()).thenReturn(stmt); when(stmt.executeQuery(anyString())).thenReturn(rs); when(rs.next()).thenReturn(true).thenReturn(true).thenReturn(false); when(rs.getString(anyInt())).thenReturn("session_data").thenReturn("session_summary"); Iterable<String> res = serviceJdbc.getAllTableNames("default"); StringBuilder sb = new StringBuilder(); for (String s : res) { sb.append(s).append(","); } Assert.assertEquals(sb.toString(), "session_data,session_summary,"); }
@Override @Cacheable(unless = "#result==null") public Iterable<String> getAllTableNames(String dbName) { return queryHiveString(SHOW_TABLES_IN + dbName); }
HiveMetaStoreServiceJdbcImpl implements HiveMetaStoreService { @Override @Cacheable(unless = "#result==null") public Iterable<String> getAllTableNames(String dbName) { return queryHiveString(SHOW_TABLES_IN + dbName); } }
HiveMetaStoreServiceJdbcImpl implements HiveMetaStoreService { @Override @Cacheable(unless = "#result==null") public Iterable<String> getAllTableNames(String dbName) { return queryHiveString(SHOW_TABLES_IN + dbName); }  }
HiveMetaStoreServiceJdbcImpl implements HiveMetaStoreService { @Override @Cacheable(unless = "#result==null") public Iterable<String> getAllTableNames(String dbName) { return queryHiveString(SHOW_TABLES_IN + dbName); }  void setConn(Connection conn); void setHiveClassName(String hiveClassName); void setNeedKerberos(String needKerberos); void setKeytabUser(String keytabUser); void setKeytabPath(String keytabPath); @PostConstruct void init(); @Override @Cacheable(unless = "#result==null") Iterable<String> getAllDatabases(); @Override @Cacheable(unless = "#result==null") Iterable<String> getAllTableNames(String dbName); @Override @Cacheable(unless = "#result==null") Map<String, List<String>> getAllTableNames(); @Override List<Table> getAllTable(String db); @Override Map<String, List<Table>> getAllTable(); @Override @Cacheable(unless = "#result==null") Table getTable(String dbName, String tableName); @Scheduled(fixedRateString = "${cache.evict.hive.fixedRate.in.milliseconds}") @CacheEvict( cacheNames = "jdbcHive", allEntries = true, beforeInvocation = true) void evictHiveCache(); String getLocation(String tableMetadata); List<FieldSchema> getColums(String tableMetadata); String getComment(String colStr); }
HiveMetaStoreServiceJdbcImpl implements HiveMetaStoreService { @Override @Cacheable(unless = "#result==null") public Iterable<String> getAllTableNames(String dbName) { return queryHiveString(SHOW_TABLES_IN + dbName); }  void setConn(Connection conn); void setHiveClassName(String hiveClassName); void setNeedKerberos(String needKerberos); void setKeytabUser(String keytabUser); void setKeytabPath(String keytabPath); @PostConstruct void init(); @Override @Cacheable(unless = "#result==null") Iterable<String> getAllDatabases(); @Override @Cacheable(unless = "#result==null") Iterable<String> getAllTableNames(String dbName); @Override @Cacheable(unless = "#result==null") Map<String, List<String>> getAllTableNames(); @Override List<Table> getAllTable(String db); @Override Map<String, List<Table>> getAllTable(); @Override @Cacheable(unless = "#result==null") Table getTable(String dbName, String tableName); @Scheduled(fixedRateString = "${cache.evict.hive.fixedRate.in.milliseconds}") @CacheEvict( cacheNames = "jdbcHive", allEntries = true, beforeInvocation = true) void evictHiveCache(); String getLocation(String tableMetadata); List<FieldSchema> getColums(String tableMetadata); String getComment(String colStr);  }