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
CheckpointIDCounterCheckpointIDCounter service.start in interface CheckpointIDCounterExceptionpublic void shutdown()
throws Exception
CheckpointIDCounterCheckpointIDCounter service down and frees all created
resources.shutdown in interface CheckpointIDCounterExceptionpublic void suspend()
throws Exception
CheckpointIDCounterIf the implementation allows recovery, the counter state needs to be kept. Otherwise, this acts as shutdown.
suspend in interface CheckpointIDCounterExceptionpublic long getAndIncrement()
throws Exception
CheckpointIDCountergetAndIncrement in interface CheckpointIDCounterExceptionpublic void setCount(long newCount)
CheckpointIDCountersetCount in interface CheckpointIDCounternewCount - The new IDCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.