think-about-data-structure

为什么有数据结构的问题就是数据本来是无序和杂乱的
怎么在保存的时候方便后续更加方便查询和分析
如果是像记事本和word这种的确是可以使用单考虑到大量的数据就要考虑效率和成本

最后就发现了很多方法

k8s-deploy-geoserver-activemq

目前公司需要搭建geoserver集群集成jms和jdbcstore的插件,实现数据保存在数据库,同时通过jms来同步集群的缓存数据

部署activeMQ

基本信息

image-20211013110849180.png

####

geoserver-high-version-some-scale-lose-layer

启动geoserver报错文件找不到

现象

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
java.io.FileNotFoundException: src/main/webapp
at org.eclipse.jetty.webapp.WebInfConfiguration.unpack(WebInfConfiguration.java:671)
at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:152)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:506)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:544)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:416)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:383)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.geoserver.web.Start.main(Start.java:125)
九月 15, 2021 11:21:37 上午 org.geoserver.web.Start main
严重: GeoServer startup complete in 0.186s

解决方法

org.geoserver.web.Start#main

启动的时候复制jar包里面的文件出来,给jvm调用

成功方式

利用jarFile来实现 文件读取

参考链接 https://www.codenong.com/1463192/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
String destDirPath = getCurrentDirPath();
// 读取jar文件
URL resource = this.getClass().getResource("/PSTools");
JarURLConnection conn = (JarURLConnection) resource.openConnection();
JarFile jarFile = conn.getJarFile();
final Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
final JarEntry entry = entries.nextElement();
if (entry.getName().contains(".exe")) {
System.out.println("File :" + entry.getName());
JarEntry fileEntry = jarFile.getJarEntry(entry.getName());
InputStream input = jarFile.getInputStream(fileEntry);
FileUtils.copyInputStreamToFile(input,new File(destDirPath,entry.getName()));
}
}

常见的postgresql的函数

http://www.postgres.cn/docs/10/functions-json.html 命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

// 通过 数据函数来操作 字符串属性
SELECT jsonb_set('{"rtime":"2021-6-15 08:59:44","objid":"001","addition":{"x":114.5379008,"y":30.4835323,"z":0}}','{addition,z}','12')




UPDATE snspdw_position SET content= (jsonb_set(content::jsonb,'{directorytypecode}','"947998009457774691"'::jsonb))

//updata 字符串数据
UPDATE biz_object set confjson = (jsonb_set(confjson::jsonb,'{directorytypecode}','"947998009457774691"'::jsonb)),directorytypecode = '947998009457774691'
where modelcode = '829609839767532682' and objectcode = '948118654552248419';



// 根据 官网提供的实例测试
SELECT jsonb_set('{"a":[null,{"b":[1,2]}]}', '{a,1,b,1000}', jsonb '3', true)

select version()



SELECT jsonb_set('{"rtime":"2021-6-15 08:59:44","objid":"001","addition":{"x":114.5379008,"y":30.4835323,"z":0}}', '$.payFundAcc.addition.z', '3')


{"tel": 13249872314, "name": "Mike", "address": "Guangzhou"} json_set(data,"{address}","Guangzhou")
SELECT jsonb_set('{"tel": 13249872314, "name": "Mike", "address": "Guangzhou"}','{address}','"hahah"')

SELECT jsonb_set('{"rtime":"2021-6-15 08:59:44","objid":"001","addition":{"x":114.5379008,"y":30.4835323,"z":0}}','{addition,z}','12')


SELECT '{"tel": 13249872314, "name": "Mike", "address": "Guangzhou"}'::jsonb