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 |
start()
Starts the
CheckpointIDCounter service. |
void |
stop()
Stops the
CheckpointIDCounter service. |
public void start() throws Exception
CheckpointIDCounter
CheckpointIDCounter
service.start
in interface CheckpointIDCounter
Exception
public void stop() throws Exception
CheckpointIDCounter
CheckpointIDCounter
service.stop
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.