Skip to content

Commit

Permalink
Remove init
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbranco80 committed Mar 5, 2025
1 parent b3b3faa commit 6e14b16
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 34 deletions.
25 changes: 9 additions & 16 deletions src/main/java/com/rawlabs/das/sdk/DASSdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@

public interface DASSdk {

/**
* Initialize the SDK.
*
* <p>This method can be used to perform any startup logic, such as allocating resources,
* establishing connections, etc.
*/
void init();

/**
* Close the SDK.
*
* <p>This method can be used to perform any cleanup logic, such as releasing resources, closing
* connections, etc.
*/
void close();

/** @return a list of table definitions. */
List<TableDefinition> getTableDefinitions();

Expand All @@ -56,4 +40,13 @@ public interface DASSdk {
* @return Optional containing the DASFunction if present
*/
Optional<DASFunction> getFunction(String name);

/**
* Close the SDK.
*
* <p>This method can be used to perform any cleanup logic, such as releasing resources, closing
* connections, etc.
*/
default void close() {}

}
21 changes: 7 additions & 14 deletions src/main/scala/com/rawlabs/das/sdk/scala/DASSdk.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ import com.rawlabs.protocol.das.v1.tables.TableDefinition

trait DASSdk {

/**
* Initialize the SDK.
*
* This method can be used to perform any startup logic, such as allocating resources, establishing connections, etc.
*/
def init(): Unit = {}

/**
* Close the SDK.
*
* This method can be used to perform any cleanup logic, such as releasing resources, closing connections, etc.
*/
def close(): Unit = {}

/**
* @return a list of table definitions.
*/
Expand All @@ -57,4 +43,11 @@ trait DASSdk {
*/
def getFunction(name: String): Option[DASFunction]

/**
* Close the SDK.
*
* This method can be used to perform any cleanup logic, such as releasing resources, closing connections, etc.
*/
def close(): Unit = {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import com.rawlabs.protocol.das.v1.types.Value

class DASSdkScalaToJavaBridge(scalaSdk: DASSdk) extends com.rawlabs.das.sdk.DASSdk {

final override def init(): Unit = scalaSdk.init()

final override def close(): Unit = scalaSdk.close()

final override def getTableDefinitions: util.List[com.rawlabs.protocol.das.v1.tables.TableDefinition] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ class DASSdkManager(implicit settings: DASSettings) extends StrictLogging {

// Build the SDK instance
val das = builder.build(dasConfig.options.asJava, settings)
// Call init to set up resources
das.init()
logger.debug(s"DAS SDK for type: $dasType initialized.")
das
}
Expand Down

0 comments on commit 6e14b16

Please sign in to comment.