-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine scalar storage #205
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev #205 +/- ##
==========================================
+ Coverage 92.17% 92.89% +0.71%
==========================================
Files 42 42
Lines 1278 1365 +87
==========================================
+ Hits 1178 1268 +90
+ Misses 100 97 -3
|
gptcache/manager/scalar_data/base.py
Outdated
@@ -56,7 +61,3 @@ def get_old_access(self, count): | |||
@abstractmethod | |||
def get_old_create(self, count): | |||
pass | |||
|
|||
@abstractmethod | |||
def close(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close the session, and it is also possible to do more things when the cache is turned off in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
gptcache/manager/data_manager.py
Outdated
@@ -199,9 +199,6 @@ def import_data( | |||
def get_scalar_data(self, res_data, **kwargs): | |||
return self.s.get_data_by_id(res_data[1]) | |||
|
|||
def update_access_time(self, res_data, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recover it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
) | ||
else: | ||
id = Column(Integer, primary_key=True, autoincrement=True) | ||
question = Column(String(6000), nullable=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe keep the origin size, 1000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
self._ques, self._answer = get_models(table_name, db_type) | ||
self._engine = create_engine(self._url) | ||
self.Session = sessionmaker(bind=self._engine) # pylint: disable=invalid-name | ||
self._session = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no use, can delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
mark_ids = [i[0] for i in mark_ids] | ||
self._scalar_storage.remove_by_state() | ||
mark_ids = self._scalar_storage.get_ids(deleted=True) | ||
self._scalar_storage.clear_deleted_data() | ||
self._vector_base.delete(mark_ids) | ||
|
||
def rebuild(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the call of this method in subsequent development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next week, we will implement the eviction process. For now, just keep the code correct.
self._ques.__table__.create(bind=self._engine, checkfirst=True) | ||
self._answer.__table__.create(bind=self._engine, checkfirst=True) | ||
|
||
def _insert(self, data: CacheData, session: "Session"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use Session
, not string, which is sqlalchemy.orm.Session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: junjiejiangjjj, SimFG The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.