Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2324#discussion_r189609624
--- Diff:
datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomDataMapCache.java
---
@@ -133,15 +132,14 @@ private int validateAndGetCacheSize() {
*/
private List<BloomDMModel> loadBloomDataMapModel(CacheKey cacheKey) {
DataInputStream dataInStream = null;
- ObjectInputStream objectInStream = null;
List<BloomDMModel> bloomDMModels = new ArrayList<BloomDMModel>();
try {
String indexFile = getIndexFileFromCacheKey(cacheKey);
dataInStream = FileFactory.getDataInputStream(indexFile,
FileFactory.getFileType(indexFile));
- objectInStream = new ObjectInputStream(dataInStream);
try {
- BloomDMModel model = null;
- while ((model = (BloomDMModel) objectInStream.readObject()) !=
null) {
+ while (dataInStream.available() > 0) {
--- End diff --
I've checked the `available` method when I contributed these lines of code
and found it's not suitable here.
Better to keep them as it is.
Maybe you can check it again.
---