Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
j_qbuilder = config.MODULE__core_store.QueryBuilder.newBuilder()
super().__init__(config.GATEWAY, j_qbuilder)
def add_index(self, type_name, *indices):
"""
Add new indices for a given data type.
Args:
type_name (str) : name of data type to register indices to
*indices (pygw.base_models.Index) : Index to add
"""
assert isinstance(type_name,str)
n = len(indices)
j_index_class = config.MODULE__core_store.Index
j_index_arr = config.GATEWAY.new_array(j_index_class,n)
for idx, py_obj in enumerate(indices):
j_index_arr[idx] = py_obj._java_ref
self._java_ref.addType(type_name,j_index_arr)
that works for a given file.
Args:
url (str) : The URL for data to read and ingest into this data store
*indices (pygw.base_models.Index) : Index to ingest into
ingest_options : Options for ingest
"""
# TODO: Ingest Options
if ingest_options: raise NotImplementedError()
# TODO: Not Fully implemented!
assert isinstance(url,str)
n = len(indices)
j_index_class = config.MODULE__core_store.Index
j_index_arr = config.GATEWAY.new_array(j_index_class,n)
for idx, name in enumerate(indices):
j_index_arr[idx] = name._java_ref
java_url = config.GATEWAY.jvm.java.net.URL(url)
self._java_ref.ingest(java_url,ingest_options,j_index_arr)