Skip to content

Conversation

@FessGo
Copy link
Collaborator

@FessGo FessGo commented Jun 8, 2017

No description provided.

bool ret = true;
tera::ScanDescriptor desc(start_key);
desc.SetAsync(FLAGS_observer_scan_async_switch);
// Notify�д洢�ڵ���lg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请将这个设置成恒true

@caijieming-ng
Copy link
Collaborator

#1281

class Observer {
public:
// ����۲���Ψһ��ʾ���Լ����۲���
Observer(const std::string& observer_name, ColumnList& observed_columns);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

observed_columns放在构造函数里参数不太好, 作为observe的参数比较好

namespace observer {

/// ִ����
class Executor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executor不是用户要实现的接口吧?

virtual bool Init();

// �û�ʵ�ִ˽ӿ�����������
virtual bool Close();
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该实现在transaction里

int64_t timestamp;
};

typedef boost::shared_ptr<Tuple> TuplePtr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

别用boost了, 基本的库用c++11

virtual ~Observer();

// �û�ʵ�ִ˽ӿ��õ��۲����ϱ仯����, ��ɼ���
virtual bool OnNotify(tera::Transaction* t,
Copy link
Member

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,
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants