Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatible interfaces for storage connector provider #17478

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -20,11 +20,12 @@
package org.apache.druid.storage;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.google.inject.Provider;

import java.io.File;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public interface ExportStorageProvider
public interface ExportStorageProvider extends Provider<StorageConnector>
{
String getResourceType();

Expand All @@ -36,4 +37,17 @@ public interface ExportStorageProvider
String getFilePathForManifest(String fileName);

StorageConnector createStorageConnector(File taskTempDir);

/**
* It is the responsibilty of the caller to have the tempDir configured through runtime properties. If tempDir not configured,
* usages of {@link StorageConnector} might throw exception.
* <br></br>
* Deprecated in favour of {@link ExportStorageProvider#createStorageConnector(File)}.
*/
@Override
@Deprecated
default StorageConnector get()
{
return createStorageConnector(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
package org.apache.druid.storage;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.google.inject.Provider;

import java.io.File;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public interface StorageConnectorProvider
public interface StorageConnectorProvider extends Provider<StorageConnector>
{
/**
* Returns the storage connector. Takes a parameter defaultTempDir to be possibly used as the temporary directory, if the
Expand All @@ -36,4 +37,18 @@ public interface StorageConnectorProvider
* task id, and such dynamic task specific bindings is not possible on indexers.
*/
StorageConnector createStorageConnector(File defaultTempDir);


/**
* It is the responsibilty of the caller to have the tempDir configured through runtime properties. If tempDir not configured,
* usages of {@link StorageConnector} might throw exception.
* <br></br>
* Deprecated in favour of {@link StorageConnectorProvider#createStorageConnector(File)}.
*/
@Override
@Deprecated
default StorageConnector get()
{
return createStorageConnector(null);
}
}
Loading