本文整理汇总了Java中com.alibaba.rocketmq.common.protocol.body.KVTable.setTable方法的典型用法代码示例。如果您正苦于以下问题:Java KVTable.setTable方法的具体用法?Java KVTable.setTable怎么用?Java KVTable.setTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.rocketmq.common.protocol.body.KVTable
的用法示例。
在下文中一共展示了KVTable.setTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKVListByNamespace
import com.alibaba.rocketmq.common.protocol.body.KVTable; //导入方法依赖的package包/类
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;
}
示例2: getKVListByNamespace
import com.alibaba.rocketmq.common.protocol.body.KVTable; //导入方法依赖的package包/类
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;
}
示例3: getBrokerRuntimeInfo
import com.alibaba.rocketmq.common.protocol.body.KVTable; //导入方法依赖的package包/类
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;
}
示例4: getBrokerRuntimeInfo
import com.alibaba.rocketmq.common.protocol.body.KVTable; //导入方法依赖的package包/类
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_VALUE);
response.setRemark(null);
return response;
}