mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-09 22:36:01 +05:45
* Definition is currently in an "unreleased" extension to FIRServerValues * Tests are added to FData.m (integration tests) * Some tests are renamed to make it clear that ServerValues != timestamps * Functions that resolve server values now need access to any existing snapshot. This is done with lazy evaluation as described below: Based on fix https://github.com/firebase/firebase-js-sdk/pull/2499 to bug https://github.com/firebase/firebase-js-sdk/issues/2487 Micro-benchmarking showed that N writes in succession led to N^2 performance when calculating the resolved write tree for those writes (thankfully only at the subpath in this SDK). Lazy evaluation of current data matches the optimization in JS that mitigated a 20% performance regression.
41 lines
1.6 KiB
Objective-C
41 lines
1.6 KiB
Objective-C
/*
|
|
* Copyright 2017 Google
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#import "FClock.h"
|
|
#import "FCompoundWrite.h"
|
|
#import "FNode.h"
|
|
#import "FSparseSnapshotTree.h"
|
|
#import "FSyncTree.h"
|
|
#import <Foundation/Foundation.h>
|
|
|
|
@interface FServerValues : NSObject
|
|
|
|
+ (NSDictionary *)generateServerValues:(id<FClock>)clock;
|
|
|
|
+ (FCompoundWrite *)resolveDeferredValueCompoundWrite:(FCompoundWrite *)write
|
|
withSyncTree:(FSyncTree *)tree
|
|
atPath:(FPath *)path
|
|
serverValues:
|
|
(NSDictionary *)serverValues;
|
|
+ (id<FNode>)resolveDeferredValueSnapshot:(id<FNode>)node
|
|
withSyncTree:(FSyncTree *)existing
|
|
atPath:(FPath *)path
|
|
serverValues:(NSDictionary *)serverValues;
|
|
+ (id<FNode>)resolveDeferredValueSnapshot:(id<FNode>)node
|
|
withExisting:(id<FNode>)existing
|
|
serverValues:(NSDictionary *)serverValues;
|
|
@end
|