public class StandaloneCheckpointIDCounter extends Object implements CheckpointIDCounter
CheckpointIDCounter
instances for JobManagers running in RecoveryMode.STANDALONE
.
Simple wrapper of an AtomicLong
. This is sufficient, because job managers are not
recoverable in this recovery mode.
Constructor and Description |
---|
StandaloneCheckpointIDCounter() |
Modifier and Type | Method and Description |
---|---|
long |
getAndIncrement()
Atomically increments the current checkpoint ID.
|
void |
setCount(long newCount)
Sets the current checkpoint ID.
|
void |
shutdown()
Shuts the
CheckpointIDCounter service down and frees all created
resources. |
void |
start()
Starts the
CheckpointIDCounter service. |
void |
suspend()
Suspends the counter.
|
public void start() throws Exception
CheckpointIDCounter
CheckpointIDCounter
service.start
in interface CheckpointIDCounter
Exception
public void shutdown() throws Exception
CheckpointIDCounter
CheckpointIDCounter
service down and frees all created
resources.shutdown
in interface CheckpointIDCounter
Exception
public void suspend() throws Exception
CheckpointIDCounter
If the implementation allows recovery, the counter state needs to be kept. Otherwise, this acts as shutdown.
suspend
in interface CheckpointIDCounter
Exception
public long getAndIncrement() throws Exception
CheckpointIDCounter
getAndIncrement
in interface CheckpointIDCounter
Exception
public void setCount(long newCount)
CheckpointIDCounter
setCount
in interface CheckpointIDCounter
newCount
- The new IDCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.