Class UpdateWarehouseInstanceHandler
- java.lang.Object
-
- com.snowflake.connectors.taskreactor.api.UpdateWarehouseInstanceHandler
-
public class UpdateWarehouseInstanceHandler extends Object
Handler for the Task Reactor instance warehouse update. A new instance of the handler must be created usingthe builder
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_TYPE
Error type for the connector configuration failure, used by theConnectorErrorHelper
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UpdateWarehouseInstanceHandlerBuilder
builder(Session session)
Returns a new instance ofUpdateWarehouseInstanceHandlerBuilder
.static Variant
updateWarehouse(Session session, String warehouseName, String instanceSchema)
Default handler method for theTASK_REACTOR.UPDATE_WAREHOUSE
procedure.ConnectorResponse
updateWarehouse(String warehouseName, String instanceSchema)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
Error type for the connector configuration failure, used by theConnectorErrorHelper
.- See Also:
- Constant Field Values
-
-
Method Detail
-
updateWarehouse
public static Variant updateWarehouse(Session session, String warehouseName, String instanceSchema)
Default handler method for theTASK_REACTOR.UPDATE_WAREHOUSE
procedure.Updates warehouse used by all tasks within the specified Task Reactor instance by inserting the
UPDATE_WAREHOUSE
command into the Task Reactor command queue.- Parameters:
session
- Snowpark session objectwarehouseName
- new warehouse name provided to the handlerinstanceSchema
- task reactor instance name- Returns:
- a variant representing the
ConnectorResponse
returned byupdateWarehouse
-
builder
public static UpdateWarehouseInstanceHandlerBuilder builder(Session session)
Returns a new instance ofUpdateWarehouseInstanceHandlerBuilder
.- Parameters:
session
- Snowpark session object- Returns:
- a new builder instance
-
updateWarehouse
public ConnectorResponse updateWarehouse(String warehouseName, String instanceSchema)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.- Parameters:
warehouseName
- name of the warehouseinstanceSchema
- instance name- Returns:
- a response with the code
OK
if the execution was successful, otherwise a response with an error code and an error message
-
-