DistributedTableMetadataManager implements TableMetadataManager { @Override public Table get(String tableName) throws Exception { logger.info(String.format("Getting Table : %s", tableName)); if (tableDataStore.containsKey(tableName)) { return tableDataStore.get(tableName); } return null; } DistributedTableMetadataManager(HazelcastConnection hazelcastConnection,
                                           ElasticsearchConnection elasticsearchConnection); @Override void save(Table table); @Override Table get(String tableName); @Override List<Table> get(); @Override boolean exists(String tableName); @Override void delete(String tableName); @Override void start(); @Override void stop(); static final String DATA_MAP; }
@Test public void testGet() throws Exception { Table table = new Table(); table.setName(TestUtils.TEST_TABLE_NAME); table.setTtl(60); tableDataStore.put(TestUtils.TEST_TABLE_NAME, table); Table response = distributedTableMetadataManager.get(table.getName()); assertEquals(table.getName(), response.getName()); assertEquals(table.getTtl(), response.getTtl()); }
@Test public void testGetMissingTable() throws Exception { Table response = distributedTableMetadataManager.get(TestUtils.TEST_TABLE + "-missing"); assertNull(response); }