Skip to content

Commit

Permalink
Fix memidx dump (#2247)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Fix: add delta log of dump by line task in txn bottom instead of in back
ground thread.

Issue link:#2215

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Test cases

---------

Signed-off-by: Jin Hai <[email protected]>
Co-authored-by: Jin Hai <[email protected]>
  • Loading branch information
small-turtle-1 and JinHai-CN authored Nov 17, 2024
1 parent b74c2b6 commit bc05b3f
Show file tree
Hide file tree
Showing 37 changed files with 2,288 additions and 37 deletions.
10 changes: 10 additions & 0 deletions python/infinity_sdk/infinity/remote_thrift/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,13 @@ def drop_columns(self, db_name: str, table_name: str, column_names: list):

def cleanup(self):
return self.client.Cleanup(CommonRequest(session_id=self.session_id))

def command(self, command: ttypes.CommandRequest):
command.session_id = self.session_id
print(command)
return self.client.Command(command)

def flush(self, flush_request: ttypes.FlushRequest):
flush_request.session_id = self.session_id
print(flush_request)
return self.client.Flush(flush_request)
16 changes: 16 additions & 0 deletions python/infinity_sdk/infinity/remote_thrift/infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ def optimize(self, db_name: str, table_name: str, optimize_opt: ttypes.OptimizeO
else:
raise InfinityException(res.error_code, res.error_msg)

def test_command(self, command_content: str):
command = ttypes.CommandRequest()
command.command_type = "test_command"
command.test_command_content = command_content
self._client.command(command)

def flush_data(self):
flush_request = ttypes.FlushRequest()
flush_request.flush_type = "data"
self._client.flush(flush_request)

def flush_delta(self):
flush_request = ttypes.FlushRequest()
flush_request.flush_type = "delta"
self._client.flush(flush_request)

def disconnect(self):
res = self._client.disconnect()
if res.error_code == ErrorCode.OK:
Expand Down
Loading

0 comments on commit bc05b3f

Please sign in to comment.