private void invalidateSubscription(String subscription) { _invalidationEventMeter.mark(); _subscriptionCacheHandle.invalidate(InvalidationScope.DATA_CENTER, subscription); // If in legacy mode also invalidate the legacy cache if (_cachingMode == CachingMode.legacy) { _legacyCacheHandle.invalidate(InvalidationScope.DATA_CENTER, SUBSCRIPTIONS); } }
private void invalidateSubscription(String subscription) { _invalidationEventMeter.mark(); _subscriptionCacheHandle.invalidate(InvalidationScope.DATA_CENTER, subscription); // If in legacy mode also invalidate the legacy cache if (_cachingMode == CachingMode.legacy) { _legacyCacheHandle.invalidate(InvalidationScope.DATA_CENTER, SUBSCRIPTIONS); } }
/** * Write the delta to the system table and invalidate caches in the specified scope. */ private void updateTableMetadata(String table, Delta delta, Audit audit, @Nullable InvalidationScope scope) { _backingStore.update(_systemTable, table, TimeUUIDs.newUUID(), delta, audit, scope == InvalidationScope.GLOBAL ? WriteConsistency.GLOBAL : WriteConsistency.STRONG); // Synchronously notify other emodb servers of the table change. if (scope != null) { _tableCacheHandle.invalidate(scope, table); } }
/** * Write the delta to the system table and invalidate caches in the specified scope. */ private void updateTableMetadata(String table, Delta delta, Audit audit, @Nullable InvalidationScope scope) { _backingStore.update(_systemTable, table, TimeUUIDs.newUUID(), delta, audit, scope == InvalidationScope.GLOBAL ? WriteConsistency.GLOBAL : WriteConsistency.STRONG); // Synchronously notify other emodb servers of the table change. if (scope != null) { _tableCacheHandle.invalidate(scope, table); } }
private <T> void set(SettingMetadata<T> metadata, T value) { checkNotNull(value, "value"); Delta delta = Deltas.mapBuilder() .put(VALUE_ATTRIBUTE, JsonHelper.asJson(value)) .put(VERSION_ATTRIBUTE, CURRENT_SETTING_VERSION) .build(); // Write the delta to the store _dataStore.get().update(_settingsTable.get(), metadata.getName(), TimeUUIDs.newUUID(), delta, new AuditBuilder().setLocalHost().setComment("Updated setting").build(), WriteConsistency.GLOBAL); // Notify all instances that the setting value has changed _cacheHandle.invalidate(InvalidationScope.GLOBAL, metadata.getName()); }