Function planColumnarBatchCacheAdmission

  • Experimental

    Plan the evictions that admit incoming under limits.

    Pure and deterministic: candidates are ordered by write time and then by key in code-unit order, so two hosts with the same records always evict the same entries. An entry larger than the whole quota is refused outright rather than emptying the store for something that still would not fit.

    Parameters

    • records: readonly ColumnarBatchCacheRecordV1[]
    • incoming: {
          byteLength: number;
          key: string;
      }
      • ReadonlybyteLength: number
      • Readonlykey: string
    • limits: {
          maxRecords: number;
          quotaBytes: number;
      }
      • ReadonlymaxRecords: number
      • ReadonlyquotaBytes: number

    Returns ColumnarBatchCacheAdmissionV1