MongoDbProgress Class

  • java.lang.Object
    • com.azure.resourcemanager.datamigration.models.MongoDbProgress

Implements

public class MongoDbProgress
implements JsonSerializable<MongoDbProgress>

Base class for MongoDB migration outputs.

Constructor Summary

Constructor Description
MongoDbProgress()

Creates an instance of MongoDbProgress class.

Method Summary

Modifier and Type Method and Description
long bytesCopied()

Get the bytesCopied property: The number of document bytes copied during the Copying stage.

long documentsCopied()

Get the documentsCopied property: The number of documents copied during the Copying stage.

String elapsedTime()

Get the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e.

Map<String,MongoDbError> errors()

Get the errors property: The errors and warnings that have occurred for the current object.

long eventsPending()

Get the eventsPending property: The number of oplog events awaiting replay.

long eventsReplayed()

Get the eventsReplayed property: The number of oplog events replayed so far.

static MongoDbProgress fromJson(JsonReader jsonReader)

Reads an instance of MongoDbProgress from the JsonReader.

OffsetDateTime lastEventTime()

Get the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has been received yet.

OffsetDateTime lastReplayTime()

Get the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet.

String name()

Get the name property: The name of the progress object.

String qualifiedName()

Get the qualifiedName property: The qualified name of the progress object.

MongoDbProgressResultType resultType()

Get the resultType property: The type of progress object.

MongoDbMigrationState state()

Get the state property: The state property.

JsonWriter toJson(JsonWriter jsonWriter)
long totalBytes()

Get the totalBytes property: The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown.

long totalDocuments()

Get the totalDocuments property: The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown.

void validate()

Validates the instance.

MongoDbProgress withBytesCopied(long bytesCopied)

Set the bytesCopied property: The number of document bytes copied during the Copying stage.

MongoDbProgress withDocumentsCopied(long documentsCopied)

Set the documentsCopied property: The number of documents copied during the Copying stage.

MongoDbProgress withElapsedTime(String elapsedTime)

Set the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e.

MongoDbProgress withErrors(Map<String,MongoDbError> errors)

Set the errors property: The errors and warnings that have occurred for the current object.

MongoDbProgress withEventsPending(long eventsPending)

Set the eventsPending property: The number of oplog events awaiting replay.

MongoDbProgress withEventsReplayed(long eventsReplayed)

Set the eventsReplayed property: The number of oplog events replayed so far.

MongoDbProgress withLastEventTime(OffsetDateTime lastEventTime)

Set the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has been received yet.

MongoDbProgress withLastReplayTime(OffsetDateTime lastReplayTime)

Set the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet.

MongoDbProgress withName(String name)

Set the name property: The name of the progress object.

MongoDbProgress withQualifiedName(String qualifiedName)

Set the qualifiedName property: The qualified name of the progress object.

MongoDbProgress withState(MongoDbMigrationState state)

Set the state property: The state property.

MongoDbProgress withTotalBytes(long totalBytes)

Set the totalBytes property: The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown.

MongoDbProgress withTotalDocuments(long totalDocuments)

Set the totalDocuments property: The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown.

Methods inherited from java.lang.Object

Constructor Details

MongoDbProgress

public MongoDbProgress()

Creates an instance of MongoDbProgress class.

Method Details

bytesCopied

public long bytesCopied()

Get the bytesCopied property: The number of document bytes copied during the Copying stage.

Returns:

the bytesCopied value.

documentsCopied

public long documentsCopied()

Get the documentsCopied property: The number of documents copied during the Copying stage.

Returns:

the documentsCopied value.

elapsedTime

public String elapsedTime()

Get the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format).

Returns:

the elapsedTime value.

errors

public Map<String,MongoDbError> errors()

Get the errors property: The errors and warnings that have occurred for the current object. The keys are the error codes.

Returns:

the errors value.

eventsPending

public long eventsPending()

Get the eventsPending property: The number of oplog events awaiting replay.

Returns:

the eventsPending value.

eventsReplayed

public long eventsReplayed()

Get the eventsReplayed property: The number of oplog events replayed so far.

Returns:

the eventsReplayed value.

fromJson

public static MongoDbProgress fromJson(JsonReader jsonReader)

Reads an instance of MongoDbProgress from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MongoDbProgress if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

lastEventTime

public OffsetDateTime lastEventTime()

Get the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has been received yet.

Returns:

the lastEventTime value.

lastReplayTime

public OffsetDateTime lastReplayTime()

Get the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet.

Returns:

the lastReplayTime value.

name

public String name()

Get the name property: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null.

Returns:

the name value.

qualifiedName

public String qualifiedName()

Get the qualifiedName property: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null.

Returns:

the qualifiedName value.

resultType

public MongoDbProgressResultType resultType()

Get the resultType property: The type of progress object.

Returns:

the resultType value.

state

public MongoDbMigrationState state()

Get the state property: The state property.

Returns:

the state value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

totalBytes

public long totalBytes()

Get the totalBytes property: The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown.

Returns:

the totalBytes value.

totalDocuments

public long totalDocuments()

Get the totalDocuments property: The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown.

Returns:

the totalDocuments value.

validate

public void validate()

Validates the instance.

withBytesCopied

public MongoDbProgress withBytesCopied(long bytesCopied)

Set the bytesCopied property: The number of document bytes copied during the Copying stage.

Parameters:

bytesCopied - the bytesCopied value to set.

Returns:

the MongoDbProgress object itself.

withDocumentsCopied

public MongoDbProgress withDocumentsCopied(long documentsCopied)

Set the documentsCopied property: The number of documents copied during the Copying stage.

Parameters:

documentsCopied - the documentsCopied value to set.

Returns:

the MongoDbProgress object itself.

withElapsedTime

public MongoDbProgress withElapsedTime(String elapsedTime)

Set the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format).

Parameters:

elapsedTime - the elapsedTime value to set.

Returns:

the MongoDbProgress object itself.

withErrors

public MongoDbProgress withErrors(Map<String,MongoDbError> errors)

Set the errors property: The errors and warnings that have occurred for the current object. The keys are the error codes.

Parameters:

errors - the errors value to set.

Returns:

the MongoDbProgress object itself.

withEventsPending

public MongoDbProgress withEventsPending(long eventsPending)

Set the eventsPending property: The number of oplog events awaiting replay.

Parameters:

eventsPending - the eventsPending value to set.

Returns:

the MongoDbProgress object itself.

withEventsReplayed

public MongoDbProgress withEventsReplayed(long eventsReplayed)

Set the eventsReplayed property: The number of oplog events replayed so far.

Parameters:

eventsReplayed - the eventsReplayed value to set.

Returns:

the MongoDbProgress object itself.

withLastEventTime

public MongoDbProgress withLastEventTime(OffsetDateTime lastEventTime)

Set the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has been received yet.

Parameters:

lastEventTime - the lastEventTime value to set.

Returns:

the MongoDbProgress object itself.

withLastReplayTime

public MongoDbProgress withLastReplayTime(OffsetDateTime lastReplayTime)

Set the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet.

Parameters:

lastReplayTime - the lastReplayTime value to set.

Returns:

the MongoDbProgress object itself.

withName

public MongoDbProgress withName(String name)

Set the name property: The name of the progress object. For a collection, this is the unqualified collection name. For a database, this is the database name. For the overall migration, this is null.

Parameters:

name - the name value to set.

Returns:

the MongoDbProgress object itself.

withQualifiedName

public MongoDbProgress withQualifiedName(String qualifiedName)

Set the qualifiedName property: The qualified name of the progress object. For a collection, this is the database-qualified name. For a database, this is the database name. For the overall migration, this is null.

Parameters:

qualifiedName - the qualifiedName value to set.

Returns:

the MongoDbProgress object itself.

withState

public MongoDbProgress withState(MongoDbMigrationState state)

Set the state property: The state property.

Parameters:

state - the state value to set.

Returns:

the MongoDbProgress object itself.

withTotalBytes

public MongoDbProgress withTotalBytes(long totalBytes)

Set the totalBytes property: The total number of document bytes on the source at the beginning of the Copying stage, or -1 if the total size was unknown.

Parameters:

totalBytes - the totalBytes value to set.

Returns:

the MongoDbProgress object itself.

withTotalDocuments

public MongoDbProgress withTotalDocuments(long totalDocuments)

Set the totalDocuments property: The total number of documents on the source at the beginning of the Copying stage, or -1 if the total count was unknown.

Parameters:

totalDocuments - the totalDocuments value to set.

Returns:

the MongoDbProgress object itself.

Applies to