kenttanl / kenttanl.github.io Goto Github PK
View Code? Open in Web Editor NEW个人博客,http://kentt.top/
Home Page: https://kenttanl.github.io/
License: MIT License
个人博客,http://kentt.top/
Home Page: https://kenttanl.github.io/
License: MIT License
仅记录简单的命令,详细请自行搜索
$ nmap -nsP 10.1.xx.xxx/27
Starting Nmap 6.40 ( http://nmap.org ) at 2020-09-25 20:02 PDT
Nmap scan report for 10.1.xx.xxx
Host is up (0.0022s latency).
Nmap scan report for 10.1.xx.xxx
Host is up (0.0025s latency).
Nmap scan report for 10.1.xx.xxx
# 显示打开的 TCP 端口
$ netstat -ntpl
记录自己在系统设计与开发中那些踩过的坑或者觉得重要的条目
1. 统一语言:一个团队,一种语言
2. 核心模型:精炼系统中最有价值的部分
3. 边界与划分:服务的边界以及横向划分与纵向划分
4. 结构与层次:保证清晰的、有序的结构与层次关系
5. 转换层:正确处理与外部系统的关系
6. 弹性:容错与自动修复能力
7. 保持简单:让开发更简单、让运维更简单、让使用更简单
8. 产品思维:避免因为程序员思维让用户感到困扰
TCP 是一个面向有连接的、可靠的通信服务协议
public final native boolean compareAndSwapObject(Object var1, long var2, Object var4, Object var5);
public final native boolean compareAndSwapInt(Object var1, long var2, int var4, int var5);
public final native boolean compareAndSwapLong(Object var1, long var2, long var4, long var6);
static JNINativeMethod methods_18[] = {
{CC"compareAndSwapObject", CC"("OBJ"J"OBJ""OBJ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
{CC"compareAndSwapInt", CC"("OBJ"J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
{CC"compareAndSwapLong", CC"("OBJ"J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
}
UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapInt(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jint e, jint x))
UnsafeWrapper("Unsafe_CompareAndSwapInt");
oop p = JNIHandles::resolve(obj);
jint* addr = (jint *) index_oop_from_field_offset_long(p, offset);
return (jint)(Atomic::cmpxchg(x, addr, e)) == e;
UNSAFE_END
最终调用了 Atomic::cmpxchg(x, addr, e) 方法
inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) {
int mp = os::is_MP();
__asm__ volatile (LOCK_IF_MP(%4) "cmpxchgl %1,(%3)"
: "=a" (exchange_value)
: "r" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp)
: "cc", "memory");
return exchange_value;
}
说明:
os::is_MP()
用于判断计算机系统是否为多核系统;__asm__
表示接下来是内联的汇编代码;volatile
表示禁止编译器优化;LOCK_IF_MP
是一个内联函数,用于在多核处理器上的指令中添加 lock 前缀,源码:atomic_linux_x86.inline.hpp L147
// Adding a lock prefix to an instruction on MP machine
#define LOCK_IF_MP(mp) "cmp $0, " #mp "; je 1f; lock; 1: "
通过 Wireshark 抓包以及 Debug 源码,对 Consumer poll 及 rebalance 相关操作得出以下结论:
RIT
No | SQL Server | MySQL | Range | Storage(Bytes) | Comment |
---|---|---|---|---|---|
1 | INT | INT | MS SQL : -2^31 |
4 | |
2 | TINYINT | TINYINT | MS SQL : 0 |
1 | UNSIGNED flag set in MySQL. |
3 | SMALLINT | SMALLINT | MS SQL : -2^15 |
2 | |
4 | BIGINT | BIGINT | MS SQL : -2^63 |
8 | |
5 | BIT | TINYINT(1) | 0, 1, NULL | MS SQL : 1~2MySQL : 1 | Microsoft SQL Server Type Mapping |
6 | FLOAT(n) | FLOAT(p) | MS SQL-FLOAT(n)的n值single-precision:1-24double-precision:0-23MySQL-FLOAT(p)的p值single-precision:25-53double-precision:24-53 | single-precision:4double-precision:8 | Precision value is used for storage size in both. |
7 | REAL | FLOAT | float(24) | 4 | |
8 | NUMERIC(p,s) | DECIMAL(M,D) | MS SQL-NUMERIC(p,s):(有效位數,小數位數)p:1-38MySQL-DECIMAL(M,D):(有效位數,小數位數)M:1-65 | MS SQLPrecisionNumber of Bytes1-9510-19920-281329-3817MySQLLeftover DigitsNumber of Bytes0 01–213–4 25–637–9 4 | 1-9 |
9 | DECIMAL(p,s) | DECIMAL(M,D) | MS SQL-DECIMAL同No.8的NUMERICMySQL-DECIMAL同No.8的DECIMAL | ||
10 | MONEY | DECIMAL | MS SQL-MONEY-922,337,203,685,477.5808 到 922,337,203,685,477.5807MySQL-同No.8的DECIMAL | 8 | |
11 | SMALLMONEY | DECIMAL | MS SQL-SMALLMONEY- 214,748.3648 到 214,748.3647MySQL-同No.8的DECIMAL | 4 | |
12 | CHAR(n) | CHAR(n)/LONGTEXT | MS SQL-CHAR(n)n:1-8000MySQL-CHAR(n)n:0-255 | CHAR: n個位元組MySQL-LONGTEXTL + 4 bytes, L < 2^32 | MySQLDepending on its length. MySQL Server 5.6 and higher can have CHAR columns with a length up to 255 characters. Anything larger is migrated as LONGTEXT.LONGTEXT: L represents the actual length in bytes of a given string value. |
13 | NCHAR(n) | CHAR(n) CHARACTER SET utf8mb4/LONGTEXT | MS SQL-NCHAR(n)n:1-4000MySQL-CHAR(n)n:0-255 | MS SQL-NCHARn*2 個位元組MySQL-CHARn個位元組 | MySQLDepending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, a character set of strings depends on the column character set instead of the data type.NCHAR/NVARCHAR implies the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release.Please consider using CHAR(x) CHARACTER SET UTF8MB4 in order to be unambiguoushttps://bugs.mysql.com/bug.php?id=76529 |
14 | VARCHAR(n) | VARCHAR(n)/MEDIUMTEXT/LONGTEXT | MS SQL-VARCHAR(n)n:1-8000MySQL-VARCHAR(n)n:0-65535 | MS SQL-VARCHAR實際儲存的位元組+ 2 位元組MySQL-VARCHARn<255,實際儲存的位元組+ 1 位元組n>=255,實際儲存的位元組+ 2 位元組MySQL-MEDIUMTEXTL + 3 bytes, L < 2^24MySQL-LONGTEXTL + 4 bytes, L < 2^32 | MySQLDepending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types.MEDIUMTEXT/LONGTEXT: L represents the actual length in bytes of a given string value. |
15 | NVARCHAR(n) | VARCHAR(N) CHARACTER SET utf8mb4MEDIUMTEXT/LONGTEXT | MS SQL-NVARCHAR(n)n:1-4000MySQL-VARCHAR(n)n:0-65535 | MS SQL-NVARCHAR實際儲存的位元組*2+ 2 位元組MySQL-VARCHARn<255,實際儲存的位元組+ 1 位元組n>=255,實際儲存的位元組+ 2 位元組MySQL-同No.14的MEDIUMTEXT/LONGTEXT | Depending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, a character set of strings depends on the column character set instead of the data type. |
16 | DATE | DATE | MS SQL0001-01-01 to 9999-12-31MySQL1000-01-01 to 9999-12-31 | 3 | |
17 | DATETIME(p) | DATETIME(p) | MS SQL1753-1-1 to 9999-12-31 00:00:00.000 到 23:59:59.997MySQL1000-01-01 00:00:00.000000 to 9999-12-31 23:59:59.999999 | MS SQL8MySQLMySQL 5.6.4以前:8 bytesMySQL 5.6.4以後:5 bytes + fractional seconds storageFractional Seconds PrecisionStorage Required00 bytes1, 21 byte3, 42 bytes5, 63 bytes | 0 |
18 | DATETIME2(p) | DATETIME(p) | MS SQL-DATETIME20001-01-01 00:00:00.0000000 to 9999-12-31 23:59:59.9999999MySQL-同No.17的DATETIME | MS SQLp<3: 6 bytesp=3 or p=4: 7 bytesother: 8 bytes. | |
19 | SMALLDATETIME | DATETIME | MS SQL-SMALLDATETIME1900-01-01 00:00:00 to 2079-06-06 23:59:59MySQL-同No.17的DATETIME | MS SQL4 | |
20 | DATETIMEOFFSET | DATETIME | MS SQL-DATETIMEOFFSET0001-01-01 00:00:00.00.0000000 to 9999-12-31 23:59:59.9999999MySQL-同No.17的DATETIME | MS SQL10 bytes, fixed is the default with the default of 100ns fractional second precision. | |
21 | TIME(p) | TIME(p) | MS SQL-TIME00:00:00.0000000 to 23:59:59.9999999MySQL-TIME-838:59:59.000000 to 838:59:59.000000 | MS SQL5 bytes, fixed, is the default with the default of 100ns fractional second precision.MySQLMySQL 5.6.4以前:3 bytesMySQL 5.6.4以後:3 bytes + fractional seconds storageFractional Seconds PrecisionStorage Required00 bytes1, 21 byte3, 42 bytes5, 63 bytes | 0 |
22 | TIMESTAMP | TIMESTAMP | |||
23 | ROWVERSION | TIMESTAMP | |||
24 | BINARY | BINARY/MEDIUMBLOB/LONGBLOB | Depending on its length. | ||
25 | VARBINARY | VARBINARY/MEDIUMBLOB/LONGBLOB | Depending on its length. | ||
26 | TEXT | VARCHAR/MEDIUMTEXT/LONGTEXT | Depending on its length. | ||
27 | NTEXT | VARCHAR/MEDIUMTEXT/LONGTEXT | Depending on its length. | ||
28 | IMAGE | TINYBLOB/MEDIUMBLOB/LONGBLOB | Depending on its length. | ||
29 | SQL_VARIANT | not migrated | There is not specific support for this data type. | ||
30 | TABLE | not migrated | There is not specific support for this data type. | ||
31 | HIERARCHYID | not migrated | There is not specific support for this data type. | ||
32 | UNIQUEIDENTIFIER | VARCHAR(64) | A unique flag set in MySQL. There is not specific support for inserting unique identifier values. | ||
33 | SYSNAME | VARCHAR(160) | |||
34 | XML | TEXT |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.