Package org.apache.heron.spi.statemgr
Class SchedulerStateManagerAdaptor
- java.lang.Object
-
- org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor
-
public class SchedulerStateManagerAdaptor extends Object
This file provides a Adaptor for Scheduler. It provides only the methods needed for Scheduler, and provides easier interfaces to invoke in Scheduler.
-
-
Constructor Summary
Constructors Constructor Description SchedulerStateManagerAdaptor(IStateManager delegate, int timeout)
Construct SchedulerStateManagerAdaptor providing only the interfaces used by scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V> V
awaitResult(com.google.common.util.concurrent.ListenableFuture<V> future)
Waits for ListenableFuture to terminate.protected <V> V
awaitResult(com.google.common.util.concurrent.ListenableFuture<V> future, int time, TimeUnit unit)
Waits for ListenableFuture to terminate.Boolean
deleteExecutionState(String topologyName)
Delete the execution state for the given topologyBoolean
deleteLocks(String topologyName)
Boolean
deleteMetricsCacheLocation(String topologyName)
Delete the metricscache location for the given topologyBoolean
deletePackingPlan(String topologyName)
Delete the packing plan for the given topologyBoolean
deletePhysicalPlan(String topologyName)
Delete the physical plan for the given topologyBoolean
deleteSchedulerLocation(String topologyName)
Delete the scheduler location for the given topologyBoolean
deleteStatefulCheckpoint(String topologyName)
Boolean
deleteTManagerLocation(String topologyName)
Delete the tmanager location for the given topologyBoolean
deleteTopology(String topologyName)
Delete the topology definition for the given topologyorg.apache.heron.proto.system.ExecutionEnvironment.ExecutionState
getExecutionState(String topologyName)
Get the execution state for the given topologyLock
getLock(String topologyName, IStateManager.LockName lockName)
org.apache.heron.proto.tmanager.TopologyManager.MetricsCacheLocation
getMetricsCacheLocation(String topologyName)
Get the metricscache location for the given topologyorg.apache.heron.proto.system.PackingPlans.PackingPlan
getPackingPlan(String topologyName)
Get the packing plan for the given topologyorg.apache.heron.proto.system.PhysicalPlans.PhysicalPlan
getPhysicalPlan(String topologyName)
Get the physical plan for the given topologyorg.apache.heron.proto.scheduler.Scheduler.SchedulerLocation
getSchedulerLocation(String topologyName)
Get the scheduler location for the given topologyorg.apache.heron.proto.tmanager.TopologyManager.TManagerLocation
getTManagerLocation(String topologyName)
Get the tmanager location for the given topologyorg.apache.heron.api.generated.TopologyAPI.Topology
getTopology(String topologyName)
Get the topology definition for the given topologyBoolean
isTopologyRunning(String topologyName)
Is the given topology in RUNNING state?Boolean
setExecutionState(org.apache.heron.proto.system.ExecutionEnvironment.ExecutionState executionState, String topologyName)
Set the execution state for the given topologyBoolean
setPackingPlan(org.apache.heron.proto.system.PackingPlans.PackingPlan packingPlan, String topologyName)
Set the packing plan for the given topologyBoolean
setSchedulerLocation(org.apache.heron.proto.scheduler.Scheduler.SchedulerLocation location, String topologyName)
Set the scheduler location for the given topologyBoolean
setTopology(org.apache.heron.api.generated.TopologyAPI.Topology topology, String topologyName)
Set the topology definition for the given topologyBoolean
updatePackingPlan(org.apache.heron.proto.system.PackingPlans.PackingPlan packingPlan, String topologyName)
Update the packing plan for the given topology.Boolean
updateTopology(org.apache.heron.api.generated.TopologyAPI.Topology topology, String topologyName)
Update the topology definition for the given topology.
-
-
-
Constructor Detail
-
SchedulerStateManagerAdaptor
public SchedulerStateManagerAdaptor(IStateManager delegate, int timeout)
Construct SchedulerStateManagerAdaptor providing only the interfaces used by scheduler.- Parameters:
delegate
- an instance of IStateManager that is already initialized. Noticed that the initialize and close of IStateManager is not in the SchedulerStateManager. Users are restricted from using those interfaces since it is upto the abstract scheduler to decide when to open and close.timeout
- the maximum time to wait in milliseconds
-
-
Method Detail
-
awaitResult
protected <V> V awaitResult(com.google.common.util.concurrent.ListenableFuture<V> future)
Waits for ListenableFuture to terminate. Cancels on timeout
-
awaitResult
protected <V> V awaitResult(com.google.common.util.concurrent.ListenableFuture<V> future, int time, TimeUnit unit)
Waits for ListenableFuture to terminate. Cancels on timeout
-
getLock
public Lock getLock(String topologyName, IStateManager.LockName lockName)
-
isTopologyRunning
public Boolean isTopologyRunning(String topologyName)
Is the given topology in RUNNING state?- Returns:
- Boolean
-
setExecutionState
public Boolean setExecutionState(org.apache.heron.proto.system.ExecutionEnvironment.ExecutionState executionState, String topologyName)
Set the execution state for the given topology- Returns:
- Boolean - Success or Failure
-
setTopology
public Boolean setTopology(org.apache.heron.api.generated.TopologyAPI.Topology topology, String topologyName)
Set the topology definition for the given topology- Parameters:
topologyName
- the name of the topology- Returns:
- Boolean - Success or Failure
-
updateTopology
public Boolean updateTopology(org.apache.heron.api.generated.TopologyAPI.Topology topology, String topologyName)
Update the topology definition for the given topology. If the topology doesn't exist, create it. If it does, update it.- Parameters:
topologyName
- the name of the topology- Returns:
- Boolean - Success or Failure
-
setSchedulerLocation
public Boolean setSchedulerLocation(org.apache.heron.proto.scheduler.Scheduler.SchedulerLocation location, String topologyName)
Set the scheduler location for the given topology- Returns:
- Boolean - Success or Failure
-
setPackingPlan
public Boolean setPackingPlan(org.apache.heron.proto.system.PackingPlans.PackingPlan packingPlan, String topologyName)
Set the packing plan for the given topology- Parameters:
packingPlan
- the packing plan of the topology- Returns:
- Boolean - Success or Failure
-
updatePackingPlan
public Boolean updatePackingPlan(org.apache.heron.proto.system.PackingPlans.PackingPlan packingPlan, String topologyName)
Update the packing plan for the given topology. If the packing plan doesn't exist, create it. If it does, update it.- Parameters:
packingPlan
- the packing plan of the topology- Returns:
- Boolean - Success or Failure
-
deleteTManagerLocation
public Boolean deleteTManagerLocation(String topologyName)
Delete the tmanager location for the given topology- Returns:
- Boolean - Success or Failure
-
deleteMetricsCacheLocation
public Boolean deleteMetricsCacheLocation(String topologyName)
Delete the metricscache location for the given topology- Returns:
- Boolean - Success or Failure
-
deleteExecutionState
public Boolean deleteExecutionState(String topologyName)
Delete the execution state for the given topology- Returns:
- Boolean - Success or Failure
-
deleteTopology
public Boolean deleteTopology(String topologyName)
Delete the topology definition for the given topology- Returns:
- Boolean - Success or Failure
-
deletePackingPlan
public Boolean deletePackingPlan(String topologyName)
Delete the packing plan for the given topology- Returns:
- Boolean - Success or Failure
-
deletePhysicalPlan
public Boolean deletePhysicalPlan(String topologyName)
Delete the physical plan for the given topology- Returns:
- Boolean - Success or Failure
-
deleteSchedulerLocation
public Boolean deleteSchedulerLocation(String topologyName)
Delete the scheduler location for the given topology- Returns:
- Boolean - Success or Failure
-
getTManagerLocation
public org.apache.heron.proto.tmanager.TopologyManager.TManagerLocation getTManagerLocation(String topologyName)
Get the tmanager location for the given topology- Returns:
- TManagerLocation
-
getSchedulerLocation
public org.apache.heron.proto.scheduler.Scheduler.SchedulerLocation getSchedulerLocation(String topologyName)
Get the scheduler location for the given topology- Returns:
- SchedulerLocation
-
getMetricsCacheLocation
public org.apache.heron.proto.tmanager.TopologyManager.MetricsCacheLocation getMetricsCacheLocation(String topologyName)
Get the metricscache location for the given topology- Returns:
- MetricsCacheLocation
-
getTopology
public org.apache.heron.api.generated.TopologyAPI.Topology getTopology(String topologyName)
Get the topology definition for the given topology- Returns:
- Topology
-
getExecutionState
public org.apache.heron.proto.system.ExecutionEnvironment.ExecutionState getExecutionState(String topologyName)
Get the execution state for the given topology- Returns:
- ExecutionState
-
getPhysicalPlan
public org.apache.heron.proto.system.PhysicalPlans.PhysicalPlan getPhysicalPlan(String topologyName)
Get the physical plan for the given topology- Returns:
- PhysicalPlans.PhysicalPlan
-
getPackingPlan
public org.apache.heron.proto.system.PackingPlans.PackingPlan getPackingPlan(String topologyName)
Get the packing plan for the given topology- Returns:
- PackingPlans.PackingPlan
-
-