Skip to content

Commit

Permalink
Check directory casting state
Browse files Browse the repository at this point in the history
Signed-off-by: luyuncheng <[email protected]>
  • Loading branch information
luyuncheng committed Aug 15, 2024
1 parent 70a2ea4 commit 2bcc139
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ public KNN80DocValuesProducer(DocValuesProducer delegate, SegmentReadState state
if (state.directory instanceof KNN80CompoundDirectory) {
directory = ((KNN80CompoundDirectory) state.directory).getDir();
}
String directoryPath = ((FSDirectory) FilterDirectory.unwrap(directory)).getDirectory().toString();

FSDirectory fsDirectory = null;
try {
fsDirectory = ((FSDirectory) FilterDirectory.unwrap(directory));
} catch (ClassCastException ex) {
log.warn("{} can not casting to FSDirectory", directory.toString());
return;
}
assert fsDirectory != null;
String directoryPath = fsDirectory.getDirectory().toString();
for (FieldInfo field : state.fieldInfos) {
if (!field.attributes().containsKey(KNN_FIELD)) {
continue;
Expand Down

0 comments on commit 2bcc139

Please sign in to comment.