Search in sources :

Example 1 with StoreLabel

use of io.dingodb.store.row.metadata.StoreLabel 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;
}
Also used : ExecutorView(io.dingodb.server.coordinator.resource.impl.ExecutorView) StoreStats(io.dingodb.store.row.metadata.StoreStats) GeneralId(io.dingodb.server.coordinator.GeneralId) RegionView(io.dingodb.server.coordinator.app.impl.RegionView) StoreLabel(io.dingodb.store.row.metadata.StoreLabel) BigDecimal(java.math.BigDecimal) RowStoreMetaAdaptor(io.dingodb.server.coordinator.meta.RowStoreMetaAdaptor) Map(java.util.Map) Optional(io.dingodb.common.util.Optional) RegionEpoch(io.dingodb.store.row.metadata.RegionEpoch) Store(io.dingodb.store.row.metadata.Store) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Region(io.dingodb.store.row.metadata.Region) Set(java.util.Set) GeneralIdHelper(io.dingodb.server.coordinator.meta.GeneralIdHelper) Peer(io.dingodb.store.row.metadata.Peer) Collectors(java.util.stream.Collectors) Cluster(io.dingodb.store.row.metadata.Cluster) ScheduleMetaAdaptor(io.dingodb.server.coordinator.meta.ScheduleMetaAdaptor) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) ConcurrentHashSet(com.alipay.remoting.util.ConcurrentHashSet) RegionStats(io.dingodb.store.row.metadata.RegionStats) RegionApp(io.dingodb.server.coordinator.app.impl.RegionApp) Endpoint(io.dingodb.raft.util.Endpoint) StoreLabel(io.dingodb.store.row.metadata.StoreLabel) Endpoint(io.dingodb.raft.util.Endpoint) Store(io.dingodb.store.row.metadata.Store) RegionApp(io.dingodb.server.coordinator.app.impl.RegionApp)

Aggregations

ConcurrentHashSet (com.alipay.remoting.util.ConcurrentHashSet)1 Optional (io.dingodb.common.util.Optional)1 Endpoint (io.dingodb.raft.util.Endpoint)1 GeneralId (io.dingodb.server.coordinator.GeneralId)1 RegionApp (io.dingodb.server.coordinator.app.impl.RegionApp)1 RegionView (io.dingodb.server.coordinator.app.impl.RegionView)1 GeneralIdHelper (io.dingodb.server.coordinator.meta.GeneralIdHelper)1 RowStoreMetaAdaptor (io.dingodb.server.coordinator.meta.RowStoreMetaAdaptor)1 ScheduleMetaAdaptor (io.dingodb.server.coordinator.meta.ScheduleMetaAdaptor)1 ExecutorView (io.dingodb.server.coordinator.resource.impl.ExecutorView)1 Cluster (io.dingodb.store.row.metadata.Cluster)1 Peer (io.dingodb.store.row.metadata.Peer)1 Region (io.dingodb.store.row.metadata.Region)1 RegionEpoch (io.dingodb.store.row.metadata.RegionEpoch)1 RegionStats (io.dingodb.store.row.metadata.RegionStats)1 Store (io.dingodb.store.row.metadata.Store)1 StoreLabel (io.dingodb.store.row.metadata.StoreLabel)1 StoreStats (io.dingodb.store.row.metadata.StoreStats)1 BigDecimal (java.math.BigDecimal)1 List (java.util.List)1