Class UserRowSync<TColumn extends UserColumn,​TTable extends UserTable<TColumn>,​TRow extends UserCoreRow<TColumn,​TTable>>

  • Type Parameters:
    TColumn - column type
    TTable - table type
    TRow - row type

    public class UserRowSync<TColumn extends UserColumn,​TTable extends UserTable<TColumn>,​TRow extends UserCoreRow<TColumn,​TTable>>
    extends Object
    User Row Sync to support sharing a single user row read copy when multiple near simultaneous asynchronous requests are made
    Since:
    2.0.0
    Author:
    osbornb
    • Constructor Detail

      • UserRowSync

        protected UserRowSync()
        Constructor
    • Method Detail

      • getRowOrLock

        public TRow getRowOrLock​(long id)
        Get the row if another same id request has been made by waiting until the row has been set. If no current request, lock the for the calling thread which should read the row and call setRow(long, UserCoreRow) when complete.
        Parameters:
        id - user row id
        Returns:
        row if retrieved from a previous request, null if calling thread should read row and set using setRow(long, UserCoreRow)
      • setRow

        public void setRow​(long id,
                           TRow row)
        Set the row id, row, and notify all waiting threads to retrieve the row.
        Parameters:
        id - user row id
        row - user row or null