mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
don't rewrite objects only if their metadata has changed
This commit is contained in:
@@ -164,7 +164,9 @@ public class JObject<T extends JObjectData> implements Serializable {
|
||||
|| ref != _metaPart.getRefcount()
|
||||
|| wasDeleted != _metaPart.isDeleted()
|
||||
|| wasSeen != _metaPart.isSeen())
|
||||
notifyWrite();
|
||||
notifyWriteMeta();
|
||||
if (!Objects.equals(ver, _metaPart.getOurVersion()))
|
||||
notifyWriteData();
|
||||
verifyRefs();
|
||||
return ret;
|
||||
} finally {
|
||||
@@ -181,9 +183,19 @@ public class JObject<T extends JObjectData> implements Serializable {
|
||||
return _dataPart.get() != null;
|
||||
}
|
||||
|
||||
public void notifyWrite() {
|
||||
public void notifyWriteMeta() {
|
||||
assertRWLock();
|
||||
_resolver.notifyWrite(this);
|
||||
_resolver.notifyWriteMeta(this);
|
||||
}
|
||||
|
||||
public void notifyWriteData() {
|
||||
assertRWLock();
|
||||
_resolver.notifyWriteData(this);
|
||||
}
|
||||
|
||||
public void notifyWrite() {
|
||||
notifyWriteMeta();
|
||||
notifyWriteData();
|
||||
}
|
||||
|
||||
public void bumpVer() {
|
||||
|
||||
@@ -192,7 +192,6 @@ public class JObjectManagerImpl implements JObjectManager {
|
||||
created.runWriteLocked(JObject.ResolutionStrategy.NO_RESOLUTION, (m, d, b, i) -> {
|
||||
parent.ifPresent(m::addRef);
|
||||
m.markSeen();
|
||||
jObjectResolver.notifyWrite(created);
|
||||
return null;
|
||||
});
|
||||
return created;
|
||||
|
||||
@@ -110,9 +110,13 @@ public class JObjectResolver {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyWrite(JObject<?> self) {
|
||||
public void notifyWriteMeta(JObject<?> self) {
|
||||
self.assertRWLock();
|
||||
jObjectWriteback.markDirty(self.getName(), self);
|
||||
}
|
||||
|
||||
public void notifyWriteData(JObject<?> self) {
|
||||
self.assertRWLock();
|
||||
if (self.isResolved())
|
||||
invalidationQueueService.pushInvalidationToAll(self.getName(), !self.getMeta().isSeen());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user