public static int calDefaultReplicationNum() throws UserException {
        if (RunMode.isSharedDataMode()) {
            return 1;
        }

        int defaultReplicationNum =
                Math.min(3, GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo().getTotalBackendNumber());
        if (defaultReplicationNum == 0) {
            throw new NoAliveBackendException("No alive backend");
        }
        return defaultReplicationNum;
    }
@Test
    public void testCalDefaultReplicationNum() throws Exception {
        try {
            AutoInferUtil.calDefaultReplicationNum();
        } catch (UserException e) {
            Assert.assertTrue(e instanceof NoAliveBackendException
                    && e.getMessage().contains("No alive backend"));
        }

        new MockUp<RunMode>() {
            @Mock
            public RunMode getCurrentRunMode() {
                return RunMode.SHARED_DATA;
            }
        };

        Assert.assertEquals(1, AutoInferUtil.calDefaultReplicationNum());
    }