Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1376#discussion_r141535670
--- Diff:
core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java
---
@@ -78,8 +89,55 @@ public DataMapWriter createWriter(String segmentId) {
new TableBlockIndexUniqueIdentifier(identifier, segmentId,
listFiles[i].getName()));
}
}
+ return tableBlockIndexUniqueIdentifiers;
+ }
- return cache.getAll(tableBlockIndexUniqueIdentifiers);
+ /**
+ * Get the blocklet detail information based on blockletid, blockid and
segmentid. This method is
+ * exclusively for BlockletDataMapFactory as detail information is only
available in this default
+ * datamap.
+ */
+ @Override
+ public List<ExtendedBlocklet> getDetailedBlocklets(List<Blocklet>
blocklets, String segmentId)
+ throws IOException {
+ List<ExtendedBlocklet> detailedBlocklets = new ArrayList<>();
+ // If it is already detailed blocklet then type cast and return same
+ if (blocklets.size() > 0 && blocklets.get(0) instanceof
ExtendedBlocklet) {
+ for (Blocklet blocklet : blocklets) {
+ detailedBlocklets.add((ExtendedBlocklet) blocklet);
+ }
+ return detailedBlocklets;
+ }
+ List<TableBlockIndexUniqueIdentifier> identifiers =
+ getTableBlockIndexUniqueIdentifiers(segmentId);
+ // Retrieve each blocklets detail information from blocklet datamap
+ for (Blocklet blocklet : blocklets) {
+ detailedBlocklets.add(getDetailedBlocklet(identifiers, blocklet));
+ }
+ return detailedBlocklets;
+ }
+
+ @Override
+ public ExtendedBlocklet getDetailedBlocklet(Blocklet blocklet, String
segmentId)
+ throws IOException {
+ if (blocklet instanceof ExtendedBlocklet) {
+ return (ExtendedBlocklet) blocklet;
+ }
+ List<TableBlockIndexUniqueIdentifier> identifiers =
+ getTableBlockIndexUniqueIdentifiers(segmentId);
+ return getDetailedBlocklet(identifiers, blocklet);
+ }
+
+ private ExtendedBlocklet
getDetailedBlocklet(List<TableBlockIndexUniqueIdentifier> identifiers,
--- End diff --
ok
---