Abstract
index
/home/yangxuan/vecwise_engine/python/sdk/client/Abstract.py

 
Classes
       
builtins.object
ConnectIntf
QueryResult
Range
RowRecord
TableSchema
TopKQueryResult
enum.IntEnum(builtins.int, enum.Enum)
IndexType

 
class ConnectIntf(builtins.object)
    SDK client abstract class
 
Connection is a abstract class
 
  Methods defined here:
add_vectors(self, table_name, records)
Add vectors to table
Should be implemented
 
:type  table_name: str
:param table_name: table name been inserted
 
:type  records: list[RowRecord]
:param records: list of vectors been inserted
 
:returns
    Status : indicate if vectors inserted successfully
    ids :list of id, after inserted every vector is given a id
client_version(self)
Provide client version
should be implemented
 
:return: str, client version
connect(self, host=None, port=None, uri=None)
Connect method should be called before any operations
Server will be connected after connect return OK
Should be implemented
 
:type  host: str
:param host: host
 
:type  port: str
:param port: port
 
:type  uri: str
:param uri: (Optional) uri
 
:return Status,  indicate if connect is successful
connected(self)
connected, connection status
Should be implemented
 
:return Status,  indicate if connect is successful
create_table(self, param)
Create table
Should be implemented
 
:type  param: TableSchema
:param param: provide table information to be created
 
:return Status, indicate if connect is successful
delete_table(self, table_name)
Delete table
Should be implemented
 
:type  table_name: str
:param table_name: table_name of the deleting table
 
:return Status, indicate if connect is successful
describe_table(self, table_name)
Show table information
Should be implemented
 
:type  table_name: str
:param table_name: which table to be shown
 
:returns
    Status: indicate if query is successful
    table_schema: TableSchema, given when operation is successful
disconnect(self)
Disconnect, server will be disconnected after disconnect return SUCCESS
Should be implemented
 
:return Status,  indicate if connect is successful
get_table_row_count(self, table_name)
Get table row count
Should be implemented
 
:type  table_name, str
:param table_name, target table name.
 
:returns
    Status: indicate if operation is successful
    count: int, table row count
search_vectors(self, table_name, query_records, query_ranges, top_k)
Query vectors in a table
Should be implemented
 
:type  table_name: str
:param table_name: table name been queried
 
:type  query_records: list[RowRecord]
:param query_records: all vectors going to be queried
 
:type  query_ranges: list[Range]
:param query_ranges: Optional ranges for conditional search.
    If not specified, search whole table
 
:type  top_k: int
:param top_k: how many similar vectors will be searched
 
:returns
    Status:  indicate if query is successful
    query_results: list[TopKQueryResult]
server_status(self, cmd)
Provide server status
should be implemented
:type cmd, str
 
:return: str, server status
server_version(self)
Provide server version
should be implemented
 
:return: str, server version
show_tables(self)
Show all tables in database
should be implemented
 
:return
    Status: indicate if this operation is successful
    tables: list[str], list of table names

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class IndexType(enum.IntEnum)
    An enumeration.
 
 
Method resolution order:
IndexType
enum.IntEnum
builtins.int
enum.Enum
builtins.object

Data and other attributes defined here:
IDMAP = <IndexType.IDMAP: 1>
INVALIDE = <IndexType.INVALIDE: 0>
IVFLAT = <IndexType.IVFLAT: 2>

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Data descriptors inherited from enum.EnumMeta:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class QueryResult(builtins.object)
    Query result
 
:type  id: int64
:param id: id of the vector
 
:type  score: float
:param score: Vector similarity 0 <= score <= 100
 
  Methods defined here:
__init__(self, id, score)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Range(builtins.object)
    Range information
 
:type  start: str
:param start: Range start value
 
:type  end: str
:param end: Range end value
 
  Methods defined here:
__init__(self, start, end)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class RowRecord(builtins.object)
    Record inserted
 
:type  vector_data: binary str
:param vector_data: (Required) a vector
 
  Methods defined here:
__init__(self, vector_data)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class TableSchema(builtins.object)
    Table Schema
 
:type  table_name: str
:param table_name: (Required) name of table
 
:type  index_type: IndexType
:param index_type: (Optional) index type, default = 0
 
    `IndexType`: 0-invalid, 1-idmap, 2-ivflat
 
:type  dimension: int64
:param dimension: (Required) dimension of vector
 
:type  store_raw_vector: bool
:param store_raw_vector: (Optional) default = False
 
  Methods defined here:
__init__(self, table_name, dimension=0, index_type=<IndexType.INVALIDE: 0>, store_raw_vector=False)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class TopKQueryResult(builtins.object)
    TopK query results
 
:type  query_results: list[QueryResult]
:param query_results: TopK query results
 
  Methods defined here:
__init__(self, query_results)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)