Skip to content

Commit ebb8a82

Browse files
committed
Better DLFS API WIP
1 parent 9ee26c2 commit ebb8a82

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

convex-core/src/main/java/convex/lattice/fs/DLFSLattice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* - Missing entries from one side are added from the other
2020
* - Tombstones (deleted files) are preserved appropriately
2121
*
22-
* The merge behavior is equivalent to Unix rsync between two drives, where:
22+
* The merge behaviour is equivalent to Unix rsync between two drives, where:
2323
* - Files/directories that exist in both are merged
2424
* - Files/directories that exist only in one are copied to the result
2525
* - Conflicts are resolved by timestamp (newer wins)

convex-core/src/main/java/convex/lattice/fs/impl/DLFSLocal.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
*/
3333
public class DLFSLocal extends DLFileSystem {
3434

35-
Root<AVector<ACell>> rootCursor;
35+
// Cursor for filesystem root node. This may be a path into a bigger lattice
36+
ACursor<AVector<ACell>> rootCursor;
3637

3738
public DLFSLocal(DLFSProvider dlfsProvider, String uriPath, AVector<ACell> rootNode) {
3839
super(dlfsProvider,uriPath,DLFSNode.getUTime(rootNode));
@@ -48,12 +49,7 @@ public DLFSLocal(DLFSProvider dlfsProvider, String uriPath, AVector<ACell> rootN
4849
*/
4950
public DLFSLocal(DLFSProvider dlfsProvider, String uriPath, ACursor<AVector<ACell>> cursor) {
5051
super(dlfsProvider, uriPath, DLFSNode.getUTime(cursor.get()));
51-
if (cursor instanceof Root) {
52-
this.rootCursor = (Root<AVector<ACell>>) cursor;
53-
} else {
54-
// Wrap in Root to ensure we have a Root cursor
55-
this.rootCursor = Root.create(cursor.get());
56-
}
52+
this.rootCursor = cursor;
5753
}
5854

5955
public static DLFSLocal create(DLFSProvider provider) {

0 commit comments

Comments
 (0)