public class GobblinServiceFlowConfigResourceHandler extends Object implements FlowConfigsResourceHandler
FlowConfigsResourceHandler which consider if current node is Active or Standby.
When a Standby mode detected, it will forward the rest-li request (FlowConfig)
to the Active. Otherwise it will handle it locally.| Constructor and Description |
|---|
GobblinServiceFlowConfigResourceHandler(String serviceName,
boolean flowCatalogLocalCommit,
FlowConfigResourceLocalHandler handler,
com.google.common.base.Optional<org.apache.helix.HelixManager> manager,
GobblinServiceJobScheduler jobScheduler) |
| Modifier and Type | Method and Description |
|---|---|
com.linkedin.restli.server.CreateResponse |
createFlowConfig(FlowConfig flowConfig)
Adding
FlowConfig should check if current node is active (master). |
com.linkedin.restli.server.UpdateResponse |
deleteFlowConfig(FlowId flowId,
Properties header)
Deleting
FlowConfig should check if current node is active (master). |
Collection<FlowConfig> |
getAllFlowConfigs() |
FlowConfig |
getFlowConfig(FlowId flowId) |
Collection<FlowConfig> |
getFlowConfig(FlowSpecSearchObject flowSpecSearchObject) |
com.linkedin.restli.server.UpdateResponse |
partialUpdateFlowConfig(FlowId flowId,
com.linkedin.restli.common.PatchRequest<FlowConfig> flowConfigPatch) |
com.linkedin.restli.server.UpdateResponse |
updateFlowConfig(FlowId flowId,
FlowConfig flowConfig)
Updating
FlowConfig should check if current node is active (master). |
public GobblinServiceFlowConfigResourceHandler(String serviceName, boolean flowCatalogLocalCommit, FlowConfigResourceLocalHandler handler, com.google.common.base.Optional<org.apache.helix.HelixManager> manager, GobblinServiceJobScheduler jobScheduler)
public FlowConfig getFlowConfig(FlowId flowId) throws FlowConfigLoggedException
getFlowConfig in interface FlowConfigsResourceHandlerFlowConfigLoggedExceptionpublic Collection<FlowConfig> getFlowConfig(FlowSpecSearchObject flowSpecSearchObject) throws FlowConfigLoggedException
getFlowConfig in interface FlowConfigsResourceHandlerFlowConfigLoggedExceptionpublic Collection<FlowConfig> getAllFlowConfigs()
getAllFlowConfigs in interface FlowConfigsResourceHandlerpublic com.linkedin.restli.server.CreateResponse createFlowConfig(FlowConfig flowConfig) throws FlowConfigLoggedException
FlowConfig should check if current node is active (master).
If current node is active, call FlowConfigResourceLocalHandler.createFlowConfig(FlowConfig) directly.
If current node is standby, forward ServiceConfigKeys.HELIX_FLOWSPEC_ADD to active. The remote active will
then call FlowConfigResourceLocalHandler.createFlowConfig(FlowConfig).
Please refer to ControllerUserDefinedMessageHandlerFactory for remote handling.
For better I/O load balance, user can enable flowCatalogLocalCommit.
The FlowConfig will be then persisted to FlowCatalog first before it is
forwarded to active node (if current node is standby) for execution.createFlowConfig in interface FlowConfigsResourceHandlerFlowConfigLoggedExceptionpublic com.linkedin.restli.server.UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig) throws FlowConfigLoggedException
FlowConfig should check if current node is active (master).
If current node is active, call FlowConfigResourceLocalHandler.updateFlowConfig(FlowId, FlowConfig) directly.
If current node is standby, forward ServiceConfigKeys.HELIX_FLOWSPEC_UPDATE to active. The remote active will
then call FlowConfigResourceLocalHandler.updateFlowConfig(FlowId, FlowConfig).
Please refer to ControllerUserDefinedMessageHandlerFactory for remote handling.
For better I/O load balance, user can enable flowCatalogLocalCommit.
The FlowConfig will be then persisted to FlowCatalog first before it is
forwarded to active node (if current node is standby) for execution.updateFlowConfig in interface FlowConfigsResourceHandlerFlowConfigLoggedExceptionpublic com.linkedin.restli.server.UpdateResponse partialUpdateFlowConfig(FlowId flowId, com.linkedin.restli.common.PatchRequest<FlowConfig> flowConfigPatch)
partialUpdateFlowConfig in interface FlowConfigsResourceHandlerpublic com.linkedin.restli.server.UpdateResponse deleteFlowConfig(FlowId flowId, Properties header) throws FlowConfigLoggedException
FlowConfig should check if current node is active (master).
If current node is active, call FlowConfigResourceLocalHandler.deleteFlowConfig(FlowId, Properties) directly.
If current node is standby, forward ServiceConfigKeys.HELIX_FLOWSPEC_REMOVE to active. The remote active will
then call FlowConfigResourceLocalHandler.deleteFlowConfig(FlowId, Properties).
Please refer to ControllerUserDefinedMessageHandlerFactory for remote handling.
For better I/O load balance, user can enable flowCatalogLocalCommit.
The FlowConfig will be then persisted to FlowCatalog first before it is
forwarded to active node (if current node is standby) for execution.deleteFlowConfig in interface FlowConfigsResourceHandlerFlowConfigLoggedException