-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interface to allow "more direct" access to the filecache without direct db #44044
Conversation
17ea359
to
39b1c7c
Compare
39b1c7c
to
5f5b0ff
Compare
a14aa3a
to
224966c
Compare
19ff9e6
to
dc9729e
Compare
f6dc6a2
to
3dc3ee4
Compare
3dc3ee4
to
df7f85b
Compare
$qb->andWhere($qb->expr()->eq('f.storage', $qb->createNamedParameter($node->getMountPoint()->getNumericStorageId(), IQueryBuilder::PARAM_INT))); | ||
if ($shallow) { | ||
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId(), IQueryBuilder::PARAM_INT))); | ||
} else { | ||
$qb->andWhere($qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($node->getInternalPath()) . '/%'))); | ||
} | ||
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change about?
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_USER), | ||
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_GROUP), | ||
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_ROOM), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did the $src
parameter go?
@@ -0,0 +1,100 @@ | |||
<?php | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict typing missing
->where($builder->expr()->eq('m.mount_point', $mountPoint)) | ||
->andWhere($builder->expr()->in('m.user_id', $builder->createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY))); | ||
|
||
$result = $query->execute(); | ||
|
||
$results = []; | ||
while ($row = $result->fetch()) { | ||
$results[$row['user_id']] = $row['size']; | ||
$results[$row['user_id']] = $this->getSizeForHomeStorage($row['storage_id']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means one query per row instead of getting all sizes in the first query, no?
@@ -0,0 +1,76 @@ | |||
<?php | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict typing
… do direct db queries Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Robin Appelman <[email protected]>
Signed-off-by: Robin Appelman <[email protected]>
df7f85b
to
015988b
Compare
Let me split out the interface and changes to remove filecache joins to simplify reviewing |
Adds and interface for the filecache that is lower level than the "normal" filesystem apis to allow for some more optimized retrieval of filecache data without requiring direct database access.
This will be needed when we start restricting direct database access to the filecache for sharding.
Pr comes with a few cases of replacing direct-db with the new interface.
extracted from #43576