use of org.apache.drill.exec.store.openTSDB.client.services.ServiceImpl in project drill by axbaretto.
the class OpenTSDBGroupScan method getScanStats.
@Override
public ScanStats getScanStats() {
ServiceImpl client = storagePlugin.getClient();
Map<String, String> params = fromRowData(openTSDBScanSpec.getTableName());
Set<MetricDTO> allMetrics = client.getAllMetrics(params);
long numMetrics = allMetrics.size();
float approxDiskCost = 0;
if (numMetrics != 0) {
MetricDTO metricDTO = allMetrics.iterator().next();
// This method estimates the sizes of Java objects (number of bytes of memory they occupy).
// more detailed information about how this estimation method work you can find in this article
// http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html
approxDiskCost = SizeEstimator.estimate(metricDTO) * numMetrics;
}
return new ScanStats(ScanStats.GroupScanProperty.EXACT_ROW_COUNT, numMetrics, 1, approxDiskCost);
}
use of org.apache.drill.exec.store.openTSDB.client.services.ServiceImpl in project drill by apache.
the class OpenTSDBGroupScan method getScanStats.
@Override
public ScanStats getScanStats() {
ServiceImpl client = storagePlugin.getClient();
Map<String, String> params = fromRowData(openTSDBScanSpec.getTableName());
Set<MetricDTO> allMetrics = client.getAllMetrics(params);
long numMetrics = allMetrics.size();
float approxDiskCost = 0;
if (numMetrics != 0) {
MetricDTO metricDTO = allMetrics.iterator().next();
// This method estimates the sizes of Java objects (number of bytes of memory they occupy).
// more detailed information about how this estimation method work you can find in this article
// http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html
approxDiskCost = SizeEstimator.estimate(metricDTO) * numMetrics;
}
return new ScanStats(ScanStats.GroupScanProperty.EXACT_ROW_COUNT, numMetrics, 1, approxDiskCost);
}
Aggregations