Skip to content

Commit 0a1950b

Browse files
committed
update comment
1 parent 38d05af commit 0a1950b

File tree

20 files changed

+57
-47
lines changed

20 files changed

+57
-47
lines changed

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/CharsetMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* <pre>
12-
* mysql> SHOW CHARACTER SET;
12+
* mysql&gt; SHOW CHARACTER SET;
1313
* +----------+-----------------------------+---------------------+--------+
1414
* | Charset | Description | Default collation | Maxlen |
1515
* +----------+-----------------------------+---------------------+--------+

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/TableReader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public void open() {
7979

8080
/**
8181
* Get number of pages. If page size is 16KiB, then the value will be <code>file size / 16384</code>.
82-
* @return
82+
*
83+
* @return number of pages
8384
*/
8485
public long getNumOfPages() {
8586
checkNotNull(storageService, "storageService should not null, please make sure TableReader is opened");

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/column/ColumnFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ public Class<?> typeClass() {
217217

218218
/**
219219
* https://dev.mysql.com/doc/refman/5.7/en/innodb-row-format.html
220-
* <p/>
220+
* <p>
221221
* a CHAR(255) column can exceed 768 bytes if the maximum byte length of the character set is greater than 3, as it is with utf8mb4.
222-
* <p/>
222+
* <p>
223223
* 在单字节字符集下,如果存储的是非 NULL 值时,会占满指定的空间。比如 CHAR(10),存储除 NULL 之外的其它值时,一定会占 10 bytes 空间,不足用 \x20 填充。
224224
* 在多字节字符集下(测试用的是 utf8mb4),如果存储的是非 NULL 值时
225225
* 至少占用与指定值相等的字节空间,比如 CHAR(10),至少会占用 10 bytes 空间,如果存储的内容超过了 10 bytes (对于 ubf8mb4 编码来说,CHAR(10) 最多能存储 40 bytes 内容),那么只占用实际占用的字节数。
@@ -314,7 +314,7 @@ public Class<?> typeClass() {
314314
* As of MySQL 5.6.4 the TIME, TIMESTAMP, and DATETIME types can have a fractional seconds part.
315315
* Storage for these types is big endian (for memcmp() compatibility purposes), with the nonfractional
316316
* part followed by the fractional part. (Storage and encoding for the YEAR and DATE types remains unchanged.)
317-
* <p/>
317+
* <p>
318318
* https://dev.mysql.com/doc/internals/en/date-and-time-data-type-representation.html
319319
* <pre>
320320
* 1 bit sign (1= non-negative, 0= negative)

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/PageType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/**
1313
* PageType
14-
* <p/>
14+
* <p>
1515
* Please refer to i_ss.cc or fil0fil.h
1616
*
1717
* @author xu.zx

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/fsphdr/FspHeader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ public class FspHeader {
2121

2222
/**
2323
* Highest page number in file (size)
24-
* <p/>
24+
* <p>
2525
* 当前表空间总的PAGE个数,扩展文件时需要更新该值fsp_try_extend_data_file_with_pages
2626
*/
2727
private long size;
2828

2929
/**
3030
* Highest page number initialized (free limit)
31-
* <p/>
31+
* <p>
3232
* 当前尚未初始化的最小Page No。从该Page往后的都尚未加入到表空间的FREE LIST上。
3333
*/
3434
private long freeLimit;

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/index/FsegHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* the index root page’s FSEG header contains pointers to the file segments
1313
* used by this index.
1414
* All other index pages’ FSEG headers are unused and zero-filled.
15-
* <p/>
15+
* <p>
1616
* 20 bytes header
1717
*
1818
* @author xu.zx

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/index/Index.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,22 @@ public boolean isRootPage() {
8585
* Get used bytes in a page. For example, given a page like below, the used bytes is
8686
* <code>1000 + 376 + 8 - 240 = 1144</code>
8787
* <pre>
88-
* 0 +----------------------+ <- page offset 0
88+
* 0 +----------------------+ <= page offset 0
8989
* | FilHeader |
9090
* 38 +----------------------+
9191
* 138 | row 1 |
9292
* 400 | row 2 |
93-
* 660 | row 3 (mark deleted) | <- Deleted record will be counted as free space
93+
* 660 | row 3 (mark deleted) | <= Deleted record will be counted as free space
9494
* 800 | row 4 |
95-
* 920 | row 5 | <- Heap top position. The byte offset of the "end" of the currently used space
95+
* 920 | row 5 | <= Heap top position. The byte offset of the "end" of the currently used space
9696
* 1000 +----------------------+
9797
* | |
98-
* | | <- Free space
98+
* | | <= Free space
9999
* 16000 +----------------------+
100100
* | Directory slots |
101101
* 16376 +----------------------+
102102
* | FilTrailer |
103-
* 16384 +----------------------+ <- page offset SIZE_OF_PAGE, usually 16KiB
103+
* 16384 +----------------------+ <= page offset SIZE_OF_PAGE, usually 16KiB
104104
* </pre>
105105
*
106106
* @return used bytes

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/index/IndexHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* IndexHeader
12-
* <p/>
12+
* <p>
1313
* 36 bytes header
1414
*
1515
* @author xu.zx

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/index/OverflowPagePointer.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,26 @@
99

1010
/**
1111
* https://mysqlserverteam.com/externally-stored-fields-in-innodb/
12-
* <p/>
12+
* <p>
1313
* https://www.itread01.com/content/1546184536.html
14-
* <p/>
14+
* <p>
1515
* When a BLOB field is stored externally, a BLOB reference is stored in the clustered index record.
1616
* The BLOB reference will be stored after the BLOB prefix, if any. This BLOB reference is 20 bytes, and it contains
1717
* the following information:
18-
* >>>>當一個BLOB field被儲存在external pages時,會在index pages中儲存該BLOB field的BLOB reference(指示該BLOB的size,external page位置等元資料資訊)。
18+
* 當一個BLOB field被儲存在external pages時,會在index pages中儲存該BLOB field的BLOB reference(指示該BLOB的size,external page位置等元資料資訊)。
1919
* 如果表的row format為COMPACT或者REDUNDANT,那麼BLOB reference儲存在BLOB prefix之後。BLOB reference 佔用20 bytes空間,包含如下資訊:
2020
* <ul>
21-
* <li>The space identifier (4 bytes) >>>>表空間資訊(下圖中的Space ID部分)</li>
22-
* <li>The page number where the first page of the BLOB is stored (4 bytes) >>>>儲存BLOB field的起始 page號(下圖中的Page Number部分)</li>
23-
* <li>The offset of the BLOB header within that page (4 bytes) >>>>起始page中 BLOB header 的位移量(下圖中的Offset)</li>
24-
* <li>The total size of the BLOB data (8 bytes) >>>>該BLOB 的 total size(除了上面三個以外的剩餘部分)</li>
21+
* <li>The space identifier (4 bytes) 表空間資訊(下圖中的Space ID部分)</li>
22+
* <li>The page number where the first page of the BLOB is stored (4 bytes)
23+
* 儲存BLOB field的起始 page號(下圖中的Page Number部分)</li>
24+
* <li>The offset of the BLOB header within that page (4 bytes)
25+
* 起始page中 BLOB header 的位移量(下圖中的Offset)</li>
26+
* <li>The total size of the BLOB data (8 bytes)
27+
* 該BLOB 的 total size(除了上面三個以外的剩餘部分)</li>
2528
* </ul>
2629
* Even though 8 bytes are available to store the total size of the BLOB data, only the last 4 bytes are actually
2730
* used. This means that within InnoDB, the maximum size of a single BLOB field is currently 4GB.
28-
* >>>>儘管上面我們提到有8 bytes的空間可以用來儲存BLOB size資訊,但是實際上僅有 4 bytes空間可以真正用來儲存BLOB size 資訊。
31+
* 儘管上面我們提到有8 bytes的空間可以用來儲存BLOB size資訊,但是實際上僅有 4 bytes空間可以真正用來儲存BLOB size 資訊。
2932
* 這就意味著,innodb中可以儲存的最大 BLOB field size 是4 GB(4 bytes=32 bit ,2^32=4GB)
3033
*
3134
* @author xu.zx

innodb-java-reader/src/main/java/com/alibaba/innodb/java/reader/page/index/RecordHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class RecordHeader {
4545
/**
4646
* Next Record Offset: A relative offset from the current record to the origin of the next record
4747
* within the page in ascending order by key.
48-
* <p/>
48+
* <p>
4949
* 直接定位到下一个record的数据部分,而不是header
5050
*/
5151
private int nextRecOffset;

0 commit comments

Comments
 (0)