public class

SQLiteAsyncCheckpointer

extends Object
implements Handler.Callback SQLiteCheckpointListener
java.lang.Object
   ↳ com.tencent.wcdb.database.SQLiteAsyncCheckpointer

Summary

Public Constructors
SQLiteAsyncCheckpointer()
SQLiteAsyncCheckpointer(Looper looper)
SQLiteAsyncCheckpointer(Looper looper, int threshold, int blockingThreshold)
Public Methods
boolean handleMessage(Message msg)
void onAttach(SQLiteDatabase db)
Called immediately when this listener is set to the database.
void onDetach(SQLiteDatabase db)
Called immediately when this listener is detached from the database.
void onWALCommit(SQLiteDatabase db, String dbName, int pages)
Called immediately when a WAL transaction has been committed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Handler.Callback
From interface com.tencent.wcdb.database.SQLiteCheckpointListener

Public Constructors

public SQLiteAsyncCheckpointer ()

public SQLiteAsyncCheckpointer (Looper looper)

public SQLiteAsyncCheckpointer (Looper looper, int threshold, int blockingThreshold)

Public Methods

public boolean handleMessage (Message msg)

public void onAttach (SQLiteDatabase db)

Called immediately when this listener is set to the database. Initialization codes can be placed here, if any.

Parameters
db database object to be attached

public void onDetach (SQLiteDatabase db)

Called immediately when this listener is detached from the database. Cleanup codes can be placed here, if any.

Parameters
db database object to be detached from

public void onWALCommit (SQLiteDatabase db, String dbName, int pages)

Called immediately when a WAL transaction has been committed.

The implementation should checkpoint the database according to its strategy by executing SQL PRAGMA wal_checkpoint; or something alike. Failing to do this will result in unlimited growing WAL file and may degrade performance.

Parameters
db database object whose transaction is committed
dbName attached database name of the committed transaction, or "main" for the main database
pages number of frames in the WAL file after commit