use of org.apache.jackrabbit.core.persistence.util.BundleBinding in project jackrabbit by apache.
the class InMemBundlePersistenceManager method init.
//---------------------------------------------------< PersistenceManager >
/**
* {@inheritDoc}
*/
public void init(PMContext context) throws Exception {
if (initialized) {
throw new IllegalStateException("already initialized");
}
super.init(context);
// initialize mem stores
bundleStore = new LinkedHashMap<NodeId, byte[]>(initialCapacity, loadFactor);
refsStore = new HashMap<NodeId, byte[]>(initialCapacity, loadFactor);
// Choose a FileSystem for the BlobStore based on whether data is persistent or not
if (useFileBlobStore) {
blobFS = new LocalFileSystem();
((LocalFileSystem) blobFS).setRoot(new File(context.getHomeDir(), "blobs"));
blobFS.init();
blobStore = new FileSystemBLOBStore(blobFS);
} else {
blobStore = new InMemBLOBStore();
}
wspFS = context.getFileSystem();
// load namespaces
binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(), context.getDataStore());
binding.setMinBlobSize(minBlobSize);
if (persistent) {
// deserialize contents of the stores
loadContents();
}
initialized = true;
}
use of org.apache.jackrabbit.core.persistence.util.BundleBinding in project jackrabbit by apache.
the class BundleFsPersistenceManager method init.
/**
* {@inheritDoc}
*/
public void init(PMContext context) throws Exception {
if (initialized) {
throw new IllegalStateException("already initialized");
}
super.init(context);
this.name = context.getHomeDir().getName();
// create item fs
itemFs = new BasedFileSystem(context.getFileSystem(), "items");
// create correct blob store
if (useLocalFsBlobStore()) {
LocalFileSystem blobFS = new LocalFileSystem();
blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
blobFS.init();
blobStore = new BundleFsPersistenceManager.FSBlobStore(blobFS);
} else {
blobStore = new BundleFsPersistenceManager.FSBlobStore(itemFs);
}
// load namespaces
binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(), context.getDataStore());
binding.setMinBlobSize(minBlobSize);
initialized = true;
}
use of org.apache.jackrabbit.core.persistence.util.BundleBinding in project jackrabbit by apache.
the class BundleDbPersistenceManager method init.
/**
* {@inheritDoc}
*/
public void init(PMContext context) throws Exception {
if (initialized) {
throw new IllegalStateException("already initialized");
}
super.init(context);
conHelper = createConnectionHelper(getDataSource());
this.name = context.getHomeDir().getName();
// make sure schemaObjectPrefix consists of legal name characters only
schemaObjectPrefix = conHelper.prepareDbIdentifier(schemaObjectPrefix);
// check if schema objects exist and create them if necessary
if (isSchemaCheckEnabled()) {
createCheckSchemaOperation().run();
}
// create correct blob store
blobStore = createBlobStore();
buildSQLStatements();
// load namespaces
binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(), context.getDataStore());
binding.setMinBlobSize(minBlobSize);
initialized = true;
if (consistencyCheck) {
// check all bundles
checkConsistency(null, true, consistencyFix);
}
}
Aggregations