use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket in project dble by actiontech.
the class DirectGroupByHandler method rowResponse.
@Override
public boolean rowResponse(byte[] rowNull, final RowDataPacket rowPacket, boolean isLeft, BackendConnection conn) {
LOGGER.debug("rowResponse");
if (terminate.get())
return true;
hasFirstRow.compareAndSet(false, true);
try {
DGRowPacket row = new DGRowPacket(rowPacket, this.referredSumFunctions.size());
queue.put(row);
} catch (InterruptedException e) {
// ignore error
}
return false;
}
use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket in project dble by actiontech.
the class GroupByLocalResult method onFirstGroupRow.
protected void onFirstGroupRow(RowDataPacket row) {
// we need to calculate group by
initSumFunctions(this.sums, row);
for (int i = 0; i < this.sums.size(); i++) {
ItemSum sum = this.sums.get(i);
Object b = sum.getTransAggObj();
int transSize = sum.getTransSize();
((DGRowPacket) row).setSumTran(i, b, transSize);
}
}
use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket in project dble by actiontech.
the class GroupResultDiskBuffer method onFoundRow.
@Override
protected void onFoundRow(RowDataPacket oldRow, RowDataPacket row) {
// we need to calculate group by
initSumFunctions(this.sums, oldRow);
updateSumFunc(this.sums, row);
for (int i = 0; i < this.sums.size(); i++) {
ItemSum sum = this.sums.get(i);
Object b = sum.getTransAggObj();
int transSize = sum.getTransSize();
((DGRowPacket) oldRow).setSumTran(i, b, transSize);
}
}
use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket in project dble by actiontech.
the class GroupByLocalResult method onFoundRow.
protected void onFoundRow(RowDataPacket oldRow, RowDataPacket row) {
// we need to calculate group by
initSumFunctions(this.sums, oldRow);
updateSumFunc(this.sums, row);
for (int i = 0; i < this.sums.size(); i++) {
ItemSum sum = this.sums.get(i);
Object b = sum.getTransAggObj();
int transSize = sum.getTransSize();
((DGRowPacket) oldRow).setSumTran(i, b, transSize);
}
}
use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket in project dble by actiontech.
the class GroupByLocalResult method initSumFunctions.
protected void initSumFunctions(List<ItemSum> functions, RowDataPacket row) {
for (int i = 0; i < functions.size(); i++) {
ItemSum sum = functions.get(i);
Object transObj = ((DGRowPacket) row).getSumTran(i);
sum.resetAndAdd(row, transObj);
}
}
Aggregations