Skip to content

Commit

Permalink
bug fix - nobody object group should not poll any xlog
Browse files Browse the repository at this point in the history
  • Loading branch information
bill23-kim committed Dec 11, 2017
1 parent a385a8c commit ab2ed17
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,23 +177,27 @@ public void refresh() {
param = new MapPack();
paramMap.put(serverId, param);
}
param.put("objHash", serverObjMap.get(serverId));
param.put("limit", limit);
tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
if (p instanceof MapPack) {
MapPack param = (MapPack) p;
paramMap.put(serverId, param);
} else {
XLogPack x = XLogUtil.toXLogPack(p);
tempSet.add(new XLogData(x, serverId));
while (tempSet.size() >= max) {
tempSet.pollFirst();
ListValue objHashLv = serverObjMap.get(serverId);
if (objHashLv.size() > 0) {
param.put("objHash", objHashLv);
param.put("limit", limit);
tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
if (p instanceof MapPack) {
MapPack param = (MapPack) p;
paramMap.put(serverId, param);
} else {
XLogPack x = XLogUtil.toXLogPack(p);
tempSet.add(new XLogData(x, serverId));
while (tempSet.size() >= max) {
tempSet.pollFirst();
}
}
}
}
});
);
}
} catch(Exception e){
ConsoleProxy.errorSafe(e.toString());
} finally {
Expand Down
44 changes: 24 additions & 20 deletions scouter.client/src/scouter/client/xlog/views/XLogRealTimeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import scouter.lang.pack.PackEnum;
import scouter.lang.pack.XLogPack;
import scouter.lang.value.BooleanValue;
import scouter.lang.value.ListValue;
import scouter.net.RequestCmd;
import scouter.util.CastUtil;
import scouter.util.DateUtil;
Expand Down Expand Up @@ -162,27 +163,30 @@ public void setFocus() {
public void refresh() {
setDate(DateUtil.yyyymmdd(TimeUtil.getCurrentTime(serverId)));
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
param.put("objHash", agentThread.getLiveObjHashLV(serverId, objType));
int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);
param.put("limit", limit);

twdata.setMax(getMaxCount());
tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
if (p.getPackType() == PackEnum.MAP) {
param = (MapPack) p;
} else {
XLogPack x = XLogUtil.toXLogPack(p);
twdata.putLast(x.txid, new XLogData(x, serverId));
ListValue objHashLv = agentThread.getLiveObjHashLV(serverId, objType);
if (objHashLv.size() > 0) {
try {
param.put("objHash", objHashLv);
int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);
param.put("limit", limit);

twdata.setMax(getMaxCount());
tcp.process(RequestCmd.TRANX_REAL_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
if (p.getPackType() == PackEnum.MAP) {
param = (MapPack) p;
} else {
XLogPack x = XLogUtil.toXLogPack(p);
twdata.putLast(x.txid, new XLogData(x, serverId));
}
}
}
});
} catch(Exception e){
ConsoleProxy.errorSafe(e.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
});
} catch(Exception e){
ConsoleProxy.errorSafe(e.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
}
}
ExUtil.asyncRun(new Runnable() {
public void run() {
Expand Down

0 comments on commit ab2ed17

Please sign in to comment.