com.cloudera.api.model
Class ApiSnapshotPolicy

java.lang.Object
  extended by com.cloudera.api.model.ApiSnapshotPolicy

public class ApiSnapshotPolicy
extends Object

A snapshot policy.

Snapshot policies have service specific arguments. This object has methods to retrieve arguments for all supported types of snapshots, but only one argument type is allowed to be set; the backend will check that the provided argument matches the type of the service with which the snapshot policy is associated.


Constructor Summary
ApiSnapshotPolicy()
           
ApiSnapshotPolicy(String name, String description, long hourlySnapshots, long dailySnapshots, long weeklySnapshots, long monthlySnapshots, long yearlySnapshots)
           
 
Method Summary
 boolean equals(Object o)
           
 boolean getAlertOnAbort()
          Whether to alert on abort of snapshot creation/deletion activity.
 boolean getAlertOnFail()
          Whether to alert on failure of snapshot creation/deletion activity.
 boolean getAlertOnStart()
          Whether to alert on start of snapshot creation/deletion activity.
 boolean getAlertOnSuccess()
          Whether to alert on successful completion of snapshot creation/deletion activity.
 long getDailySnapshots()
          Number of daily snapshots to be retained.
 byte getDayOfMonth()
          Day of the month that monthly and yearly snapshots should be created.
 byte getDayOfWeek()
          Day of the week that weekly snapshots should be created.
 String getDescription()
          Description of the snapshot policy.
 ApiHBaseSnapshotPolicyArguments getHBaseArguments()
          Arguments specific to HBase snapshot policies.
 ApiHdfsSnapshotPolicyArguments getHdfsArguments()
          Arguments specific to Hdfs snapshot policies.
 long getHourlySnapshots()
          Number of hourly snapshots to be retained.
 byte getHourOfDay()
          Hour in the day that daily, weekly, monthly and yearly snapshots should be created.
 List<Byte> getHoursForHourlySnapshots()
          Hours of the day that hourly snapshots should be created.
 ApiSnapshotCommand getLastCommand()
          Latest command of this policy.
 ApiSnapshotCommand getLastSuccessfulCommand()
          Last successful command of this policy.
 byte getMinuteOfHour()
          Minute in the hour that hourly, daily, weekly, monthly and yearly snapshots should be created.
 long getMonthlySnapshots()
          Number of monthly snapshots to be retained.
 byte getMonthOfYear()
          Month of the year that yearly snapshots should be created.
 String getName()
          Name of the snapshot policy.
 Boolean getPaused()
          Whether to pause a snapshot policy, available since V11.
 long getWeeklySnapshots()
          Number of weekly snapshots to be retained.
 long getYearlySnapshots()
          Number of yearly snapshots to be retained.
 int hashCode()
           
 void setAlertOnAbort(boolean alertOnAbort)
           
 void setAlertOnFail(boolean alertOnFail)
           
 void setAlertOnStart(boolean alertOnStart)
           
 void setAlertOnSuccess(boolean alertOnSuccess)
           
 void setDailySnapshots(long dailySnapshots)
           
 void setDayOfMonth(byte dayOfMonth)
           
 void setDayOfWeek(byte dayOfWeek)
           
 void setDescription(String description)
           
 void setHBaseArguments(ApiHBaseSnapshotPolicyArguments hbaseArguments)
           
 void setHdfsArguments(ApiHdfsSnapshotPolicyArguments hdfsArguments)
           
 void setHourlySnapshots(long hourlySnapshots)
           
 void setHourOfDay(byte hourOfDay)
           
 void setHoursForHourlySnapshots(List<Byte> hours)
           
 void setLastCommand(ApiSnapshotCommand lastCommand)
           
 void setLastSuccessfulCommand(ApiSnapshotCommand lastSuccessfulCommand)
           
 void setMinuteOfHour(byte minuteOfHour)
           
 void setMonthlySnapshots(long monthlySnapshots)
           
 void setMonthOfYear(byte monthOfYear)
           
 void setName(String name)
           
 void setPaused(Boolean paused)
           
 void setWeeklySnapshots(long weeklySnapshots)
           
 void setYearlySnapshots(long yearlySnapshots)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApiSnapshotPolicy

public ApiSnapshotPolicy()

ApiSnapshotPolicy

public ApiSnapshotPolicy(String name,
                         String description,
                         long hourlySnapshots,
                         long dailySnapshots,
                         long weeklySnapshots,
                         long monthlySnapshots,
                         long yearlySnapshots)
Method Detail

getName

public String getName()
Name of the snapshot policy.


setName

public void setName(String name)

getDescription

public String getDescription()
Description of the snapshot policy.


setDescription

public void setDescription(String description)

getHourlySnapshots

public long getHourlySnapshots()
Number of hourly snapshots to be retained.


setHourlySnapshots

public void setHourlySnapshots(long hourlySnapshots)

getDailySnapshots

public long getDailySnapshots()
Number of daily snapshots to be retained.


setDailySnapshots

public void setDailySnapshots(long dailySnapshots)

getWeeklySnapshots

public long getWeeklySnapshots()
Number of weekly snapshots to be retained.


setWeeklySnapshots

public void setWeeklySnapshots(long weeklySnapshots)

getMonthlySnapshots

public long getMonthlySnapshots()
Number of monthly snapshots to be retained.


setMonthlySnapshots

public void setMonthlySnapshots(long monthlySnapshots)

getYearlySnapshots

public long getYearlySnapshots()
Number of yearly snapshots to be retained.


setYearlySnapshots

public void setYearlySnapshots(long yearlySnapshots)

getMinuteOfHour

public byte getMinuteOfHour()
Minute in the hour that hourly, daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 59. Default value is 0.


setMinuteOfHour

public void setMinuteOfHour(byte minuteOfHour)

getHoursForHourlySnapshots

public List<Byte> getHoursForHourlySnapshots()
Hours of the day that hourly snapshots should be created. Valid values are 0 to 23. If this list is null or empty, then hourly snapshots are created for every hour.


setHoursForHourlySnapshots

public void setHoursForHourlySnapshots(List<Byte> hours)

getHourOfDay

public byte getHourOfDay()
Hour in the day that daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 23. Default value is 0.


setHourOfDay

public void setHourOfDay(byte hourOfDay)

getDayOfWeek

public byte getDayOfWeek()
Day of the week that weekly snapshots should be created. Valid values are 1 to 7, 1 representing Sunday. Default value is 1.


setDayOfWeek

public void setDayOfWeek(byte dayOfWeek)

getDayOfMonth

public byte getDayOfMonth()
Day of the month that monthly and yearly snapshots should be created. Values from 1 to 31 are allowed. Additionally 0 to -30 can be used to specify offsets from the last day of the month. Default value is 1.

If this value is invalid for any month for which snapshots are required, the backend will throw an exception.


setDayOfMonth

public void setDayOfMonth(byte dayOfMonth)

getMonthOfYear

public byte getMonthOfYear()
Month of the year that yearly snapshots should be created. Valid values are 1 to 12, 1 representing January. Default value is 1.


setMonthOfYear

public void setMonthOfYear(byte monthOfYear)

getAlertOnStart

public boolean getAlertOnStart()
Whether to alert on start of snapshot creation/deletion activity.


setAlertOnStart

public void setAlertOnStart(boolean alertOnStart)

getAlertOnSuccess

public boolean getAlertOnSuccess()
Whether to alert on successful completion of snapshot creation/deletion activity.


setAlertOnSuccess

public void setAlertOnSuccess(boolean alertOnSuccess)

getAlertOnFail

public boolean getAlertOnFail()
Whether to alert on failure of snapshot creation/deletion activity.


setAlertOnFail

public void setAlertOnFail(boolean alertOnFail)

getAlertOnAbort

public boolean getAlertOnAbort()
Whether to alert on abort of snapshot creation/deletion activity.


setAlertOnAbort

public void setAlertOnAbort(boolean alertOnAbort)

getHBaseArguments

public ApiHBaseSnapshotPolicyArguments getHBaseArguments()
Arguments specific to HBase snapshot policies.


setHBaseArguments

public void setHBaseArguments(ApiHBaseSnapshotPolicyArguments hbaseArguments)

getHdfsArguments

public ApiHdfsSnapshotPolicyArguments getHdfsArguments()
Arguments specific to Hdfs snapshot policies.


setHdfsArguments

public void setHdfsArguments(ApiHdfsSnapshotPolicyArguments hdfsArguments)

getLastCommand

public ApiSnapshotCommand getLastCommand()
Latest command of this policy. The command might still be active.


setLastCommand

public void setLastCommand(ApiSnapshotCommand lastCommand)

getLastSuccessfulCommand

public ApiSnapshotCommand getLastSuccessfulCommand()
Last successful command of this policy. Returns null if there has been no successful command.


setLastSuccessfulCommand

public void setLastSuccessfulCommand(ApiSnapshotCommand lastSuccessfulCommand)

getPaused

public Boolean getPaused()
Whether to pause a snapshot policy, available since V11.


setPaused

public void setPaused(Boolean paused)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © Cloudera, Inc. Released under Apache License, Version 2.0.