Class H2VectorTable

java.lang.Object
ghidra.features.bsim.query.client.tables.SQLComplexTable
ghidra.features.bsim.query.file.H2VectorTable

public class H2VectorTable extends SQLComplexTable
  • Field Details

  • Constructor Details

  • Method Details

    • close

      public void close()
      Overrides:
      close in class SQLComplexTable
    • create

      public void create(Statement st) throws SQLException
      Description copied from class: SQLComplexTable
      Creates the db table.
      Specified by:
      create in class SQLComplexTable
      Parameters:
      st - the query statement
      Throws:
      SQLException - if there is a problem
    • drop

      public void drop(Statement st) throws SQLException
      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 class SQLComplexTable
      Parameters:
      st - the query statement
      Throws:
      SQLException - if there is a problem with the execute update command
    • insert

      public long insert(Object... arguments) throws SQLException
      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 of Object instances, to be interpreted by the implementer.
      Specified by:
      insert in class SQLComplexTable
      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

      public Map<Long,VectorStoreEntry> readVectors() throws SQLException
      Read all vectors from table and generate an ID-based vector map
      Returns:
      vector map (ID->VectorStoreEntry)
      Throws:
      SQLException - if error occurs
    • queryVectorById

      public VectorResult queryVectorById(long id) throws SQLException
      Get vector details which correspond to specified vector ID
      Parameters:
      id - vector ID
      Returns:
      vector details
      Throws:
      SQLException - if error occurs
    • updateVector

      public long updateVector(LSHVector vec, int countDiff) throws SQLException
      Update or insert vector table entry with the specified positive countDiff.
      Parameters:
      vec - vector
      countDiff - positive vector count change
      Returns:
      vector ID which was updated or created
      Throws:
      SQLException - if an error occurs
    • deleteVector

      public int deleteVector(long id, int countDiff) throws SQLException
      Update vector table entry with the specified countDiff. Record will be removed if reduced vector count less-than-or-equal zero.
      Parameters:
      id - vector ID
      countDiff - 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

      public int delete(long id) throws SQLException
      Description copied from class: SQLComplexTable
      Deletes the row with the given id from the db. Users must set the DELETE_STMT string to delete the exact table they need.
      Overrides:
      delete in class SQLComplexTable
      Parameters:
      id - the database row ID
      Returns:
      the number of deleted rows
      Throws:
      SQLException - if there is a problem creating or executing the query