mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
somewhat working FS layer
This commit is contained in:
@@ -111,7 +111,7 @@ public class DhfsFileServiceImpl implements DhfsFileService {
|
||||
if (d instanceof File f) {
|
||||
ret = new GetattrRes(f.getMtime(), f.getCtime(), f.getMode(), f.isSymlink() ? GetattrType.SYMLINK : GetattrType.FILE);
|
||||
} else if (d instanceof TreeNodeJObjectData) {
|
||||
ret = new GetattrRes(100, 100, 0777, GetattrType.DIRECTORY);
|
||||
ret = new GetattrRes(100, 100, 0700, GetattrType.DIRECTORY);
|
||||
} else {
|
||||
throw new StatusRuntimeException(Status.DATA_LOSS.withDescription("FsNode is not an FsNode: " + m.getName()));
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ public class JKleppmannTreeManager {
|
||||
}
|
||||
|
||||
private JKleppmannTree createTree(String name) {
|
||||
return new JKleppmannTree(_persistentData.computeIfAbsent(name, n -> new JKleppmannTreePersistentData(opQueueHelper, n, new AtomicClock())), storageInterfaceService, jPeerInterface);
|
||||
var pdata = _persistentData.computeIfAbsent(name, n -> new JKleppmannTreePersistentData(opQueueHelper, n, new AtomicClock()));
|
||||
pdata.restoreHelper(opQueueHelper);
|
||||
return new JKleppmannTree(pdata, storageInterfaceService, jPeerInterface);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,17 @@ public class JKleppmannTreePersistentData implements Serializable, OpQueue {
|
||||
@Getter
|
||||
private final ReentrantReadWriteLock _logLock = new ReentrantReadWriteLock();
|
||||
|
||||
private final OpQueueHelper _helper;
|
||||
private transient OpQueueHelper _helper;
|
||||
|
||||
JKleppmannTreePersistentData(OpQueueHelper opQueueHelper, String name, AtomicClock clock) {
|
||||
_name = name;
|
||||
_clock = clock;
|
||||
_selfUuid = opQueueHelper.getSelfUUid();
|
||||
restoreHelper(opQueueHelper);
|
||||
}
|
||||
|
||||
public void restoreHelper(OpQueueHelper opQueueHelper) {
|
||||
_helper = opQueueHelper;
|
||||
_selfUuid = _helper.getSelfUUid();
|
||||
_helper.registerOnConnection(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user