private RemotingCommand getMaxOffset(ChannelHandlerContext ctx, RemotingCommand request)
throws RemotingCommandException {
final RemotingCommand response =
RemotingCommand.createResponseCommand(GetMaxOffsetResponseHeader.class);
final GetMaxOffsetResponseHeader responseHeader =
(GetMaxOffsetResponseHeader) response.getCustomHeader();
final GetMaxOffsetRequestHeader requestHeader =
(GetMaxOffsetRequestHeader) request
.decodeCommandCustomHeader(GetMaxOffsetRequestHeader.class);
long offset =
this.brokerController.getMessageStore().getMaxOffsetInQuque(requestHeader.getTopic(),
requestHeader.getQueueId());
responseHeader.setOffset(offset);
response.setCode(ResponseCode.SUCCESS_VALUE);
response.setRemark(null);
return response;
}