Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tarsnodes.dat存储疑惑 #195

Open
walkertest opened this issue May 26, 2022 · 0 comments
Open

tarsnodes.dat存储疑惑 #195

walkertest opened this issue May 26, 2022 · 0 comments

Comments

@walkertest
Copy link
Contributor

walkertest commented May 26, 2022

当有些地方不设置datapath,比如一些sdk(兼容非tars服务)的时候,tarsnodes.dat的存储路径会比较怪.

例子:

            URL url  = Loader.getResource("", true);
            String path=url.getFile();
            File f = new File(path, Constants.SERVER_NODE_CACHE_FILENAME);
            String parentPath = f.getParentFile().getPath();
            String filePath = f.getAbsolutePath();

            log.info("URL_DATA_PATH:{} parentPath:{} filePath:{}",
                    path, parentPath, filePath);

输出结果:

URL_DATA_PATH:file:/data/app/taf/tafnode/data/TAFJAVADEMO.HelloServer/bin/HelloServer.jar!/BOOT-INF/classes!/ parentPath:file:/data/app/taf/tafnode/data/TAFJAVADEMO.
HelloServer/bin/HelloServer.jar!/BOOT-INF/classes! filePath:/data/app/taf/app_log/file:/data/app/taf/tafnode/data/TAFJAVADEMO.HelloServer/bin/HelloServer.jar!/BOOT-INF/cla
sses!/tafnodes.dat

疑问:

  1. 存储的绝对路径上带了一个前缀:/data/app/taf/app_log/file:, 貌似是logPath,这个是怎么造成的?
  2. 怎么避免这样的多个存储路径问题. 并且这个路径会有转义字符. 多个路径会导致缓存文件不好管理以及清理.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant