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 1616
1717package io .objectbox ;
1818
19+ import io .objectbox .annotation .apihint .Beta ;
1920import org .greenrobot .essentials .collections .LongHashMap ;
2021
2122import java .io .Closeable ;
@@ -918,11 +919,16 @@ public String diagnose() {
918919 }
919920
920921 /**
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).
925930 */
931+ @ Beta
926932 public long validate (long pageLimit , boolean checkLeafLevel ) {
927933 if (pageLimit < 0 ) {
928934 throw new IllegalArgumentException ("pageLimit must be zero or positive" );
You can’t perform that action at this time.
0 commit comments