Get rid of unused field

This commit is contained in:
alesapin 2021-03-03 15:29:00 +03:00
parent 37fc5faa6f
commit 0136d7d51a
3 changed files with 7 additions and 10 deletions

View File

@ -54,7 +54,6 @@ namespace
{
Coordination::write(node.data, out);
Coordination::write(node.acls, out);
Coordination::write(node.ephemeral_owner, out);
Coordination::write(node.is_sequental, out);
Coordination::write(node.stat, out);
Coordination::write(node.seq_num, out);
@ -64,7 +63,6 @@ namespace
{
Coordination::read(node.data, in);
Coordination::read(node.acls, in);
Coordination::read(node.ephemeral_owner, in);
Coordination::read(node.is_sequental, in);
Coordination::read(node.stat, in);
Coordination::read(node.seq_num, in);
@ -78,7 +76,7 @@ namespace
SnapshotMetadataPtr deserializeSnapshotMetadata(ReadBuffer & in)
{
/// FIXME (alesap)
/// FIXME double copy (alesap)
std::string data;
Coordination::read(data, in);
auto buffer = nuraft::buffer::alloc(data.size());
@ -140,8 +138,8 @@ SnapshotMetadataPtr NuKeeperStorageSnapshot::deserialize(NuKeeperStorage & stora
NuKeeperStorage::Node node;
readNode(node, in);
storage.container.insertOrReplace(path, node);
if (node.ephemeral_owner != 0)
storage.ephemerals[node.ephemeral_owner].insert(path);
if (node.stat.ephemeralOwner != 0)
storage.ephemerals[node.stat.ephemeralOwner].insert(path);
current_size++;
}

View File

@ -137,7 +137,7 @@ struct NuKeeperStorageCreateRequest final : public NuKeeperStorageRequest
{
response.error = Coordination::Error::ZNONODE;
}
else if (it->value.ephemeral_owner != 0)
else if (it->value.stat.ephemeralOwner != 0)
{
response.error = Coordination::Error::ZNOCHILDRENFOREPHEMERALS;
}
@ -150,8 +150,8 @@ struct NuKeeperStorageCreateRequest final : public NuKeeperStorageRequest
created_node.stat.mtime = created_node.stat.ctime;
created_node.stat.numChildren = 0;
created_node.stat.dataLength = request.data.length();
created_node.stat.ephemeralOwner = request.is_ephemeral ? session_id : 0;
created_node.data = request.data;
created_node.ephemeral_owner = request.is_ephemeral ? session_id : 0;
created_node.is_sequental = request.is_sequential;
std::string path_created = request.path;
@ -256,7 +256,7 @@ struct NuKeeperStorageRemoveRequest final : public NuKeeperStorageRequest
else
{
auto prev_node = it->value;
if (prev_node.ephemeral_owner != 0)
if (prev_node.stat.ephemeralOwner != 0)
ephemerals[session_id].erase(request.path);
auto child_basename = getBaseName(it->key);
@ -273,7 +273,7 @@ struct NuKeeperStorageRemoveRequest final : public NuKeeperStorageRequest
undo = [prev_node, &container, &ephemerals, session_id, path = request.path, child_basename]
{
if (prev_node.ephemeral_owner != 0)
if (prev_node.stat.ephemeralOwner != 0)
ephemerals[session_id].emplace(path);
container.insert(path, prev_node);

View File

@ -31,7 +31,6 @@ public:
{
String data;
Coordination::ACLs acls{};
int64_t ephemeral_owner = 0;
bool is_sequental = false;
Coordination::Stat stat{};
int32_t seq_num = 0;