class LideaLogErrorDAO {

    public List<LideaLogErrorDetailBO> list(List<String> traceIds) {


        return hbaseTemplate.execute(Const.LIDEA_LOG_DEATIL_TABLE, table -> {

            List<LideaLogErrorDetailBO> bos = new ArrayList<>();

            if (traceIds.size() > 1) {

                List<Get> list = new ArrayList<>();

                for (String traceId : traceIds) {

                    Get get = new Get(BytesUtils.toBytes(traceId));

                    list.add(get);
                }

                Result[] rs = table.get(list);

                for (Result r : rs) {
                    LideaLogErrorDetailBO bo = LideaLogResultsExtractor.mapErrorDetail(r);
                    bos.add(bo);
                }
                return bos;

            } else {

                Get get = new Get(BytesUtils.toBytes(traceIds.get(0)));
                Result r = table.get(get);
                if (r.isEmpty()) {
                    return null;
                }
                LideaLogErrorDetailBO bo = LideaLogResultsExtractor.mapErrorDetail(r);

                return Collections.singletonList(bo);
            }
        });

    }

}