Skip to content

Commit

Permalink
Add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshsanjeev committed Oct 16, 2024
1 parent 4f1627d commit 1085f58
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public AzureStorageConnectorProvider(
}

@Override
public StorageConnector createStorageConnector(final File tempDir)
public StorageConnector createStorageConnector(final File defaultTempDir)
{
AzureOutputConfig config = this.getTempDir() == null ? this.withTempDir(tempDir) : this;
AzureOutputConfig config = this.getTempDir() == null ? this.withTempDir(defaultTempDir) : this;
config.validateTempDirectory();
return new AzureStorageConnector(config, azureStorage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public GoogleStorageConnectorProvider(
}

@Override
public StorageConnector createStorageConnector(File tempDir)
public StorageConnector createStorageConnector(File defaultTempDir)
{
GoogleOutputConfig config = this.getTempDir() == null ? this.withTempDir(tempDir) : this;
GoogleOutputConfig config = this.getTempDir() == null ? this.withTempDir(defaultTempDir) : this;
return new GoogleStorageConnector(config, googleStorage, googleInputDataConfig);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ WorkerManager newWorkerManager(
/**
* Fetch a directory for temporary outputs
*/
File taskTempDir();
default File taskTempDir()
{
throw new UnsupportedOperationException();
}

/**
* Client for communicating with workers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public S3StorageConnectorProvider(
}

@Override
public StorageConnector createStorageConnector(File tempDir)
public StorageConnector createStorageConnector(File defaultTempDir)
{
S3OutputConfig config = this.getTempDir() == null ? this.withTempDir(tempDir) : this;
S3OutputConfig config = this.getTempDir() == null ? this.withTempDir(defaultTempDir) : this;
return new S3StorageConnector(config, s3, s3UploadManager);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,14 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public interface StorageConnectorProvider
{
StorageConnector createStorageConnector(File tempDir);
/**
* Returns the storage connector. Takes a parameter defaultTempDir to be possibly used as the temporary directory, if the
* storage connector requires one. This StorageConnectorProvider is not guaranteed to use this value, even if the
* StorageConnectorProvider requires one, as it gives priority to a value of defaultTempDir configured as a runtime
* configuration.
* <br>
* This value needs to be passed instead of injected by Jackson as the default temporary directory is dependent on the
* task id, and such dynamic task specific bindings is not possible on indexers.
*/
StorageConnector createStorageConnector(File defaultTempDir);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public LocalFileStorageConnectorProvider(@JsonProperty(value = "basePath", requi
}

@Override
public StorageConnector createStorageConnector(File tempDir)
public StorageConnector createStorageConnector(File defaultTempDir)
{
try {
return new LocalFileStorageConnector(basePath);
Expand Down

0 comments on commit 1085f58

Please sign in to comment.