다음을 통해 공유


Persistence Class

  • java.lang.Object
    • com.azure.resourcemanager.redisenterprise.models.Persistence

Implements

public final class Persistence
implements JsonSerializable<Persistence>

Persistence settings Persistence-related configuration for the Redis Enterprise database.

Constructor Summary

Constructor Description
Persistence()

Creates an instance of Persistence class.

Method Summary

Modifier and Type Method and Description
Boolean aofEnabled()

Get the aofEnabled property: Sets whether AOF is enabled.

AofFrequency aofFrequency()

Get the aofFrequency property: Sets the frequency at which data is written to disk.

static Persistence fromJson(JsonReader jsonReader)

Reads an instance of Persistence from the JsonReader.

Boolean rdbEnabled()

Get the rdbEnabled property: Sets whether RDB is enabled.

RdbFrequency rdbFrequency()

Get the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Persistence withAofEnabled(Boolean aofEnabled)

Set the aofEnabled property: Sets whether AOF is enabled.

Persistence withAofFrequency(AofFrequency aofFrequency)

Set the aofFrequency property: Sets the frequency at which data is written to disk.

Persistence withRdbEnabled(Boolean rdbEnabled)

Set the rdbEnabled property: Sets whether RDB is enabled.

Persistence withRdbFrequency(RdbFrequency rdbFrequency)

Set the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.

Methods inherited from java.lang.Object

Constructor Details

Persistence

public Persistence()

Creates an instance of Persistence class.

Method Details

aofEnabled

public Boolean aofEnabled()

Get the aofEnabled property: Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled.

Returns:

the aofEnabled value.

aofFrequency

public AofFrequency aofFrequency()

Get the aofFrequency property: Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting is deprecated, because of its performance impact.

Returns:

the aofFrequency value.

fromJson

public static Persistence fromJson(JsonReader jsonReader)

Reads an instance of Persistence from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If an error occurs while reading the Persistence.

rdbEnabled

public Boolean rdbEnabled()

Get the rdbEnabled property: Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled.

Returns:

the rdbEnabled value.

rdbFrequency

public RdbFrequency rdbFrequency()

Get the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.

Returns:

the rdbFrequency value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAofEnabled

public Persistence withAofEnabled(Boolean aofEnabled)

Set the aofEnabled property: Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled.

Parameters:

aofEnabled - the aofEnabled value to set.

Returns:

the Persistence object itself.

withAofFrequency

public Persistence withAofFrequency(AofFrequency aofFrequency)

Set the aofFrequency property: Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting is deprecated, because of its performance impact.

Parameters:

aofFrequency - the aofFrequency value to set.

Returns:

the Persistence object itself.

withRdbEnabled

public Persistence withRdbEnabled(Boolean rdbEnabled)

Set the rdbEnabled property: Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled.

Parameters:

rdbEnabled - the rdbEnabled value to set.

Returns:

the Persistence object itself.

withRdbFrequency

public Persistence withRdbFrequency(RdbFrequency rdbFrequency)

Set the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.

Parameters:

rdbFrequency - the rdbFrequency value to set.

Returns:

the Persistence object itself.

Applies to