public void updateLastCacheIfExists(
      final String database,
      final IDeviceID deviceId,
      final String[] measurements,
      final TimeValuePair[] timeValuePairs,
      boolean invalidateNull) {
    dualKeyCache.update(
        new TableId(database, deviceId.getTableName()),
        deviceId,
        null,
        entry -> entry.tryUpdateLastCache(measurements, timeValuePairs, invalidateNull),
        false);
  }
Update the last cache in writing or the second push of last cache query. If a measurement is
with all {@code null}s or is a tag/attribute column, its {@link TimeValuePair}[] shall be
{@code null}. For correctness, this will put the cache lazily and only update the existing last
caches of measurements.

@param database the device's database, without "root"
@param deviceId {@link IDeviceID}
@param measurements the fetched measurements
@param timeValuePairs the {@link TimeValuePair}s with indexes corresponding to the measurements
@param invalidateNull when true invalidate cache entries where timeValuePairs[i] == null; when
    false ignore cache entries where timeValuePairs[i] == null
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java