Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import io.pixelsdb.pixels.common.exception.RetinaException;
import io.pixelsdb.pixels.common.physical.*;
import io.pixelsdb.pixels.common.utils.ConfigFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;
import java.nio.ByteBuffer;
Expand All @@ -31,6 +33,7 @@
*/
public class ObjectStorageManager
{
private static final Logger logger = LogManager.getLogger(ObjectStorageManager.class);
private static volatile ObjectStorageManager instance;
private final Storage storage;
private final String path;
Expand All @@ -49,17 +52,12 @@ private ObjectStorageManager() throws RetinaException
String storageScheme = config.getProperty("retina.buffer.object.storage.scheme");
try
{
switch(storageScheme)
if (!Storage.Scheme.minio.equals(storageScheme) && !Storage.Scheme.s3.equals(storageScheme))
{
case "s3":
this.storage = StorageFactory.Instance().getStorage(Storage.Scheme.s3);
break;
case "minio":
this.storage = StorageFactory.Instance().getStorage(Storage.Scheme.minio);
break;
default:
throw new RetinaException("Unsupported storage scheme: " + storageScheme);
logger.warn("ObjectStorageManager is configured with non-standard storage scheme '{}'; " +
"expected production schemes are 's3' or 'minio'", storageScheme);
}
this.storage = StorageFactory.Instance().getStorage(storageScheme);
} catch (IOException e)
{
throw new RetinaException("Failed to get storage", e);
Expand Down
Loading