Lua table.sort 快排函数的参数可能是同一个对象
对于a,b是table对象的情况下,需要特别判断一下,返回false.
table.sort(allTab, function(a, b)
if a == b then
return false -- first sort may a == b, must return false
end
end)
对于a,b是table对象的情况下,需要特别判断一下,返回false.
table.sort(allTab, function(a, b)
if a == b then
return false -- first sort may a == b, must return false
end
end)
环境搭建
$ yum -y install gcc
$ yum -y install g++
$ yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel cups-devel fontconfig-devel alsa-lib-devel
编译
$ bash ./configure --with-extra-cxxflags="-Wno-error" \
--with-extra-cflags="-Wno-error" \
--enable-unlimited-crypto \
--with-native-debug-symbols=none \
--with-debug-level=release \
--with-target-bits=64 \
--with-boot-jdk=/home/jdks/dragonwell-11.0.17.13+8-GA
$ make images
$ ./build/linux-aarch64-normal-server-release/images/jdk/bin/java -version
生动好文mark: Linux网络内核参数优化秘籍
$ bin/jlink --module-path jmods --add-modules java.desktop --output jre
错误信息: client_loop: send disconnect: Broken pipe
以macOS的ssh客户端为例
$ cd /etc/ssh
$ sudo vim ssh_config
在ssh_config文件的最下方的Host *中新增
ServerAliveInterval 30
IPQoS=throughput
使用下面的命令进行查询
$ /usr/libexec/java_home -V
Lua源码未自带windows编译脚本, 自行编译过程如下
启动Visual Studio 控制台环境,以2019为例,cmd中运行下面的脚本
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
运行下面的bat脚本进行编译
cl /MD /O2 /c /DLUA_BUILD_AS_DLL *.c
ren lua.obj lua.o
ren luac.obj luac.o
link /DLL /IMPLIB:lua.lib /OUT:lua.dll *.obj
link /OUT:lua.exe lua.o lua.lib
lib /OUT:lua-static.lib *.obj
link /OUT:luac.exe luac.o lua-static.lib
Spark 官方提供的二进制下载版本缺少对Hive的支持,需要自己下载源码进行编译,加入hive的支持。
解压并修改maven repo为国内地址源(有2处)。
$ tar zxvf spark-3.2.1.tgz
$ cd spark-3.2.1
$ vim pom.xml
<!--url>https://maven-central.storage-download.googleapis.com/maven2/</url-->
<url>https://maven.aliyun.com/repository/public</url>
编译
$ export MAVEN_OPTS="-Xss64m -Xmx2g -XX:ReservedCodeCacheSize=1g"
$ ./dev/make-distribution.sh --name hadoop-3.3.2-hive-3.1.3 --tgz -Pyarn -Dhadoop.version=3.3.2 -Phive -Phive-thriftserver -DskipTests
其中-Phive -Phive-thriftserver
参数就是启用hive支持,MAVEN_OPTS参数必须的,否则编译过程中会提示java内存不足.
$ sudo apt install mysql-server
查看默认账号密码
$ sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket = /var/run/mysqld/mysqld.sock
$ mysql -udebian-sys-maint -pJRvfA0JiQGk5qhnz
mysql>USE mysql;
// mysql 5.7
mysql>UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql>update mysql.user set authentication_string=password('xxx') where User='root' and Host='localhost';
// mysql 8.0
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';
mysql>flush privileges;
mysql>exit;