Skip to content

Commit fb09f93

Browse files
authored
Revert "SessionToken persistence implementation (#13684)" (#13719)
1 parent 2893101 commit fb09f93

18 files changed

+0
-594
lines changed

Firestore/CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# 11.3.0
22
- [changed] Improve efficiency of memory persistence when processing a large number of writes. (#13572)
3-
- [changed] Prepare Firestore cache to support session token.
43

54
# 11.2.0
65
- [fixed] Marked all public classes with only readonly properties as `Sendable` to address

Firestore/Example/Firestore.xcodeproj/project.pbxproj

-44
Large diffs are not rendered by default.

Firestore/core/src/local/globals_cache.h

-57
This file was deleted.

Firestore/core/src/local/leveldb_globals_cache.cc

-57
This file was deleted.

Firestore/core/src/local/leveldb_globals_cache.h

-52
This file was deleted.

Firestore/core/src/local/leveldb_key.cc

-36
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace local {
3939
namespace {
4040

4141
const char* kVersionGlobalTable = "version";
42-
const char* kGlobalsTable = "globals";
4342
const char* kMutationsTable = "mutation";
4443
const char* kDocumentMutationsTable = "document_mutation";
4544
const char* kMutationQueuesTable = "mutation_queue";
@@ -160,11 +159,6 @@ enum ComponentLabel {
160159
*/
161160
DataMigrationName = 25,
162161

163-
/**
164-
* The name of a global.
165-
*/
166-
GlobalName = 26,
167-
168162
/**
169163
* A path segment describes just a single segment in a resource path. Path
170164
* segments that occur sequentially in a key represent successive segments in
@@ -251,10 +245,6 @@ class Reader {
251245
return ReadLabeledString(ComponentLabel::BundleId);
252246
}
253247

254-
std::string ReadGlobalName() {
255-
return ReadLabeledString(ComponentLabel::GlobalName);
256-
}
257-
258248
std::string ReadQueryName() {
259249
return ReadLabeledString(ComponentLabel::QueryName);
260250
}
@@ -728,10 +718,6 @@ class Writer {
728718
WriteLabeledString(ComponentLabel::TableName, table_name);
729719
}
730720

731-
void WriteGlobalName(absl::string_view global_name) {
732-
WriteLabeledString(ComponentLabel::GlobalName, global_name);
733-
}
734-
735721
void WriteBatchId(model::BatchId batch_id) {
736722
WriteLabeledInt32(ComponentLabel::BatchId, batch_id);
737723
}
@@ -1220,28 +1206,6 @@ bool LevelDbRemoteDocumentReadTimeKey::Decode(absl::string_view key) {
12201206
return reader.ok();
12211207
}
12221208

1223-
std::string LevelDbGlobalKey::KeyPrefix() {
1224-
Writer writer;
1225-
writer.WriteTableName(kGlobalsTable);
1226-
return writer.result();
1227-
}
1228-
1229-
std::string LevelDbGlobalKey::Key(absl::string_view global_name) {
1230-
Writer writer;
1231-
writer.WriteTableName(kGlobalsTable);
1232-
writer.WriteGlobalName(global_name);
1233-
writer.WriteTerminator();
1234-
return writer.result();
1235-
}
1236-
1237-
bool LevelDbGlobalKey::Decode(absl::string_view key) {
1238-
Reader reader{key};
1239-
reader.ReadTableNameMatching(kGlobalsTable);
1240-
global_name_ = reader.ReadGlobalName();
1241-
reader.ReadTerminator();
1242-
return reader.ok();
1243-
}
1244-
12451209
std::string LevelDbBundleKey::KeyPrefix() {
12461210
Writer writer;
12471211
writer.WriteTableName(kBundlesTable);

Firestore/core/src/local/leveldb_key.h

-35
Original file line numberDiff line numberDiff line change
@@ -768,41 +768,6 @@ class LevelDbNamedQueryKey {
768768
std::string name_;
769769
};
770770

771-
/**
772-
* A key in the globals table, storing the name of the global value.
773-
*/
774-
class LevelDbGlobalKey {
775-
public:
776-
/**
777-
* Creates a key prefix that points just before the first key of the table.
778-
*/
779-
static std::string KeyPrefix();
780-
781-
/**
782-
* Creates a key that points to the key for the given name of global value.
783-
*/
784-
static std::string Key(absl::string_view global_name);
785-
786-
/**
787-
* Decodes the given complete key, storing the decoded values in this
788-
* instance.
789-
*
790-
* @return true if the key successfully decoded, false otherwise. If false is
791-
* returned, this instance is in an undefined state until the next call to
792-
* `Decode()`.
793-
*/
794-
ABSL_MUST_USE_RESULT
795-
bool Decode(absl::string_view key);
796-
797-
/** The name that serves as identifier for global value for this entry. */
798-
const std::string& global_name() const {
799-
return global_name_;
800-
}
801-
802-
private:
803-
std::string global_name_;
804-
};
805-
806771
/**
807772
* A key in the index_configuration table, storing the index definition proto,
808773
* and the collection (group) it applies to.

Firestore/core/src/local/leveldb_persistence.cc

-5
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ LevelDbPersistence::LevelDbPersistence(std::unique_ptr<leveldb::DB> db,
126126
reference_delegate_ =
127127
absl::make_unique<LevelDbLruReferenceDelegate>(this, lru_params);
128128
bundle_cache_ = absl::make_unique<LevelDbBundleCache>(this, &serializer_);
129-
globals_cache_ = absl::make_unique<LevelDbGlobalsCache>(this);
130129

131130
// TODO(gsoltis): set up a leveldb transaction for these operations.
132131
target_cache_->Start();
@@ -251,10 +250,6 @@ LevelDbTargetCache* LevelDbPersistence::target_cache() {
251250
return target_cache_.get();
252251
}
253252

254-
LevelDbGlobalsCache* LevelDbPersistence::globals_cache() {
255-
return globals_cache_.get();
256-
}
257-
258253
LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() {
259254
return document_cache_.get();
260255
}

Firestore/core/src/local/leveldb_persistence.h

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "Firestore/core/src/credentials/user.h"
2626
#include "Firestore/core/src/local/leveldb_bundle_cache.h"
2727
#include "Firestore/core/src/local/leveldb_document_overlay_cache.h"
28-
#include "Firestore/core/src/local/leveldb_globals_cache.h"
2928
#include "Firestore/core/src/local/leveldb_index_manager.h"
3029
#include "Firestore/core/src/local/leveldb_lru_reference_delegate.h"
3130
#include "Firestore/core/src/local/leveldb_migrations.h"
@@ -85,8 +84,6 @@ class LevelDbPersistence : public Persistence {
8584

8685
LevelDbBundleCache* bundle_cache() override;
8786

88-
LevelDbGlobalsCache* globals_cache() override;
89-
9087
LevelDbDocumentOverlayCache* GetDocumentOverlayCache(
9188
const credentials::User& user) override;
9289
LevelDbOverlayMigrationManager* GetOverlayMigrationManager(
@@ -157,7 +154,6 @@ class LevelDbPersistence : public Persistence {
157154
bool started_ = false;
158155

159156
std::unique_ptr<LevelDbBundleCache> bundle_cache_;
160-
std::unique_ptr<LevelDbGlobalsCache> globals_cache_;
161157
std::unordered_map<std::string, std::unique_ptr<LevelDbDocumentOverlayCache>>
162158
document_overlay_caches_;
163159
std::unordered_map<std::string,

Firestore/core/src/local/memory_globals_cache.cc

-33
This file was deleted.

0 commit comments

Comments
 (0)