private RemotingCommand setCommitLogReadaheadMode(ChannelHandlerContext ctx, RemotingCommand request) {
        final RemotingCommand response = RemotingCommand.createResponseCommand(null);
        LOGGER.info("setCommitLogReadaheadMode called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()));

        try {
            HashMap<String, String> extFields = request.getExtFields();
            if (null == extFields) {
                response.setCode(ResponseCode.SYSTEM_ERROR);
                response.setRemark("set commitlog readahead mode param error");
                return response;
            }
            int mode = Integer.parseInt(extFields.get(FIleReadaheadMode.READ_AHEAD_MODE));
            if (mode != LibC.MADV_RANDOM && mode != LibC.MADV_NORMAL) {
                response.setCode(ResponseCode.SYSTEM_ERROR);
                response.setRemark("set commitlog readahead mode param value error");
                return response;
            }
            MessageStore messageStore = this.brokerController.getMessageStore();
            if (messageStore instanceof DefaultMessageStore) {
                DefaultMessageStore defaultMessageStore = (DefaultMessageStore) messageStore;
                if (mode == LibC.MADV_NORMAL) {
                    defaultMessageStore.getMessageStoreConfig().setDataReadAheadEnable(true);
                } else {
                    defaultMessageStore.getMessageStoreConfig().setDataReadAheadEnable(false);
                }
                defaultMessageStore.getCommitLog().scanFileAndSetReadMode(mode);
            }
            response.setCode(ResponseCode.SUCCESS);
            response.setRemark("set commitlog readahead mode success, mode: " + mode);
        } catch (Exception e) {
            LOGGER.error("set commitlog readahead mode failed", e);
            response.setCode(ResponseCode.SYSTEM_ERROR);
            response.setRemark("set commitlog readahead mode failed");
        }
        return response;
    }
@Test
    public void testSetCommitLogReadAheadMode() throws RemotingCommandException {
        RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.SET_COMMITLOG_READ_MODE, null);
        RemotingCommand response = adminBrokerProcessor.processRequest(handlerContext, request);
        assertThat(response.getCode()).isEqualTo(ResponseCode.SYSTEM_ERROR);

        HashMap<String, String> extfields = new HashMap<>();
        extfields.put(FIleReadaheadMode.READ_AHEAD_MODE, String.valueOf(LibC.MADV_DONTNEED));
        request.setExtFields(extfields);
        response = adminBrokerProcessor.processRequest(handlerContext, request);
        assertThat(response.getCode()).isEqualTo(ResponseCode.SYSTEM_ERROR);

        extfields.clear();
        extfields.put(FIleReadaheadMode.READ_AHEAD_MODE, String.valueOf(LibC.MADV_NORMAL));
        request.setExtFields(extfields);
        response = adminBrokerProcessor.processRequest(handlerContext, request);
        assertThat(response.getCode()).isEqualTo(ResponseCode.SUCCESS);

        this.brokerController.setMessageStore(defaultMessageStore);
        response = adminBrokerProcessor.processRequest(handlerContext, request);
        assertThat(response.getCode()).isEqualTo(ResponseCode.SYSTEM_ERROR);

        when(this.defaultMessageStore.getMessageStoreConfig()).thenReturn(messageStoreConfig);
        when(this.defaultMessageStore.getCommitLog()).thenReturn(commitLog);
        response = adminBrokerProcessor.processRequest(handlerContext, request);
        assertThat(response.getCode()).isEqualTo(ResponseCode.SUCCESS);
    }