// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package v1

// Paused predicates whether cluster is paused
func (tc *TidbCluster) Paused() bool {
	return tc.Spec.Paused
}

// ReallyGracefulDeleted predicates whether cluster is graceful deleted
func (tc *TidbCluster) ReallyGracefulDeleted() bool {
	return tc.Status.GracefulDeletedStatus.ReallyGracefulDeleted
}

// ReallyRestoring predicates whether cluster is really restoring
func (tc *TidbCluster) ReallyRestoring() bool {
	return tc.Status.RestoreStatus.ReallyRestoring
}

// ReallyNormal predicates whether cluster is normal state
func (tc *TidbCluster) ReallyNormal() bool {
	return tc.Status.NormalStatus.ReallyNormal
}

// PDIsUpgrading predicates whether pd cluster is upgrading
func (tc *TidbCluster) PDIsUpgrading() bool {
	return tc.Status.PDClusterStatus.Upgrading
}

// TiKVIsUpgrading predicates whether tikv cluster is upgrading
func (tc *TidbCluster) TiKVIsUpgrading() bool {
	return tc.Status.TiKVClusterStatus.Upgrading
}

// TiDBIsUpgrading predicates whether tidb cluster is upgrading
func (tc *TidbCluster) TiDBIsUpgrading() bool {
	return tc.Status.TiDBClusterStatus.Upgrading
}
