* 获取一个Namespace下的所有kv
*/
private RemotingCommand getKVListByNamespace(ChannelHandlerContext ctx, RemotingCommand request)
throws RemotingCommandException {
final RemotingCommand response = RemotingCommand.createResponseCommand(null);
final GetKVListByNamespaceRequestHeader requestHeader =
(GetKVListByNamespaceRequestHeader) request
.decodeCommandCustomHeader(GetKVListByNamespaceRequestHeader.class);
byte[] jsonValue = this.namesrvController.getKvConfigManager().getKVListByNamespace(//
requestHeader.getNamespace());
if (null != jsonValue) {
response.setBody(jsonValue);
response.setCode(ResponseCode.SUCCESS_VALUE);
response.setRemark(null);
return response;
}
response.setCode(MQResponseCode.QUERY_NOT_FOUND_VALUE);
response.setRemark("No config item, Namespace: " + requestHeader.getNamespace());
return response;
}