test_class.declarator: elasticsearchServer
test_class.modifier: private
test_class.original_string: private MockElasticsearchServer elasticsearchServer;
test_class.type: MockElasticsearchServer
test_class.var_name: elasticsearchServer
test_class.declarator: dataStore
test_class.modifier: private
test_class.original_string: private DataStore dataStore;
test_class.type: DataStore
test_class.var_name: dataStore
test_class.declarator: queryStore
test_class.modifier: private
test_class.original_string: private ElasticsearchQueryStore queryStore;
test_class.type: ElasticsearchQueryStore
test_class.var_name: queryStore
test_class.declarator: mapper
test_class.modifier: private
test_class.original_string: private ObjectMapper mapper;
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.file: real-time/foxtrot/foxtrot-core/src/test/java/com/flipkart/foxtrot/core/querystore/impl/ElasticsearchQueryStoreTest.java
test_class.identifier: ElasticsearchQueryStoreTest
test_case.body: @Test
      public void testGetFieldMappingsNonExistingTable() throws QueryStoreException {
          try {
              queryStore.getFieldMappings(TestUtils.TEST_TABLE + "-test");
              fail();
          } catch (QueryStoreException qse) {
              assertEquals(QueryStoreException.ErrorCode.NO_SUCH_TABLE, qse.getErrorCode());
          }
      }
test_case.class_method_signature: ElasticsearchQueryStoreTest.testGetFieldMappingsNonExistingTable()
test_case.full_signature: @Test public void testGetFieldMappingsNonExistingTable()
test_case.identifier: testGetFieldMappingsNonExistingTable
test_case.invocations: getFieldMappings fail assertEquals getErrorCode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetFieldMappingsNonExistingTable()
focal_class.declarator: logger = LoggerFactory.getLogger(ElasticsearchQueryStore.class.getSimpleName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ElasticsearchQueryStore.class.getSimpleName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: tableMetadataManager
focal_class.modifier: private final
focal_class.original_string: private final TableMetadataManager tableMetadataManager;
focal_class.type: TableMetadataManager
focal_class.var_name: tableMetadataManager
focal_class.declarator: connection
focal_class.modifier: private final
focal_class.original_string: private final ElasticsearchConnection connection;
focal_class.type: ElasticsearchConnection
focal_class.var_name: connection
focal_class.declarator: dataStore
focal_class.modifier: private final
focal_class.original_string: private final DataStore dataStore;
focal_class.type: DataStore
focal_class.var_name: dataStore
focal_class.declarator: mapper
focal_class.modifier: private final
focal_class.original_string: private final ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.file: real-time/foxtrot/foxtrot-core/src/main/java/com/flipkart/foxtrot/core/querystore/impl/ElasticsearchQueryStore.java
focal_class.identifier: ElasticsearchQueryStore
focal_class.interfaces: implements QueryStore
focal_class.class_method_signature: ElasticsearchQueryStore.ElasticsearchQueryStore(TableMetadataManager tableMetadataManager,
                                     ElasticsearchConnection connection,
                                     DataStore dataStore)
focal_class.full_signature: public  ElasticsearchQueryStore(TableMetadataManager tableMetadataManager,
                                     ElasticsearchConnection connection,
                                     DataStore dataStore)
focal_class.identifier: ElasticsearchQueryStore
focal_class.modifiers: public
focal_class.parameters: (TableMetadataManager tableMetadataManager,
                                     ElasticsearchConnection connection,
                                     DataStore dataStore)
focal_class.signature:  ElasticsearchQueryStore(TableMetadataManager tableMetadataManager,
                                     ElasticsearchConnection connection,
                                     DataStore dataStore)
focal_class.class_method_signature: ElasticsearchQueryStore.save(String table, Document document)
focal_class.full_signature: @Override public void save(String table, Document document)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (String table, Document document)
focal_class.return: void
focal_class.signature: void save(String table, Document document)
focal_class.class_method_signature: ElasticsearchQueryStore.save(String table, List<Document> documents)
focal_class.full_signature: @Override public void save(String table, List<Document> documents)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (String table, List<Document> documents)
focal_class.return: void
focal_class.signature: void save(String table, List<Document> documents)
focal_class.class_method_signature: ElasticsearchQueryStore.get(String table, String id)
focal_class.full_signature: @Override public Document get(String table, String id)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (String table, String id)
focal_class.return: Document
focal_class.signature: Document get(String table, String id)
focal_class.class_method_signature: ElasticsearchQueryStore.get(String table, List<String> ids)
focal_class.full_signature: @Override public List<Document> get(String table, List<String> ids)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (String table, List<String> ids)
focal_class.return: List<Document>
focal_class.signature: List<Document> get(String table, List<String> ids)
focal_class.class_method_signature: ElasticsearchQueryStore.getFieldMappings(String table)
focal_class.full_signature: @Override public TableFieldMapping getFieldMappings(String table)
focal_class.identifier: getFieldMappings
focal_class.modifiers: @Override public
focal_class.parameters: (String table)
focal_class.return: TableFieldMapping
focal_class.signature: TableFieldMapping getFieldMappings(String table)
focal_class.class_method_signature: ElasticsearchQueryStore.cleanupAll()
focal_class.full_signature: @Override public void cleanupAll()
focal_class.identifier: cleanupAll
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cleanupAll()
focal_class.class_method_signature: ElasticsearchQueryStore.cleanup(final String table)
focal_class.full_signature: @Override public void cleanup(final String table)
focal_class.identifier: cleanup
focal_class.modifiers: @Override public
focal_class.parameters: (final String table)
focal_class.return: void
focal_class.signature: void cleanup(final String table)
focal_class.class_method_signature: ElasticsearchQueryStore.cleanup(Set<String> tables)
focal_class.full_signature: @Override public void cleanup(Set<String> tables)
focal_class.identifier: cleanup
focal_class.modifiers: @Override public
focal_class.parameters: (Set<String> tables)
focal_class.return: void
focal_class.signature: void cleanup(Set<String> tables)
focal_method.body: @Override
      public TableFieldMapping getFieldMappings(String table) throws QueryStoreException {
          table = ElasticsearchUtils.getValidTableName(table);
          try {
              if (!tableMetadataManager.exists(table)) {
                  throw new QueryStoreException(QueryStoreException.ErrorCode.NO_SUCH_TABLE,
                          "No table exists with the name: " + table);
              }
  
              ElasticsearchMappingParser mappingParser = new ElasticsearchMappingParser(mapper);
              Set<FieldTypeMapping> mappings = new HashSet<FieldTypeMapping>();
              GetMappingsResponse mappingsResponse = connection.getClient().admin()
                      .indices().prepareGetMappings(ElasticsearchUtils.getIndices(table)).execute().actionGet();
  
              for (ObjectCursor<String> index : mappingsResponse.getMappings().keys()) {
                  MappingMetaData mappingData = mappingsResponse.mappings().get(index.value).get(ElasticsearchUtils.TYPE_NAME);
                  mappings.addAll(mappingParser.getFieldMappings(mappingData));
              }
              return new TableFieldMapping(table, mappings);
          } catch (QueryStoreException ex) {
              throw ex;
          } catch (Exception ex) {
              throw new QueryStoreException(QueryStoreException.ErrorCode.METADATA_FETCH_ERROR,
                      ex.getMessage(), ex);
          }
      }
focal_method.class_method_signature: ElasticsearchQueryStore.getFieldMappings(String table)
focal_method.full_signature: @Override public TableFieldMapping getFieldMappings(String table)
focal_method.identifier: getFieldMappings
focal_method.invocations: getValidTableName exists actionGet execute prepareGetMappings indices admin getClient getIndices keys getMappings get get mappings addAll getFieldMappings getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (String table)
focal_method.return: TableFieldMapping
focal_method.signature: TableFieldMapping getFieldMappings(String table)