コード例 #1
0
 def _prepare_index(self, dryrun):
     shape_descriptor = self.get_shape_descriptor()
     index_name = Config.get_es_index_name(ESIndexType.docs, self.replica, shape_descriptor)
     es_client = ElasticsearchClient.get()
     if not dryrun:
         IndexManager.create_index(es_client, self.replica, index_name)
     return index_name
コード例 #2
0
ファイル: document.py プロジェクト: HumanCellAtlas/data-store
 def _prepare_index(self, dryrun):
     shape_descriptor = self['shape_descriptor']
     if shape_descriptor is not None:
         hashed_shape_descriptor = hashlib.sha1(
             str(shape_descriptor).encode("utf-8")).hexdigest()
     else:
         hashed_shape_descriptor = ""
     index_name = Config.get_es_index_name(ESIndexType.docs, self.replica,
                                           hashed_shape_descriptor)
     es_client = ElasticsearchClient.get()
     if not dryrun:
         IndexManager.create_index(es_client, self.replica, index_name)
     return index_name
コード例 #3
0
 def setUp(self):
     super().setUp()
     self.alias_name = dss.Config.get_es_alias_name(dss.ESIndexType.docs,
                                                    self.replica)
     self.sub_index_name = dss.Config.get_es_index_name(
         dss.ESIndexType.subscriptions, self.replica)
     shape_identifier = self.index_document.get_shape_descriptor()
     self.doc_index_name = dss.Config.get_es_index_name(
         dss.ESIndexType.docs, self.replica, shape_identifier)
     es_client = ElasticsearchClient.get()
     IndexManager.create_index(es_client, self.replica, self.doc_index_name)
     es_client.index(index=self.doc_index_name,
                     doc_type=dss.ESDocType.doc.name,
                     id=str(uuid.uuid4()),
                     body=self.index_document,
                     refresh=True)
     self.callback_url = "https://example.com"
     self.sample_percolate_query = smartseq2_paired_ends_v2_or_v3_query
コード例 #4
0
 def setUp(self):
     super().setUp()
     self.alias_name = dss.Config.get_es_alias_name(dss.ESIndexType.docs, self.replica)
     self.sub_index_name = dss.Config.get_es_index_name(dss.ESIndexType.subscriptions, self.replica)
     shape_identifier = self.index_document._get_shape_descriptor()
     shape_identifier = hashlib.sha1(f"{shape_identifier}".encode("utf-8")).hexdigest()
     self.doc_index_name = dss.Config.get_es_index_name(dss.ESIndexType.docs, self.replica, shape_identifier)
     es_client = ElasticsearchClient.get()
     IndexManager.create_index(es_client, self.replica, self.doc_index_name)
     es_client.index(index=self.doc_index_name,
                     doc_type=dss.ESDocType.doc.name,
                     id=str(uuid.uuid4()),
                     body=self.index_document,
                     refresh=True)
     self.endpoint = Endpoint(callback_url="https://example.com",
                              method="POST",
                              encoding="application/json",
                              form_fields={'foo': 'bar'},
                              payload_form_field='baz')
     self.sample_percolate_query = smartseq2_paired_ends_vx_query
     self.hmac_key_id = 'dss_test'
     self.hmac_secret_key = '23/33'
コード例 #5
0
 def setUp(self):
     super().setUp()
     self.dss_index_name = dss.Config.get_es_index_name(
         dss.ESIndexType.docs, self.replica)
     es_client = ElasticsearchClient.get()
     IndexManager.create_index(es_client, self.replica, self.dss_index_name)