public byte[] getKVListByNamespace(final String namespace) { try { this.lock.readLock().lockInterruptibly(); try { HashMap<String, String> kvTable = this.configTable.get(namespace); if (null != kvTable) { KVTable table = new KVTable(); table.setTable(kvTable); return table.encode(); } } finally { this.lock.readLock().unlock(); } } catch (InterruptedException e) { log.error("getKVListByNamespace InterruptedException", e); } return null; }
private RemotingCommand getBrokerRuntimeInfo(ChannelHandlerContext ctx, RemotingCommand request) { final RemotingCommand response = RemotingCommand.createResponseCommand(null); HashMap<String, String> runtimeInfo = this.prepareRuntimeInfo(); KVTable kvTable = new KVTable(); kvTable.setTable(runtimeInfo); byte[] body = kvTable.encode(); response.setBody(body); response.setCode(ResponseCode.SUCCESS); response.setRemark(null); return response; }
public byte[] getKVListByNamespace(final String namespace) { try { this.lock.readLock().lockInterruptibly(); try { HashMap<String, String> kvTable = this.configTable.get(namespace); if (null != kvTable) { KVTable table = new KVTable(); table.setTable(kvTable); return table.encode(); } } finally { this.lock.readLock().unlock(); } } catch (InterruptedException e) { log.error("getKVListByNamespace InterruptedException", e); } return null; }
private RemotingCommand getBrokerRuntimeInfo(ChannelHandlerContext ctx, RemotingCommand request) { final RemotingCommand response = RemotingCommand.createResponseCommand(null); HashMap<String, String> runtimeInfo = this.prepareRuntimeInfo(); KVTable kvTable = new KVTable(); kvTable.setTable(runtimeInfo); byte[] body = kvTable.encode(); response.setBody(body); response.setCode(ResponseCode.SUCCESS); response.setRemark(null); return response; }
private RemotingCommand getBrokerRuntimeInfo(ChannelHandlerContext ctx, RemotingCommand request) { final RemotingCommand response = RemotingCommand.createResponseCommand(null); HashMap<String, String> runtimeInfo = this.prepareRuntimeInfo(); KVTable kvTable = new KVTable(); kvTable.setTable(runtimeInfo); byte[] body = kvTable.encode(); response.setBody(body); response.setCode(ResponseCode.SUCCESS); response.setRemark(null); return response; }