private void updateLakeTabletStat() {
        if (!RunMode.isSharedDataMode()) {
            return;
        }

        List<Long> dbIds = GlobalStateMgr.getCurrentState().getLocalMetastore().getDbIds();
        for (Long dbId : dbIds) {
            Database db = GlobalStateMgr.getCurrentState().getDb(dbId);
            if (db == null) {
                continue;
            }

            List<Table> tables = db.getTables();
            for (Table table : tables) {
                if (table.isCloudNativeTableOrMaterializedView()) {
                    updateLakeTableTabletStat(db, (OlapTable) table);
                }
            }
        }
    }
@Test
    public void testUpdateLakeTabletStat(@Mocked SystemInfoService systemInfoService,
                                         @Mocked LakeService lakeService) {

        LakeTable table = createLakeTableForTest();

        long tablet1Id = table.getPartition(PARTITION_ID).getBaseIndex().getTablets().get(0).getId();
        long tablet2Id = table.getPartition(PARTITION_ID).getBaseIndex().getTablets().get(1).getId();

        // db
        Database db = new Database(DB_ID, "db");
        db.registerTableUnlocked(table);

        new MockUp<BrpcProxy>() {
            @Mock
            public LakeService getLakeService(TNetworkAddress addr) {
                return lakeService;
            }

            @Mock
            public LakeService getLakeService(String host, int port) {
                return lakeService;
            }
        };
        new MockUp<Utils>() {
            @Mock
            public Long chooseNodeId(LakeTablet tablet) {
                return 1000L;
            }

            @Mock
            public ComputeNode chooseNode(LakeTablet tablet) {
                return new ComputeNode();
            }
        };

        long tablet1NumRows = 20L;
        long tablet2NumRows = 21L;
        long tablet1DataSize = 30L;
        long tablet2DataSize = 31L;

        new Expectations() {
            {
                lakeService.getTabletStats((TabletStatRequest) any);
                minTimes = 1;
                maxTimes = 1;
                result = new Delegate() {
                    Future<TabletStatResponse> getTabletStats(TabletStatRequest request) {
                        Assert.assertEquals(LakeService.TIMEOUT_GET_TABLET_STATS, (long) request.timeoutMs);
                        Assert.assertEquals(2, request.tabletInfos.size());
                        Assert.assertEquals(tablet1Id, (long) request.tabletInfos.get(0).tabletId);
                        Assert.assertEquals(tablet2Id, (long) request.tabletInfos.get(1).tabletId);

                        return new Future<TabletStatResponse>() {
                            @Override
                            public boolean cancel(boolean mayInterruptIfRunning) {
                                return false;
                            }

                            @Override
                            public boolean isCancelled() {
                                return false;
                            }

                            @Override
                            public boolean isDone() {
                                return true;
                            }

                            @Override
                            public TabletStatResponse get() {
                                List<TabletStat> stats = Lists.newArrayList();
                                TabletStat stat1 = new TabletStat();
                                stat1.tabletId = tablet1Id;
                                stat1.numRows = tablet1NumRows;
                                stat1.dataSize = tablet1DataSize;
                                stats.add(stat1);
                                TabletStat stat2 = new TabletStat();
                                stat2.tabletId = tablet2Id;
                                stat2.numRows = tablet2NumRows;
                                stat2.dataSize = tablet2DataSize;
                                stats.add(stat2);

                                TabletStatResponse response = new TabletStatResponse();
                                response.tabletStats = stats;
                                return response;
                            }

                            @Override
                            public TabletStatResponse get(long timeout, @NotNull TimeUnit unit) {
                                return null;
                            }
                        };
                    }
                };
            }
        };

        long t1 = System.currentTimeMillis();
        TabletStatMgr tabletStatMgr = new TabletStatMgr();
        Deencapsulation.invoke(tabletStatMgr, "updateLakeTableTabletStat", db, table);
        long t2 = System.currentTimeMillis();

        LakeTablet tablet1 = (LakeTablet) table.getPartition(PARTITION_ID).getBaseIndex().getTablets().get(0);
        LakeTablet tablet2 = (LakeTablet) table.getPartition(PARTITION_ID).getBaseIndex().getTablets().get(1);

        Assert.assertEquals(tablet1.getRowCount(-1), tablet1NumRows);
        Assert.assertEquals(tablet1.getDataSize(true), tablet1DataSize);
        Assert.assertEquals(tablet2.getRowCount(-1), tablet2NumRows);
        Assert.assertEquals(tablet2.getDataSize(true), tablet2DataSize);
        Assert.assertTrue(tablet1.getDataSizeUpdateTime() >= t1 && tablet1.getDataSizeUpdateTime() <= t2);
        Assert.assertTrue(tablet2.getDataSizeUpdateTime() >= t1 && tablet2.getDataSizeUpdateTime() <= t2);
    }