Class StatusUtil
- java.lang.Object
-
- org.apache.accumulo.server.replication.StatusUtil
-
public class StatusUtil extends Object
Helper methods to create Status protobuf messages
-
-
Constructor Summary
Constructors Constructor Description StatusUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Replication.Status
fileClosed()
static Value
fileClosedValue()
static Replication.Status
fileCreated(long timeCreated)
static Value
fileCreatedValue(long timeCreated)
static Replication.Status
fromValue(Value v)
static Replication.Status
ingestedUntil(long recordsIngested)
Creates aReplication.Status
for newly-created data that must be replicatedstatic Replication.Status
ingestedUntil(Replication.Status.Builder builder, long recordsIngested)
static boolean
isFullyReplicated(Replication.Status status)
Is the given Status fully replicated but potentially not yet safe for deletionstatic boolean
isSafeForRemoval(Replication.Status status)
Is the given Status fully replicated and is its file ready for deletion on the sourcestatic boolean
isWorkRequired(Replication.Status status)
Given theReplication.Status
, is there replication work to be donestatic Replication.Status
openWithUnknownLength()
static Replication.Status
openWithUnknownLength(long timeCreated)
static Value
openWithUnknownLengthValue()
static Replication.Status
replicated(long recordsReplicated)
static Replication.Status
replicated(Replication.Status.Builder builder, long recordsReplicated)
static Replication.Status
replicatedAndIngested(long recordsReplicated, long recordsIngested)
Creates a @{link Status} for a file which has new data and data which has been replicatedstatic Replication.Status
replicatedAndIngested(Replication.Status.Builder builder, long recordsReplicated, long recordsIngested)
Same asreplicatedAndIngested(long, long)
but uses the providedReplication.Status.Builder
-
-
-
Method Detail
-
ingestedUntil
public static Replication.Status ingestedUntil(long recordsIngested)
Creates aReplication.Status
for newly-created data that must be replicated- Parameters:
recordsIngested
- Offset of records which need to be replicated- Returns:
- A
Replication.Status
tracking data that must be replicated
-
ingestedUntil
public static Replication.Status ingestedUntil(Replication.Status.Builder builder, long recordsIngested)
-
replicated
public static Replication.Status replicated(long recordsReplicated)
- Parameters:
recordsReplicated
- Offset of records which have been replicated- Returns:
- A
Replication.Status
tracking data that must be replicated
-
replicated
public static Replication.Status replicated(Replication.Status.Builder builder, long recordsReplicated)
- Parameters:
builder
- ExistingReplication.Status.Builder
to userecordsReplicated
- Offset of records which have been replicated- Returns:
- A
Replication.Status
tracking data that must be replicated
-
replicatedAndIngested
public static Replication.Status replicatedAndIngested(long recordsReplicated, long recordsIngested)
Creates a @{link Status} for a file which has new data and data which has been replicated- Parameters:
recordsReplicated
- Offset of records which have been replicatedrecordsIngested
- Offset for records which need to be replicated- Returns:
- A
Replication.Status
for the given parameters
-
replicatedAndIngested
public static Replication.Status replicatedAndIngested(Replication.Status.Builder builder, long recordsReplicated, long recordsIngested)
Same asreplicatedAndIngested(long, long)
but uses the providedReplication.Status.Builder
- Parameters:
builder
- An existing builderrecordsReplicated
- Offset of records which have been replicatedrecordsIngested
- Offset of records which need to be replicated- Returns:
- A
Replication.Status
for the given parameters using the builder
-
fileCreated
public static Replication.Status fileCreated(long timeCreated)
- Returns:
- A
Replication.Status
for a new file that was just created
-
fileCreatedValue
public static Value fileCreatedValue(long timeCreated)
- Returns:
- A
Value
for a new file that was just created
-
fileClosed
public static Replication.Status fileClosed()
- Returns:
- A Status representing a closed file
-
fileClosedValue
public static Value fileClosedValue()
- Returns:
- A Value representing a closed file
-
openWithUnknownLength
public static Replication.Status openWithUnknownLength(long timeCreated)
- Returns:
- A
Replication.Status
for an open file of unspecified length, all of which needs replicating.
-
openWithUnknownLength
public static Replication.Status openWithUnknownLength()
- Returns:
- A
Replication.Status
for an open file of unspecified length, all of which needs replicating.
-
openWithUnknownLengthValue
public static Value openWithUnknownLengthValue()
- Returns:
- A
Value
for an open file of unspecified length, all of which needs replicating.
-
fromValue
public static Replication.Status fromValue(Value v) throws com.google.protobuf.InvalidProtocolBufferException
- Parameters:
v
- Value with serialized Status- Returns:
- A Status created from the Value
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
isSafeForRemoval
public static boolean isSafeForRemoval(Replication.Status status)
Is the given Status fully replicated and is its file ready for deletion on the source- Parameters:
status
- a Status protobuf- Returns:
- True if the file this Status references can be deleted.
-
isFullyReplicated
public static boolean isFullyReplicated(Replication.Status status)
Is the given Status fully replicated but potentially not yet safe for deletion- Parameters:
status
- a Status protobuf- Returns:
- True if the file this Status references is fully replicated so far
-
isWorkRequired
public static boolean isWorkRequired(Replication.Status status)
Given theReplication.Status
, is there replication work to be done- Parameters:
status
- Status for a file- Returns:
- true if replication work is required
-
-