-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features register #19
base: develop
Are you sure you want to change the base?
Conversation
} | ||
|
||
for typ := range type2InstancePoolList { | ||
_, ok := pim.instancePoolStorages[typ] | ||
for type2 := range type2PoolList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type2 => type?
如果type是保留字,可以用typeName。
type2不知道是什么意思
} | ||
} | ||
|
||
rst := map[string]*InstancePool{} | ||
for typ, pisList := range type2InstancePoolList { | ||
storager := pim.instancePoolStorages[typ] | ||
for type2, pisList := range type2PoolList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同line 74
// CanDelete check whether pool can be deleted, Check Logic: | ||
// 1. Not BFE Cluster Refer To | ||
// 2. Not SubCluster Refer To | ||
func (m *PoolManager) CanDelete(ctx context.Context, pool *Pool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数的返回值有些问题。
从函数名字看,应该“逻辑判断型”的返回值。
建议返回值改为 (bool, error),第一个返回值返回true/false,第二个返回错误的信息
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题并没有答复或解决
return | ||
} | ||
|
||
func (m *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数存在的意义是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题没有答复呀
return | ||
} | ||
|
||
func poolNameJudger(productName string, poolName string) (realName string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poolNameJudger => poolNameGet
- *er一般是一个对象。这个函数显然只是一个操作
- 如果语义是judge/check,就没有“修改”的含义。改为Get后会好很多
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题也没有任何的解释和答复
|
||
type PoolManager struct { | ||
storage PoolStorage | ||
bfeClusterStorager ibasic.BFEClusterStorager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storager => Storage
所有代码的都替换一下吧。
既然line 27已经是storage,那就统一风格
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本次设计里面没有编写BFEClusterStorager,是以前的代码
|
||
func (m *PoolManager) CreateProductPool(ctx context.Context, product *ibasic.Product, param *PoolParam, pool *InstancePool) (one *Pool, err error) { | ||
var pN string | ||
pN, err = poolNameJudger(product.Name, *param.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pN => poolName。
pN这样的缩写完全看不懂,是非常差的起名方式。
缩写还是要让人能看懂
var _ icluster_conf.InstancePoolStorage = &RDBInstancePoolStorage{} | ||
|
||
func (rpps *RDBInstancePoolStorage) UpdateInstances(ctx context.Context, pool *icluster_conf.Pool, | ||
pis *icluster_conf.InstancePool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pis这个缩写并不合适,改为iPool?
return err | ||
} | ||
|
||
func (rpps *RDBInstancePoolStorage) BatchFetchInstances(ctx context.Context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpps不知道是什么的缩写
@@ -201,7 +192,7 @@ func (rpps *RDBPoolStorager) UpdatePool(ctx context.Context, oldData *icluster_c | |||
return err | |||
} | |||
|
|||
func (rpps *RDBPoolStorager) DeletePool(ctx context.Context, pool *icluster_conf.Pool) error { | |||
func (rpps *RDBPoolStorage) DeletePool(ctx context.Context, pool *icluster_conf.Pool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpps => s, 或 rps
|
||
return rst, nil | ||
} | ||
|
||
func (rpps *RDBPoolStorager) UpdatePool(ctx context.Context, oldData *icluster_conf.Pool, | ||
func (rpps *RDBPoolStorage) UpdatePool(ctx context.Context, oldData *icluster_conf.Pool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpps => s, 或 rps
}, nil | ||
} | ||
|
||
func (rpps *RDBPoolStorager) CreatePool(ctx context.Context, product *ibasic.Product, | ||
func (rpps *RDBPoolStorage) CreatePool(ctx context.Context, product *ibasic.Product, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpps => s, 或 rps
|
||
rst := map[string]*InstancePool{} | ||
for type2, pisList := range type2PoolList { | ||
storager := m.instancePoolStorages[type2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storager => storage
return rst, nil | ||
} | ||
|
||
func (m *InstancePoolManager) UpdateInstances(ctx context.Context, pool *Pool, pis *InstancePool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pis => iPool
return | ||
} | ||
|
||
func (m *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题没有答复呀
return | ||
} | ||
|
||
func poolNameJudger(productName string, poolName string) (realName string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题也没有任何的解释和答复
// CanDelete check whether pool can be deleted, Check Logic: | ||
// 1. Not BFE Cluster Refer To | ||
// 2. Not SubCluster Refer To | ||
func (m *PoolManager) CanDelete(ctx context.Context, pool *Pool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题并没有答复或解决
What's the progress |
No description provided.