public final class DefaultConsumablePartition extends Object implements ConsumablePartition
ConsumablePartition
.Constructor and Description |
---|
DefaultConsumablePartition(PartitionKey partitionKey) |
DefaultConsumablePartition(PartitionKey partitionKey,
ProcessState processState,
long timestamp,
int numFailures) |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Marks the ProcessState as COMPLETED
|
void |
discard()
Marks the ProcessState as DISCARDED
|
boolean |
equals(Object o) |
int |
getNumFailures() |
PartitionKey |
getPartitionKey() |
ProcessState |
getProcessState() |
long |
getTimestamp() |
int |
hashCode() |
int |
incrementNumFailures() |
void |
retry()
Marks the ProcessState as AVAILABLE, resets the timestamp to 0, and increments the number of failures by 1
|
void |
setProcessState(ProcessState processState)
Sets a ProcessState to this ConsumablePartition
|
void |
setTimestamp(long timestamp)
Set a timestamp on this partition, when this partition is claimed for processing.
|
void |
take()
Marks the ProcessState as IN_PROGRESS
|
byte[] |
toBytes() |
void |
untake()
Marks the ProcessState as AVAILABLE, after it has been taken.
|
public DefaultConsumablePartition(PartitionKey partitionKey)
public DefaultConsumablePartition(PartitionKey partitionKey, ProcessState processState, long timestamp, int numFailures)
public PartitionKey getPartitionKey()
getPartitionKey
in interface ConsumablePartition
public long getTimestamp()
getTimestamp
in interface ConsumablePartition
public void setTimestamp(long timestamp)
ConsumablePartition
setTimestamp
in interface ConsumablePartition
public int getNumFailures()
getNumFailures
in interface ConsumablePartition
public int incrementNumFailures()
incrementNumFailures
in interface ConsumablePartition
public ProcessState getProcessState()
getProcessState
in interface ConsumablePartition
public void setProcessState(ProcessState processState)
ConsumablePartition
setProcessState
in interface ConsumablePartition
public void take()
ConsumablePartition
take
in interface ConsumablePartition
public void untake()
ConsumablePartition
untake
in interface ConsumablePartition
public void retry()
ConsumablePartition
retry
in interface ConsumablePartition
public void complete()
ConsumablePartition
complete
in interface ConsumablePartition
public void discard()
ConsumablePartition
discard
in interface ConsumablePartition
public byte[] toBytes()
Copyright © 2022 Cask Data, Inc. Licensed under the Apache License, Version 2.0.