MongoDbMigrationProgress Class

public final class MongoDbMigrationProgress
extends MongoDbProgress

Describes the progress of the overall migration.

Constructor Summary

Constructor Description
MongoDbMigrationProgress()

Creates an instance of MongoDbMigrationProgress class.

Method Summary

Modifier and Type Method and Description
Map<String,MongoDbDatabaseProgress> databases()

Get the databases property: The progress of the databases in the migration.

static MongoDbMigrationProgress fromJson(JsonReader jsonReader)

Reads an instance of MongoDbMigrationProgress from the JsonReader.

MongoDbProgressResultType resultType()

Get the resultType property: The type of progress object.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MongoDbMigrationProgress withBytesCopied(long bytesCopied)

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

MongoDbMigrationProgress withDatabases(Map<String,MongoDbDatabaseProgress> databases)

Set the databases property: The progress of the databases in the migration.

MongoDbMigrationProgress withDocumentsCopied(long documentsCopied)

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

MongoDbMigrationProgress withElapsedTime(String elapsedTime)

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

MongoDbMigrationProgress withErrors(Map<String,MongoDbError> errors)

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

MongoDbMigrationProgress withEventsPending(long eventsPending)

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

MongoDbMigrationProgress withEventsReplayed(long eventsReplayed)

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

MongoDbMigrationProgress 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.

MongoDbMigrationProgress 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.

MongoDbMigrationProgress withName(String name)

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

MongoDbMigrationProgress withQualifiedName(String qualifiedName)

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

MongoDbMigrationProgress withState(MongoDbMigrationState state)

Set the state property: The state property.

MongoDbMigrationProgress 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.

MongoDbMigrationProgress 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 MongoDbProgress

Methods inherited from java.lang.Object

Constructor Details

MongoDbMigrationProgress

public MongoDbMigrationProgress()

Creates an instance of MongoDbMigrationProgress class.

Method Details

databases

public Map<String,MongoDbDatabaseProgress> databases()

Get the databases property: The progress of the databases in the migration. The keys are the names of the databases.

Returns:

the databases value.

fromJson

public static MongoDbMigrationProgress fromJson(JsonReader jsonReader)

Reads an instance of MongoDbMigrationProgress from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MongoDbMigrationProgress 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.

resultType

public MongoDbProgressResultType resultType()

Get the resultType property: The type of progress object.

Overrides:

MongoDbMigrationProgress.resultType()

Returns:

the resultType value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

MongoDbMigrationProgress.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

MongoDbMigrationProgress.validate()

withBytesCopied

public MongoDbMigrationProgress withBytesCopied(long bytesCopied)

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

Overrides:

MongoDbMigrationProgress.withBytesCopied(long bytesCopied)

Parameters:

bytesCopied

withDatabases

public MongoDbMigrationProgress withDatabases(Map<String,MongoDbDatabaseProgress> databases)

Set the databases property: The progress of the databases in the migration. The keys are the names of the databases.

Parameters:

databases - the databases value to set.

Returns:

the MongoDbMigrationProgress object itself.

withDocumentsCopied

public MongoDbMigrationProgress withDocumentsCopied(long documentsCopied)

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

Overrides:

MongoDbMigrationProgress.withDocumentsCopied(long documentsCopied)

Parameters:

documentsCopied

withElapsedTime

public MongoDbMigrationProgress withElapsedTime(String elapsedTime)

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

Overrides:

MongoDbMigrationProgress.withElapsedTime(String elapsedTime)

Parameters:

elapsedTime

withErrors

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withErrors(Map<String,MongoDbError> errors)

Parameters:

errors

withEventsPending

public MongoDbMigrationProgress withEventsPending(long eventsPending)

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

Overrides:

MongoDbMigrationProgress.withEventsPending(long eventsPending)

Parameters:

eventsPending

withEventsReplayed

public MongoDbMigrationProgress withEventsReplayed(long eventsReplayed)

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

Overrides:

MongoDbMigrationProgress.withEventsReplayed(long eventsReplayed)

Parameters:

eventsReplayed

withLastEventTime

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withLastEventTime(OffsetDateTime lastEventTime)

Parameters:

lastEventTime

withLastReplayTime

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withLastReplayTime(OffsetDateTime lastReplayTime)

Parameters:

lastReplayTime

withName

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withName(String name)

Parameters:

name

withQualifiedName

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withQualifiedName(String qualifiedName)

Parameters:

qualifiedName

withState

public MongoDbMigrationProgress withState(MongoDbMigrationState state)

Set the state property: The state property.

Overrides:

MongoDbMigrationProgress.withState(MongoDbMigrationState state)

Parameters:

state

withTotalBytes

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withTotalBytes(long totalBytes)

Parameters:

totalBytes

withTotalDocuments

public MongoDbMigrationProgress 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.

Overrides:

MongoDbMigrationProgress.withTotalDocuments(long totalDocuments)

Parameters:

totalDocuments

Applies to