File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,16 @@ public TypedTable(
100100 //fill cache
101101 try (TableIterator <KEY , ? extends KeyValue <KEY , VALUE >> tableIterator =
102102 iterator ()) {
103- KeyValue <KEY , VALUE > kv = tableIterator .next ();
104103
105- // We should build cache after OM restart when clean up policy is NEVER.
106- // Setting epoch value -1, so that when it is marked for delete, this
107- // will be considered for cleanup.
108- cache .put (new CacheKey <>(kv .getKey ()),
109- new CacheValue <>(Optional .of (kv .getValue ()), EPOCH_DEFAULT ));
104+ while (tableIterator .hasNext ()) {
105+ KeyValue < KEY , VALUE > kv = tableIterator .next ();
106+
107+ // We should build cache after OM restart when clean up policy is NEVER.
108+ // Setting epoch value -1, so that when it is marked for delete, this
109+ // will be considered for cleanup.
110+ cache .put (new CacheKey <>(kv .getKey ()),
111+ new CacheValue <>(Optional .of (kv .getValue ()), EPOCH_DEFAULT ));
112+ }
110113 }
111114 }
112115 }
You can’t perform that action at this time.
0 commit comments