DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

原文链接

Partitioning is an optimization technique used to divide a table into certain parts based on some attributes.

This includes schema evolution, partition evolution, and table version rollback — all possible without the need for costly table rewrites or table migration.

hidden partitioning

Only data that is written to the table after evolution is partitioned with the new spec, and the metadata for this new set of data is kept separately.

Data partitioned on multiple columns creates multiple layers of folders, with each top-level folder containing one folder for each of the second-level partition values.

spec说明

项目 资源 投入时间段 投入百分比(及周末加班情况)
中银项目 桂权力 12.5 - 12.17 25% (12.6 周日加班半天,12.11-12.12 周末加班1天,12.15 场内出差)

repo链接

主旨是找到那些花费少,延迟小的相关的一些配置

image-20201123112004494

原理上,比较简单,设定相应的内存大小,去跑相应的程序,计算

repo链接

It watches mounted volume dirs and notifies the target process that the config map has been changed. It currently only supports sending an HTTP request, but in future it is expected to support sending OS (e.g. SIGHUP) once Kubernetes supports pod PID namespaces.

主要是利用fsnotify的方式

比较好的基于重试的写法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
begun := time.Now()
req, err := http.NewRequest(*webhookMethod, h.String(), nil)
if err != nil {
setFailureMetrics(h.String(), "client_request_create")
log.Println("error:", err)
continue
}
userInfo := h.User
if userInfo != nil {
if password, passwordSet := userInfo.Password(); passwordSet {
req.SetBasicAuth(userInfo.Username(), password)
}
}

successfulReloadWebhook := false

for retries := *webhookRetries; retries != 0; retries-- {
log.Printf("performing webhook request (%d/%d)", retries, *webhookRetries)
resp, err := http.DefaultClient.Do(req)
if err != nil {
setFailureMetrics(h.String(), "client_request_do")
log.Println("error:", err)
time.Sleep(time.Second * 10)
continue
}
resp.Body.Close()
requestsByStatusCode.WithLabelValues(h.String(), strconv.Itoa(resp.StatusCode)).Inc()
if resp.StatusCode != *webhookStatusCode {
setFailureMetrics(h.String(), "client_response")
log.Println("error:", "Received response code", resp.StatusCode, ", expected", *webhookStatusCode)
time.Sleep(time.Second * 10)
continue
}

setSuccessMetrics(h.String(), begun)
log.Println("successfully triggered reload")
successfulReloadWebhook = true
break
}

if !successfulReloadWebhook {
setFailureMetrics(h.String(), "retries_exhausted")
log.Println("error:", "Webhook reload retries exhausted")
}

原文链接

image-20201122154053798

字符串部分,有free, len, buf(实际内容)

image-20201122154928034

reactor单线程模型,基于事件驱动