-
Notifications
You must be signed in to change notification settings - Fork 439
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
issue=#1281: add observer implement, including executor, multi-thread scan and trigger calculation etc. #1288
base: master
Are you sure you want to change the base?
Conversation
src/observer/executor/scanner.cc
Outdated
bool ret = true; | ||
tera::ScanDescriptor desc(start_key); | ||
desc.SetAsync(FLAGS_observer_scan_async_switch); | ||
// Notify�д洢�ڵ���lg |
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.
请将这个设置成恒true
include/observer/observer.h
Outdated
class Observer { | ||
public: | ||
// ����۲���Ψһ��ʾ���Լ����۲��� | ||
Observer(const std::string& observer_name, ColumnList& observed_columns); |
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.
observed_columns放在构造函数里参数不太好, 作为observe的参数比较好
include/observer/executor.h
Outdated
namespace observer { | ||
|
||
/// ִ���� | ||
class Executor { |
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.
Executor不是用户要实现的接口吧?
include/observer/observer.h
Outdated
virtual bool Init(); | ||
|
||
// �û�ʵ�ִ˽ӿ��������� | ||
virtual bool Close(); |
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接口不需要吧
} | ||
|
||
bool Observer::Ack(ColumnList& columns, const std::string& row, int64_t timestamp) { | ||
return ExecutorImpl::SetOrClearNotification(columns, row, timestamp, kClearNotification); |
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.
应该实现在transaction里
src/observer/executor/tuple.h
Outdated
int64_t timestamp; | ||
}; | ||
|
||
typedef boost::shared_ptr<Tuple> TuplePtr; |
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.
别用boost了, 基本的库用c++11
include/observer/observer.h
Outdated
virtual ~Observer(); | ||
|
||
// �û�ʵ�ִ˽ӿ��õ��۲����ϱ仯���, ��ɼ��� | ||
virtual bool OnNotify(tera::Transaction* t, |
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.
返回status好一些
} | ||
|
||
bool Observer::OnNotify(tera::Transaction* t, | ||
tera::Table* table, |
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.
应该不需要传table的指针, 可以传入tablename, observer读写tera都通过transaction
No description provided.