use of com.actiontech.dble.net.mysql.RowDataPacket in project dble by actiontech.
the class ShowBinlogStatus method getRow.
private static RowDataPacket getRow(String url, Map<String, String> result, String charset) {
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode(url, charset));
for (String field : FIELDS) {
row.add(StringUtil.encode(result.get(field), charset));
}
return row;
}
use of com.actiontech.dble.net.mysql.RowDataPacket in project dble by actiontech.
the class ShowCommand method getRow.
private static RowDataPacket getRow(NIOProcessor processor) {
CommandCount cc = processor.getCommands();
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(processor.getName().getBytes());
row.add(LongUtil.toBytes(cc.initDBCount()));
row.add(LongUtil.toBytes(cc.queryCount()));
row.add(LongUtil.toBytes(cc.stmtPrepareCount()));
row.add(LongUtil.toBytes(cc.stmtExecuteCount()));
row.add(LongUtil.toBytes(cc.stmtCloseCount()));
row.add(LongUtil.toBytes(cc.pingCount()));
row.add(LongUtil.toBytes(cc.killCount()));
row.add(LongUtil.toBytes(cc.quitCount()));
row.add(LongUtil.toBytes(cc.otherCount()));
return row;
}
use of com.actiontech.dble.net.mysql.RowDataPacket in project dble by actiontech.
the class ShowCommandCount method execute.
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = HEADER.write(buffer, c, true);
// write fields
for (FieldPacket field : FIELDS) {
buffer = field.write(buffer, c, true);
}
// write eof
buffer = EOF.write(buffer, c, true);
// write rows
byte packetId = EOF.getPacketId();
RowDataPacket row = getRow();
row.setPacketId(++packetId);
buffer = row.write(buffer, c, true);
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.setPacketId(++packetId);
buffer = lastEof.write(buffer, c, true);
// write buffer
c.write(buffer);
}
use of com.actiontech.dble.net.mysql.RowDataPacket in project dble by actiontech.
the class ShowConnection method execute.
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = HEADER.write(buffer, c, true);
// write fields
for (FieldPacket field : FIELDS) {
buffer = field.write(buffer, c, true);
}
// write eof
buffer = EOF.write(buffer, c, true);
// write rows
byte packetId = EOF.getPacketId();
NIOProcessor[] processors = DbleServer.getInstance().getFrontProcessors();
for (NIOProcessor p : processors) {
for (FrontendConnection fc : p.getFrontends().values()) {
if (fc != null) {
RowDataPacket row = getRow(fc, c.getCharset().getResults());
row.setPacketId(++packetId);
buffer = row.write(buffer, c, true);
}
}
}
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.setPacketId(++packetId);
buffer = lastEof.write(buffer, c, true);
// write buffer
c.write(buffer);
}
use of com.actiontech.dble.net.mysql.RowDataPacket in project dble by actiontech.
the class ShowConnectionCount method getRow.
private static RowDataPacket getRow() {
int cons = 0;
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
NIOProcessor[] processors = DbleServer.getInstance().getFrontProcessors();
for (NIOProcessor p : processors) {
for (FrontendConnection fc : p.getFrontends().values()) {
if (fc != null) {
cons++;
}
}
}
row.add(IntegerUtil.toBytes(cons));
return row;
}
Aggregations