Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/910#discussion_r50493447
--- Diff:
tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseTablespace.java
---
@@ -101,8 +104,19 @@ public Configuration getHbaseConf() {
}
@Override
- public long getTableVolume(URI uri, Optional<EvalNode> filter) throws
UnsupportedException {
- throw new UnsupportedException();
+ public long getTableVolume(TableDesc table, Optional<EvalNode> filter) {
+ long totalVolume;
+ try {
+ totalVolume = getRawSplits("", table, filter.orElse(null)).stream()
+ .map(f -> f.getLength())
+ .filter(size -> size > 0) // eliminate unknown sizes (-1)
+ .reduce(0L, (sum, size) -> sum + size);
--- End diff --
This line can be more simplified into ```.reduce(0L, Long::sum)```.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---