Search in sources :

Example 1 with PersistentObjectStorePartition

use of org.mule.runtime.core.internal.util.store.PersistentObjectStorePartition in project mule by mulesoft.

the class PartitionedPersistentObjectStore method createPartition.

private void createPartition(String partitionName) throws ObjectStoreException {
    PersistentObjectStorePartition persistentObjectStorePartition = new PersistentObjectStorePartition(muleContext, partitionName, getNewPartitionDirectory());
    persistentObjectStorePartition.open();
    partitionsByName.put(partitionName, persistentObjectStorePartition);
}
Also used : PersistentObjectStorePartition(org.mule.runtime.core.internal.util.store.PersistentObjectStorePartition)

Example 2 with PersistentObjectStorePartition

use of org.mule.runtime.core.internal.util.store.PersistentObjectStorePartition in project mule by mulesoft.

the class PartitionedPersistentObjectStore method loadPreviousStoredPartitions.

private void loadPreviousStoredPartitions() throws ObjectStoreException {
    File[] directories = storeDirectory.listFiles(File::isDirectory);
    if (directories == null) {
        return;
    }
    for (File partitionDirectory : directories) {
        try {
            PersistentObjectStorePartition persistentObjectStorePartition = new PersistentObjectStorePartition(muleContext, partitionDirectory);
            persistentObjectStorePartition.open();
            partitionsByName.put(persistentObjectStorePartition.getPartitionName(), persistentObjectStorePartition);
        } catch (Exception e) {
            LOGGER.error("Could not restore partition under directory " + partitionDirectory.getAbsolutePath());
        }
    }
}
Also used : File(java.io.File) PersistentObjectStorePartition(org.mule.runtime.core.internal.util.store.PersistentObjectStorePartition) ObjectStoreException(org.mule.runtime.api.store.ObjectStoreException) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException)

Aggregations

PersistentObjectStorePartition (org.mule.runtime.core.internal.util.store.PersistentObjectStorePartition)2 File (java.io.File)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 ObjectStoreException (org.mule.runtime.api.store.ObjectStoreException)1