File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
objectbox-java/src/main/java/io/objectbox Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package io .objectbox ;
18
18
19
+ import io .objectbox .annotation .apihint .Beta ;
19
20
import org .greenrobot .essentials .collections .LongHashMap ;
20
21
21
22
import java .io .Closeable ;
@@ -918,11 +919,16 @@ public String diagnose() {
918
919
}
919
920
920
921
/**
921
- * Validates up to {@code pageLimit} pages of the store. Set {@code checkLeafLevel} to check leafs, too.
922
- * Returns the number of pages validated.
923
- * Throws StorageException if validation fails.
924
- * Throws DbFileCorruptException or DbPagesCorruptException if the DB is actually inconsistent (corrupt).
922
+ * Validate database pages, a lower level storage unit (integrity check).
923
+ * Do not call this inside a transaction (currently unsupported).
924
+ * @param pageLimit the maximum of pages to validate (e.g. to limit time spent on validation).
925
+ * Pass zero set no limit and thus validate all pages.
926
+ * @param checkLeafLevel Flag to validate leaf pages. These do not point to other pages but contain data.
927
+ * @return Number of pages validated, which may be twice the given pageLimit as internally there are "two DBs".
928
+ * @throws DbException if validation failed to run (does not tell anything about DB file consistency).
929
+ * @throws io.objectbox.exception.FileCorruptException if the DB file is actually inconsistent (corrupt).
925
930
*/
931
+ @ Beta
926
932
public long validate (long pageLimit , boolean checkLeafLevel ) {
927
933
if (pageLimit < 0 ) {
928
934
throw new IllegalArgumentException ("pageLimit must be zero or positive" );
You can’t perform that action at this time.
0 commit comments