Search in sources :

Example 6 with MetadataStore

use of com.alipay.sofa.jraft.rhea.MetadataStore in project sofa-jraft by sofastack.

the class RegionStatsPersistenceHandler method readMessage.

@Override
public void readMessage(final HandlerContext ctx, final RegionPingEvent event) throws Exception {
    final MetadataStore metadataStore = event.getMetadataStore();
    final RegionHeartbeatRequest request = event.getMessage();
    // sync
    metadataStore.batchUpdateRegionStats(request.getClusterId(), request.getRegionStatsList()).get();
}
Also used : MetadataStore(com.alipay.sofa.jraft.rhea.MetadataStore) RegionHeartbeatRequest(com.alipay.sofa.jraft.rhea.cmd.pd.RegionHeartbeatRequest)

Aggregations

MetadataStore (com.alipay.sofa.jraft.rhea.MetadataStore)6 RegionHeartbeatRequest (com.alipay.sofa.jraft.rhea.cmd.pd.RegionHeartbeatRequest)4 Region (com.alipay.sofa.jraft.rhea.metadata.Region)3 RegionStats (com.alipay.sofa.jraft.rhea.metadata.RegionStats)3 ClusterStatsManager (com.alipay.sofa.jraft.rhea.ClusterStatsManager)2 StoreHeartbeatRequest (com.alipay.sofa.jraft.rhea.cmd.pd.StoreHeartbeatRequest)2 Instruction (com.alipay.sofa.jraft.rhea.metadata.Instruction)2 TimeInterval (com.alipay.sofa.jraft.rhea.metadata.TimeInterval)2 Pair (com.alipay.sofa.jraft.rhea.util.Pair)2 Peer (com.alipay.sofa.jraft.rhea.metadata.Peer)1 RegionEpoch (com.alipay.sofa.jraft.rhea.metadata.RegionEpoch)1 StoreStats (com.alipay.sofa.jraft.rhea.metadata.StoreStats)1 Endpoint (com.alipay.sofa.jraft.util.Endpoint)1 Set (java.util.Set)1