Tag:conclusion

  • [series] several points for go to use defer function

    Time:2020-3-2

    Summary You must have used the defer function. It will not be executed immediately when it is declared, but after the function return. Its main application scenarios include exception handling, logging, data cleaning, resource releasing, etc. This article is not to share the application scenario of defer, but to share the points that need attention […]

  • The “pit” you don’t know in MySQL master-slave synchronization architecture (I)

    Time:2020-3-1

    The following actions are for specifying an unsynchronized Library Binlog format = row mode View the binlog mode of the master and slave mysql> show slave status\G *********************** 1. row ************************* Slave_IO_State: Waiting for master to send event Master_Host: 192.168.22.171 Master_User: rep Master_Port: 3306 Connect_Retry: 60 Master_Log_File: master-bin.000004 Read_Master_Log_Pos: 463 Relay_Log_File: s1.000011 Relay_Log_Pos: 630 Relay_Master_Log_File: […]

  • Efficiency comparison of three ways of mass inserting data in mybatis

    Time:2020-2-12

    The database is mysql. 1. For loop insert long start = System.currentTimeMillis(); for(int i = 0 ;i < 100000; i++) { User user = new User(); user.setId(“id” + i); user.setName(“name” + i); user.setPassword(“password” + i); userMapper.insert(user); } long end = System.currentTimeMillis(); System.out.println(“—————” + (start – end) + “—————“); <insert id=”insert”> INSERT INTO t_user (id, name, […]

  • Kafka compression details (first draft)

    Time:2020-2-11

    Kafka compression Generalization If you need to understand Kafka compression, you need to understand Kafka’s storage format Kafka storage format RecordBatch baseOffset: int64 batchLength: int32 partitionLeaderEpoch: int32 magic: int8 (current magic value is 2) crc: int32 attributes: int16 bit 0~2: 0: no compression 1: gzip 2: snappy 3: lz4 4: zstd bit 3: timestampType bit […]

  • Iterator of Python syntax

    Time:2019-11-15

    Iteratable object: the value can be repeated, and each value is based on the previous result. Any object that has a ﹐ ITER ﹐ method inside is an iterative object. Iterator objects : the return value obtained from the sequence type. 65104; ITER ﹐ is the iterator object. Iteration method:Print (iterator object Internal principle of […]