Search in sources :

Example 6 with Peer

use of io.dingodb.store.row.metadata.Peer in project dingo by dingodb.

the class RowStoreMetaAdaptorImpl method mapping.

public Region mapping(RegionApp regionApp) {
    if (regionApp == null) {
        return null;
    }
    String regionId = regionApp.regionId();
    RegionView regionView = scheduleMetaAdaptor.regionView(regionApp.view());
    List<Peer> peerIds = regionView.nodeResources().stream().map(id -> new Peer(regionId, id.toString(), GeneralIdHelper.storeEndpoint(id))).collect(Collectors.toList());
    return new Region(regionId, regionApp.startKey(), regionApp.endKey(), new RegionEpoch(regionApp.version(), regionView.confVer()), peerIds);
}
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) RegionView(io.dingodb.server.coordinator.app.impl.RegionView) Peer(io.dingodb.store.row.metadata.Peer) Region(io.dingodb.store.row.metadata.Region) RegionEpoch(io.dingodb.store.row.metadata.RegionEpoch)

Aggregations

Peer (io.dingodb.store.row.metadata.Peer)6 Endpoint (io.dingodb.raft.util.Endpoint)3 RegionStats (io.dingodb.store.row.metadata.RegionStats)3 GeneralId (io.dingodb.server.coordinator.GeneralId)2 RegionApp (io.dingodb.server.coordinator.app.impl.RegionApp)2 RegionView (io.dingodb.server.coordinator.app.impl.RegionView)2 Set (java.util.Set)2 ConcurrentHashSet (com.alipay.remoting.util.ConcurrentHashSet)1 Optional (io.dingodb.common.util.Optional)1 ClusterStatsManager (io.dingodb.server.coordinator.meta.ClusterStatsManager)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 ApproximateKVStats (io.dingodb.store.row.ApproximateKVStats)1 Cluster (io.dingodb.store.row.metadata.Cluster)1 Instruction (io.dingodb.store.row.metadata.Instruction)1 Region (io.dingodb.store.row.metadata.Region)1 RegionEpoch (io.dingodb.store.row.metadata.RegionEpoch)1 Store (io.dingodb.store.row.metadata.Store)1