return SUCCESS;
}
public List<ArrayList<Cell>> getData(Report report, Mapping mapping) {
List<ArrayList<Cell>> dataList = new ArrayList<ArrayList<Cell>>();
CruxScanner cruxScanner = null;
try {
Connection conn = mapping.getConnection();
HBaseFacade hbaseFacade = this.getHBaseFacade();
logger.debug("About to get data for Report:" + report);
cruxScanner = hbaseFacade.execute(conn, report, mapping);
logger.debug("Data fetched from HBaseFacade");
List<ReportDesign> reportDesignList = report.getDesigns();
for (ReportDesign reportDesign : reportDesignList) {
String alias = (reportDesign.getColumnAlias() != null) ? reportDesign
.getColumnAlias().getAlias() : reportDesign
.getRowAlias().getAlias();
axisValues = axisValues + reportDesign.getMappingAxis() + ","
+ alias + ":";
logger.debug("AxisValues:"+axisValues);
}
if (cruxScanner != null) {
logger.debug("About to create dataList");
int designSize = reportDesignList.size();
CruxResult result = null;
while ((result = cruxScanner.next()) != null) {
dataList.add(getCellList(reportDesignList, result));
}
logger.debug("DataList is populated closing scanner");
}
else {
error.setMessage("Cannot determine result.");
}
} catch (CruxException e) {
e.printStackTrace();
error.setMessage(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
error.setMessage(e.getMessage());
} finally {
if (cruxScanner != null) {
cruxScanner.close();
}
}
return dataList;
}