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.StatusfileClosed()static ValuefileClosedValue()static Replication.StatusfileCreated(long timeCreated)static ValuefileCreatedValue(long timeCreated)static Replication.StatusfromValue(Value v)static Replication.StatusingestedUntil(long recordsIngested)Creates aReplication.Statusfor newly-created data that must be replicatedstatic Replication.StatusingestedUntil(Replication.Status.Builder builder, long recordsIngested)static booleanisFullyReplicated(Replication.Status status)Is the given Status fully replicated but potentially not yet safe for deletionstatic booleanisSafeForRemoval(Replication.Status status)Is the given Status fully replicated and is its file ready for deletion on the sourcestatic booleanisWorkRequired(Replication.Status status)Given theReplication.Status, is there replication work to be donestatic Replication.StatusopenWithUnknownLength()static Replication.StatusopenWithUnknownLength(long timeCreated)static ValueopenWithUnknownLengthValue()static Replication.Statusreplicated(long recordsReplicated)static Replication.Statusreplicated(Replication.Status.Builder builder, long recordsReplicated)static Replication.StatusreplicatedAndIngested(long recordsReplicated, long recordsIngested)Creates a @{link Status} for a file which has new data and data which has been replicatedstatic Replication.StatusreplicatedAndIngested(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.Statusfor newly-created data that must be replicated- Parameters:
recordsIngested- Offset of records which need to be replicated- Returns:
- A
Replication.Statustracking 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.Statustracking data that must be replicated
-
replicated
public static Replication.Status replicated(Replication.Status.Builder builder, long recordsReplicated)
- Parameters:
builder- ExistingReplication.Status.Builderto userecordsReplicated- Offset of records which have been replicated- Returns:
- A
Replication.Statustracking 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.Statusfor 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.Statusfor the given parameters using the builder
-
fileCreated
public static Replication.Status fileCreated(long timeCreated)
- Returns:
- A
Replication.Statusfor a new file that was just created
-
fileCreatedValue
public static Value fileCreatedValue(long timeCreated)
- Returns:
- A
Valuefor 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.Statusfor an open file of unspecified length, all of which needs replicating.
-
openWithUnknownLength
public static Replication.Status openWithUnknownLength()
- Returns:
- A
Replication.Statusfor an open file of unspecified length, all of which needs replicating.
-
openWithUnknownLengthValue
public static Value openWithUnknownLengthValue()
- Returns:
- A
Valuefor 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
-
-