Walkthrough
The following steps simulate a typical user session. An end result is then shown.
The user uploads content:
mvn jetty:run -Dfcrepo.ispn.repo.CacheDirPath=/tmp/FedoraRepo -Dmodeshape.xx curl -v -XPUT --upload-file X.txt http://localhost:8080/rest/X-1/ds0/fcr:content curl -v -XPUT --upload-file X.jpg http://localhost:8080/rest/X-2/ds0/fcr:content
The directory layout would like this:
ls /tmp/FedoraRepo ---
Configuration Options
File system Backends
LevelDB
Specifying fcrepo.ispn.repo.CacheDirPath=/tmp/FedoraRepo would result in a directory with LevelDB artifacts, such as files 000003.log.
Currently, the default configuration outputs Fedora data to LevelDB (a fast filesystem based key-value store). When Fedora 4 is started, ModeShape (actually Infinispan and LevelDB in the background) will create several directories on the filesystem. Currently, the directories created are:
- fcrepo.ispn.binary.CacheDirPath (binary data)
- fcrepo.ispn.CacheDirPath (metadata)
- fcrepo.ispn.repo.CacheDirPath (repository)
- fcrepo.modeshape.index.location
The layout of files in directories 1-3 is determined by LevelDB. Some of the important files are:
- File .log holds entries for recent transactions. The relevant API for representing these entries is modeshape-schematics (see, e.g., org.infinispan.schematic.SchematicEntry)
- File .sst stores these entries when the .log file reaches a size threshold. A new log file is generated.
- File MANIFEST.x records info about .sst files (among other things).
- File CURRENT specifies the current MANIFEST file.
Most of these files are binary and can be read by a LevelDB Java library.
FileCacheStore
Using the Infinispan 6.x deprecated FileCacheStore (specified via file/infinispan.xml, currently our ModeShape is on 5.x) results in creation of hundreds of binary files (compared to LevelDB). A hashing algorithm is used to map keys to buckets. The value files contain serialized ModeShape objects. The key files can be read using org.infinispan.schematic.internal.document.BsonReader. (It does not seem possible to read these files using existing bson tools, like mongoDB bsondump, but further inspection is needed.)