byWind's Blog

  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

[hadoop] lease

发表于 2019-01-01 | 分类于 Hadoop
本文字数: 396 | 阅读时长 ≈ 1 分钟

lease

lease 翻译为“租约”,lease管理着一个client所以的锁。每一个client都有一个对应的lease,在client定期check in的时候lease的时间戳会被更新,而当client停止时lease管理的锁会被释放。

1
2
3
4
5
6
7
8
class Lease implements Comparable<Lease> {
// 租约的持有者,就是客户端名称
private final String holder;
//最后一次检入时间
private long lastUpdate;
//持有的文件路径集
private final Collection<String> paths = new TreeSet<String>();
}

TODO: lease的维护?

Principles of Computer System Design

发表于 2018-11-10 | 分类于 基础知识
本文字数: 1.2k | 阅读时长 ≈ 3 分钟

Avoid excessive generality

If it’s good for everything, it’s good for nothing.

Principle of escalating complexity

Adding a requirement increases complexity out of proportion.

问题的复杂度一般不和其规模成正比,往往存在指数关系。

The law of diminishing returns

The more one improves some measure of goodness, the more effort the next improvement will require.

要想提高资源利用率,问题的复杂度通常加倍甚至呈指数增长。

The unyielding foundations rule

It is easier to change a module than to change the modularity.

更改modularity(修改接口)往往涉及更改多个module。

The robustness principle

Be tolerant of inputs and strict on outputs.

阅读全文 »

[linux] shuf

发表于 2018-11-08 | 分类于 基础知识
本文字数: 217 | 阅读时长 ≈ 1 分钟

shuf可以把输入行打乱,按随机顺序输出到标准输出

阅读全文 »

[linux] sed

发表于 2018-11-02 | 分类于 基础知识
本文字数: 1k | 阅读时长 ≈ 3 分钟

sed的原理是依次处理各行,把当前行储存在缓冲区中,称为“模式空间”,然后用sed命令依次处理,处理完成后,将缓冲区的内容输出到屏幕。

语法

1
sed [-option] 'command' filename
阅读全文 »

[linux] git

发表于 2018-10-27 | 更新于 2019-04-01 | 分类于 基础知识
本文字数: 418 | 阅读时长 ≈ 1 分钟

配置ssh连接github: github官网教程

注意 配置成功后连接github应使用git方式,而不是https方式,例如:

1
2
3
4
# http方式
git clone https://github.com/yfzm/yfzm.github.io
# git方式
git clone git@github.com:yfzm/yfzm.github.io

如果之前已经通过https方式clone了仓库,将.git/config中的url修改为git方式即可,不需要重新clone

阅读全文 »

[linux] 辨析专题

发表于 2018-10-26 | 分类于 基础知识
本文字数: 321 | 阅读时长 ≈ 1 分钟

shell: [[ [ (( (

  • [ condition ] 最原始的命令,相当于test codition
  • [[ condition ]] 升级版的test语句,支持正则表达式匹配(使用~=)
  • (( condition )) 进行算术运算
  • ( command ) 在子shell中运行command,返回其结束状态。使用这个命令的主要原因是隔离环境
阅读全文 »

[linux] ssh

发表于 2018-10-25 | 分类于 基础知识
本文字数: 220 | 阅读时长 ≈ 1 分钟
1
2
3
4
5
6
7
8
# 普通登录
ssh [-l login_name] [-p port] [user@]hostname
# 带命令
ssh [user@]hostname "command"
# 执行本地脚本
ssh [user@]hostname < local_script.sh
# 执行带有参数的本地脚本
ssh [user@]hostname "bash -s" < local_script.sh param1 param2
阅读全文 »

二叉树中的最大路径和

发表于 2018-10-25 | 分类于 算法题
本文字数: 1.2k | 阅读时长 ≈ 3 分钟

问题提出

#124 二叉树中的最大路径和

阅读全文 »
1…3456
Li Hao

Li Hao

46 日志
9 分类
20 标签
GitHub E-Mail
Links
  • Norton
  • lazzy
  • Alevery
  • pdfcxc
0%
© 2019 Li Hao | 95k | 3:58
由 Hexo 强力驱动 v3.8.0
|
主题 – NexT.Pisces v7.0.1
|