Interface FDBRecordStoreBase.UserVersionChecker

  • Enclosing interface:
    FDBRecordStoreBase<M extends Message>

    public static interface FDBRecordStoreBase.UserVersionChecker
    Hook for checking if store state for client changes.
    • Method Detail

      • checkUserVersion

        CompletableFuture<Integer> checkUserVersion​(int oldUserVersion,
                                                    int oldMetaDataVersion,
                                                    RecordMetaDataProvider metaData)
        Check the user version.
        Parameters:
        oldUserVersion - the old user version or -1 if this is a new record store
        oldMetaDataVersion - the old meta-data version
        metaData - the meta-data provider that will be used to get meta-data
        Returns:
        the user version to store in the record info header
      • needRebuildIndex

        default IndexState needRebuildIndex​(Index index,
                                            long recordCount,
                                            boolean indexOnNewRecordTypes)
        Determine what to do about an index needing to be built.
        Parameters:
        index - the index that has not been built for this store
        recordCount - the number of records already in the store
        indexOnNewRecordTypes - true if all record types for the index are new (the number of records related to this index is 0), in which case the index is able to be "rebuilt" instantly with no cost.
        Returns:
        the desired state of the new index. If this is IndexState.READABLE, the index will be built right away