MCPcopy Create free account
hub / github.com/baidu/tera / SyncTabletsSchemaHandler

Method SyncTabletsSchemaHandler

src/master/update_table_procedure.cc:147–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void UpdateTableProcedure::SyncTabletsSchemaHandler(const UpdateTablePhase&) {
148 if (sync_tablets_schema_) {
149 return;
150 }
151 sync_tablets_schema_.store(true);
152 PROC_LOG(INFO) << "begin sync tablets schema";
153 tablet_sync_cnt_++;
154 // No LoadTabletProcedure will be issued once the tablet falls into
155 // kTabletOffline status while
156 // UpdateTableProcedure is running, because UpdateTableProcedure has got the
157 // tablet's TransitionLocks.
158 // So UpdateTableProcedure should takes of those offline tablets by issue
159 // LoadTabletProcedure for
160 // those tablets at the right point of time.
161 for (std::size_t i = 0; i < tablet_list_.size(); ++i) {
162 TabletPtr tablet = tablet_list_[i];
163 if (tablet->GetStatus() == TabletMeta::kTabletOffline) {
164 offline_tablets_.emplace_back(tablet);
165 continue;
166 }
167 UpdateClosure done = std::bind(&UpdateTableProcedure::UpdateTabletSchemaCallback, this, tablet,
168 0, _1, _2, _3, _4);
169 NoticeTabletSchemaUpdate(tablet_list_[i], done);
170 tablet_sync_cnt_++;
171 }
172 if (--tablet_sync_cnt_ == 0) {
173 RecoverOfflineTablets();
174 table_->CommitUpdate();
175 PROC_VLOG(23) << "sync tablets schema finished";
176 EnterPhaseWithResponseStatus(kMasterOk, UpdateTablePhase::kEofPhase);
177 }
178}
179
180void UpdateTableProcedure::NoticeTabletSchemaUpdate(TabletPtr tablet, UpdateClosure done) {
181 tabletnode::TabletNodeClient node_client(thread_pool_, tablet->GetServerAddr());

Callers

nothing calls this directly

Calls 3

CommitUpdateMethod · 0.80
sizeMethod · 0.45
GetStatusMethod · 0.45

Tested by

no test coverage detected