Package ghidra.features.bsim.query.file
Class H2VectorTable
java.lang.Object
ghidra.features.bsim.query.client.tables.SQLComplexTable
ghidra.features.bsim.query.file.H2VectorTable
-
Field Summary
FieldsFields inherited from class ghidra.features.bsim.query.client.tables.SQLComplexTable
db, idColumnName, tableName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Creates the db table.int
delete
(long id) Deletes the row with the given id from the db.int
deleteVector
(long id, int countDiff) Update vector table entry with the specified countDiff.void
Drops the current table.long
Inserts a row(s) into the db.queryVectorById
(long id) Get vector details which correspond to specified vector IDRead all vectors from table and generate an ID-based vector maplong
updateVector
(LSHVector vec, int countDiff) Update or insert vector table entry with the specified positive countDiff.Methods inherited from class ghidra.features.bsim.query.client.tables.SQLComplexTable
setConnection
-
Field Details
-
TABLE_NAME
- See Also:
-
-
Constructor Details
-
H2VectorTable
-
-
Method Details
-
close
public void close()- Overrides:
close
in classSQLComplexTable
-
create
Description copied from class:SQLComplexTable
Creates the db table.- Specified by:
create
in classSQLComplexTable
- Parameters:
st
- the query statement- Throws:
SQLException
- if there is a problem
-
drop
Description copied from class:SQLComplexTable
Drops the current table. NOTE: If explicitly created index tables exist they should be removed first or this method override.- Overrides:
drop
in classSQLComplexTable
- Parameters:
st
- the query statement- Throws:
SQLException
- if there is a problem with the execute update command
-
insert
Description copied from class:SQLComplexTable
Inserts a row(s) into the db. The arguments passed to this function are by definition not known, so they are left as a variable-length list ofObject
instances, to be interpreted by the implementer.- Specified by:
insert
in classSQLComplexTable
- Parameters:
arguments
- any arguments required for the insert- Returns:
- to be defined by the implementor
- Throws:
SQLException
- if there is a problem executing the insert command
-
readVectors
Read all vectors from table and generate an ID-based vector map- Returns:
- vector map (ID->VectorStoreEntry)
- Throws:
SQLException
- if error occurs
-
queryVectorById
Get vector details which correspond to specified vector ID- Parameters:
id
- vector ID- Returns:
- vector details
- Throws:
SQLException
- if error occurs
-
updateVector
Update or insert vector table entry with the specified positive countDiff.- Parameters:
vec
- vectorcountDiff
- positive vector count change- Returns:
- vector ID which was updated or created
- Throws:
SQLException
- if an error occurs
-
deleteVector
Update vector table entry with the specified countDiff. Record will be removed if reduced vector count less-than-or-equal zero.- Parameters:
id
- vector IDcountDiff
- positive vector count reduction- Returns:
- 0 if decrement short of 0, return 1 if record was removed, return -1 if there was a problem
- Throws:
SQLException
- if an error occurs
-
delete
Description copied from class:SQLComplexTable
Deletes the row with the given id from the db. Users must set theDELETE_STMT
string to delete the exact table they need.- Overrides:
delete
in classSQLComplexTable
- Parameters:
id
- the database row ID- Returns:
- the number of deleted rows
- Throws:
SQLException
- if there is a problem creating or executing the query
-