use of io.dingodb.server.coordinator.resource.impl.ExecutorView in project dingo by dingodb.
the class RowStoreMetaAdaptorImpl method mapping.
public ExecutorView mapping(Store store) {
if (store == null) {
return null;
}
GeneralId generalId = GeneralId.fromStr(store.getId());
ExecutorView view = new ExecutorView(generalId, store.getEndpoint());
store.getRegions().stream().map(Region::getId).map(GeneralIdHelper::region).forEach(view::addApp);
return view;
}
use of io.dingodb.server.coordinator.resource.impl.ExecutorView in project dingo by dingodb.
the class RowStoreMetaAdaptorImpl method saveStore.
@Override
public void saveStore(Store store) {
GeneralId id = GeneralId.fromStr(store.getId());
ExecutorView view = mapping(store);
scheduleMetaAdaptor.updateExecutorView(view);
storeMap.put(id, store);
endpointStoreId.put(store.getEndpoint(), id);
storeRegion.put(id, store.getRegions().stream().map(Region::getId).map(GeneralIdHelper::region).collect(Collectors.toCollection(ConcurrentHashSet::new)));
}
use of io.dingodb.server.coordinator.resource.impl.ExecutorView in project dingo by dingodb.
the class RowStoreMetaAdaptorImpl method mapping.
public Store mapping(ExecutorView executorView) {
if (executorView == null) {
return null;
}
Store store = new Store();
store.setEndpoint(new Endpoint(executorView.location().getHost(), executorView.location().getPort()));
store.setId(executorView.resourceId().toString());
store.setLabels(executorView.labels().entrySet().stream().map(e -> new StoreLabel(e.getKey(), e.getValue())).collect(Collectors.toList()));
store.setRegions(executorView.apps().stream().map(id -> scheduleMetaAdaptor.namespace().<RegionApp>getApp(id)).map(this::mapping).collect(Collectors.toList()));
return store;
}
use of io.dingodb.server.coordinator.resource.impl.ExecutorView in project dingo by dingodb.
the class ScheduleMetaAdaptorImpl method newExecutorView.
private ExecutorView newExecutorView(GeneralId id, Endpoint endpoint) {
ExecutorView view = new ExecutorView(id, endpoint);
updateExecutorView(view);
if (log.isDebugEnabled()) {
log.debug("Create executor view for id and endpoint, id: [{}], endpoint: [{}]", id, endpoint);
}
return view;
}
use of io.dingodb.server.coordinator.resource.impl.ExecutorView in project dingo by dingodb.
the class RowStoreMetaAdaptorImpl method saveStoreStats.
@Override
public void saveStoreStats(StoreStats storeStats) {
GeneralId id = GeneralId.fromStr(storeStats.getStoreId());
ExecutorView view = scheduleMetaAdaptor.executorView(id);
view.stats(storeStats);
scheduleMetaAdaptor.updateExecutorView(view);
storeStatsMap.put(id, storeStats);
}
Aggregations