-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into yunyad-remove-redundancy
- Loading branch information
Showing
24 changed files
with
1,535 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
.../workflow-core/src/main/scala/edu/uci/ics/amber/core/storage/IcebergCatalogInstance.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package edu.uci.ics.amber.core.storage | ||
|
||
import edu.uci.ics.amber.util.IcebergUtil | ||
import org.apache.iceberg.catalog.Catalog | ||
|
||
/** | ||
* IcebergCatalogInstance is a singleton that manages the Iceberg catalog instance. | ||
* - Provides a single shared catalog for all Iceberg table-related operations in the Texera application. | ||
* - Lazily initializes the catalog on first access. | ||
* - Supports replacing the catalog instance primarily for testing or reconfiguration. | ||
*/ | ||
object IcebergCatalogInstance { | ||
|
||
private var instance: Option[Catalog] = None | ||
|
||
/** | ||
* Retrieves the singleton Iceberg catalog instance. | ||
* - If the catalog is not initialized, it is lazily created using the configured properties. | ||
* @return the Iceberg catalog instance. | ||
*/ | ||
def getInstance(): Catalog = { | ||
instance match { | ||
case Some(catalog) => catalog | ||
case None => | ||
val hadoopCatalog = IcebergUtil.createHadoopCatalog( | ||
"texera_iceberg", | ||
StorageConfig.fileStorageDirectoryPath | ||
) | ||
instance = Some(hadoopCatalog) | ||
hadoopCatalog | ||
} | ||
} | ||
|
||
/** | ||
* Replaces the existing Iceberg catalog instance. | ||
* - This method is useful for testing or dynamically updating the catalog. | ||
* | ||
* @param catalog the new Iceberg catalog instance to replace the current one. | ||
*/ | ||
def replaceInstance(catalog: Catalog): Unit = { | ||
instance = Some(catalog) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.