Exemple #1
0
 @Override
 public boolean hasIndex(@NotNull ValueTable valueTable) {
   ClusterStateResponse resp =
       opalSearchService.getClient().admin().cluster().prepareState().execute().actionGet();
   ImmutableOpenMap<String, MappingMetaData> mappings =
       resp.getState().metaData().index(getName()).mappings();
   return mappings.containsKey(getIndex(valueTable).getIndexName());
 }
Exemple #2
0
 @NotNull
 protected IndexMetaData createIndex() {
   IndicesAdminClient idxAdmin = opalSearchService.getClient().admin().indices();
   if (!idxAdmin.exists(new IndicesExistsRequest(getName())).actionGet().isExists()) {
     log.info("Creating index [{}]", getName());
     idxAdmin.prepareCreate(getName()).setSettings(getIndexSettings()).execute().actionGet();
   }
   return opalSearchService
       .getClient()
       .admin()
       .cluster()
       .prepareState()
       .setIndices(getName())
       .execute()
       .actionGet()
       .getState()
       .getMetaData()
       .index(getName());
 }
Exemple #3
0
 @Override
 public boolean isReady() {
   return opalSearchService.isEnabled() && indexConfig.getConfig().isEnabled();
 }