Skip to content

Commit 69eed53

Browse files
committed
hindex: fix show index size number wrongness
1 parent 9967641 commit 69eed53

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

hetu-filesystem-client/src/main/java/io/hetu/core/filesystem/HetuHdfsFileSystemClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public Object getAttribute(Path path, String attribute)
199199
case SupportedFileAttributes.LAST_MODIFIED_TIME:
200200
return fileStatus.getModificationTime();
201201
case SupportedFileAttributes.SIZE:
202-
return fileStatus.getBlockSize();
202+
return fileStatus.getLen();
203203
default:
204204
return null;
205205
}

hetu-heuristic-index/src/main/java/io/hetu/core/heuristicindex/PartitionIndexWriter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,13 @@ public long persist()
208208
fs.createDirectories(filePath.getParent());
209209
try (OutputStream os = fs.newOutputStream(filePath)) {
210210
partitionIndex.serialize(os);
211-
212-
return (long) fs.getAttribute(filePath, "size");
213211
}
214212
catch (IOException e) {
215213
// roll back creation
216214
fs.delete(filePath);
217215
throw e;
218216
}
217+
return (long) fs.getAttribute(filePath, "size");
219218
}
220219
finally {
221220
if (partitionIndex != null) {

0 commit comments

Comments
 (0)