long add(NamedList shardCounts) {
long t1 = System.currentTimeMillis();
ArrayList<Object> count=(ArrayList<Object>) shardCounts.get("count");
if(count!=null)
{
GroupbyAgent p = new GroupbyAgent(count);
p.setCross(this.crossFs, this.distFS);
if (recordcount == null) {
recordcount = p;
} else {
recordcount.shardsMerge(p);
}
}
ArrayList<Object> list=(ArrayList<Object>) shardCounts.get("list");
int sz = list == null ? 0 : list.size();
for (int i = 0; i < sz; i++) {
ArrayList<Object> obj=(ArrayList<Object>)list.get(i);
GroupbyAgent p = new GroupbyAgent(obj);
p.setCross(this.crossFs, this.distFS);
if (this.isdetail) {
countsDetail.add((SelectDetailRow) p.getRaw());
} else {
GroupbyRow row=(GroupbyRow) p.getRaw();
GroupbyRow sfc = counts.get(row.getKey());
if (sfc == null) {
row.setDist(autoDist);
counts.put(row.getKey(), row);
} else {