Skip to content

Commit b36795b

Browse files
committed
update Box.validate() docs (sync with core docs)
1 parent bfe580d commit b36795b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.objectbox;
1818

19+
import io.objectbox.annotation.apihint.Beta;
1920
import org.greenrobot.essentials.collections.LongHashMap;
2021

2122
import 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");

0 commit comments

Comments
 (0)