Skip to content

Commit

Permalink
Revert "SessionToken persistence implementation (#13684)" (#13719)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersen authored Sep 25, 2024
1 parent 2893101 commit fb09f93
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 594 deletions.
1 change: 0 additions & 1 deletion Firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 11.3.0
- [changed] Improve efficiency of memory persistence when processing a large number of writes. (#13572)
- [changed] Prepare Firestore cache to support session token.

# 11.2.0
- [fixed] Marked all public classes with only readonly properties as `Sendable` to address
Expand Down
44 changes: 0 additions & 44 deletions Firestore/Example/Firestore.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

57 changes: 0 additions & 57 deletions Firestore/core/src/local/globals_cache.h

This file was deleted.

57 changes: 0 additions & 57 deletions Firestore/core/src/local/leveldb_globals_cache.cc

This file was deleted.

52 changes: 0 additions & 52 deletions Firestore/core/src/local/leveldb_globals_cache.h

This file was deleted.

36 changes: 0 additions & 36 deletions Firestore/core/src/local/leveldb_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ namespace local {
namespace {

const char* kVersionGlobalTable = "version";
const char* kGlobalsTable = "globals";
const char* kMutationsTable = "mutation";
const char* kDocumentMutationsTable = "document_mutation";
const char* kMutationQueuesTable = "mutation_queue";
Expand Down Expand Up @@ -160,11 +159,6 @@ enum ComponentLabel {
*/
DataMigrationName = 25,

/**
* The name of a global.
*/
GlobalName = 26,

/**
* A path segment describes just a single segment in a resource path. Path
* segments that occur sequentially in a key represent successive segments in
Expand Down Expand Up @@ -251,10 +245,6 @@ class Reader {
return ReadLabeledString(ComponentLabel::BundleId);
}

std::string ReadGlobalName() {
return ReadLabeledString(ComponentLabel::GlobalName);
}

std::string ReadQueryName() {
return ReadLabeledString(ComponentLabel::QueryName);
}
Expand Down Expand Up @@ -728,10 +718,6 @@ class Writer {
WriteLabeledString(ComponentLabel::TableName, table_name);
}

void WriteGlobalName(absl::string_view global_name) {
WriteLabeledString(ComponentLabel::GlobalName, global_name);
}

void WriteBatchId(model::BatchId batch_id) {
WriteLabeledInt32(ComponentLabel::BatchId, batch_id);
}
Expand Down Expand Up @@ -1220,28 +1206,6 @@ bool LevelDbRemoteDocumentReadTimeKey::Decode(absl::string_view key) {
return reader.ok();
}

std::string LevelDbGlobalKey::KeyPrefix() {
Writer writer;
writer.WriteTableName(kGlobalsTable);
return writer.result();
}

std::string LevelDbGlobalKey::Key(absl::string_view global_name) {
Writer writer;
writer.WriteTableName(kGlobalsTable);
writer.WriteGlobalName(global_name);
writer.WriteTerminator();
return writer.result();
}

bool LevelDbGlobalKey::Decode(absl::string_view key) {
Reader reader{key};
reader.ReadTableNameMatching(kGlobalsTable);
global_name_ = reader.ReadGlobalName();
reader.ReadTerminator();
return reader.ok();
}

std::string LevelDbBundleKey::KeyPrefix() {
Writer writer;
writer.WriteTableName(kBundlesTable);
Expand Down
35 changes: 0 additions & 35 deletions Firestore/core/src/local/leveldb_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,41 +768,6 @@ class LevelDbNamedQueryKey {
std::string name_;
};

/**
* A key in the globals table, storing the name of the global value.
*/
class LevelDbGlobalKey {
public:
/**
* Creates a key prefix that points just before the first key of the table.
*/
static std::string KeyPrefix();

/**
* Creates a key that points to the key for the given name of global value.
*/
static std::string Key(absl::string_view global_name);

/**
* Decodes the given complete key, storing the decoded values in this
* instance.
*
* @return true if the key successfully decoded, false otherwise. If false is
* returned, this instance is in an undefined state until the next call to
* `Decode()`.
*/
ABSL_MUST_USE_RESULT
bool Decode(absl::string_view key);

/** The name that serves as identifier for global value for this entry. */
const std::string& global_name() const {
return global_name_;
}

private:
std::string global_name_;
};

/**
* A key in the index_configuration table, storing the index definition proto,
* and the collection (group) it applies to.
Expand Down
5 changes: 0 additions & 5 deletions Firestore/core/src/local/leveldb_persistence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ LevelDbPersistence::LevelDbPersistence(std::unique_ptr<leveldb::DB> db,
reference_delegate_ =
absl::make_unique<LevelDbLruReferenceDelegate>(this, lru_params);
bundle_cache_ = absl::make_unique<LevelDbBundleCache>(this, &serializer_);
globals_cache_ = absl::make_unique<LevelDbGlobalsCache>(this);

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

LevelDbGlobalsCache* LevelDbPersistence::globals_cache() {
return globals_cache_.get();
}

LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() {
return document_cache_.get();
}
Expand Down
4 changes: 0 additions & 4 deletions Firestore/core/src/local/leveldb_persistence.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "Firestore/core/src/credentials/user.h"
#include "Firestore/core/src/local/leveldb_bundle_cache.h"
#include "Firestore/core/src/local/leveldb_document_overlay_cache.h"
#include "Firestore/core/src/local/leveldb_globals_cache.h"
#include "Firestore/core/src/local/leveldb_index_manager.h"
#include "Firestore/core/src/local/leveldb_lru_reference_delegate.h"
#include "Firestore/core/src/local/leveldb_migrations.h"
Expand Down Expand Up @@ -85,8 +84,6 @@ class LevelDbPersistence : public Persistence {

LevelDbBundleCache* bundle_cache() override;

LevelDbGlobalsCache* globals_cache() override;

LevelDbDocumentOverlayCache* GetDocumentOverlayCache(
const credentials::User& user) override;
LevelDbOverlayMigrationManager* GetOverlayMigrationManager(
Expand Down Expand Up @@ -157,7 +154,6 @@ class LevelDbPersistence : public Persistence {
bool started_ = false;

std::unique_ptr<LevelDbBundleCache> bundle_cache_;
std::unique_ptr<LevelDbGlobalsCache> globals_cache_;
std::unordered_map<std::string, std::unique_ptr<LevelDbDocumentOverlayCache>>
document_overlay_caches_;
std::unordered_map<std::string,
Expand Down
33 changes: 0 additions & 33 deletions Firestore/core/src/local/memory_globals_cache.cc

This file was deleted.

Loading

0 comments on commit fb09f93

Please sign in to comment.