Android 路由框架ARouter源码解析

2023-11-14

作者:小马快跑

我们知道在使用ARouter时,需要在build.config里配置:

annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'

并且知道annotationProcessor用来声明注解解析器,arouter-compiler用来解析ARouter中的各个注解并自动生成class类,那么我们就来看一下到底生成了哪些类:

其生成的5个索引文件有4大类(Group类有2个文件,按Group区分开了),他们都实现了ARouter中的接口:

至于他们都代表什么,我们后面一一分析。

ARouter初始化

在自定义Application中进行初始化:

// 尽可能早,推荐在Application中初始化
ARouter.init(Application.this);

点进去看一下:

//ARouter.java
public static void init(Application application) {
    if (!hasInit) {
        logger = _ARouter.logger;
        _ARouter.logger.info(Consts.TAG, "ARouter init start.");
        hasInit = _ARouter.init(application);

        if (hasInit) {
            _ARouter.afterInit();
        }

        _ARouter.logger.info(Consts.TAG, "ARouter init over.");
    }
}

哦,ARouter又调用了_ARouter.init(application)去初始化,再点进去:

//_ARouter.java

private volatile static ThreadPoolExecutor executor = DefaultPoolExecutor.getInstance();

protected static synchronized boolean init(Application application) {
    mContext = application;
    LogisticsCenter.init(mContext, executor);
    logger.info(Consts.TAG, "ARouter init success!");
    hasInit = true;
    mHandler = new Handler(Looper.getMainLooper());
    return true;
}

哦,_ARouterinit初始化方法里除了初始化一些变量和一个handler,又调用了LogisticsCenter.init(mContext, executor), 其中executor是一个线程池, 继续跟到LogisticsCenter里去:

/**
 * LogisticsCenter contains all of the map.
 * 1\. Creates instance when it is first used.
 * 2\. Handler Multi-Module relationship map(*)
 * 3\. Complex logic to solve duplicate group definition
 */

//LogisticsCenter.java
public synchronized static void init(Context context, ThreadPoolExecutor tpe) throws HandlerException {

      Set<String> routerMap;

      //1、遍历“com.alibaba.android.arouter.routes”路径下的类并把其加入到set中
      if (ARouter.debuggable() || PackageUtils.isNewVersion(context)) {
          // These class was generated by arouter-compiler.
          routerMap = ClassUtils.getFileNameByPackageName(mContext, ROUTE_ROOT_PAKCAGE);
          if (!routerMap.isEmpty()) {
             context.getSharedPreferences(AROUTER_SP_CACHE_KEY, Context.MODE_PRIVATE).edit().putStringSet(AROUTER_SP_KEY_MAP, routerMap).apply();
          }
         // Save new version name when router map update finishes.
         PackageUtils.updateVersion(context);    
      } else {
          logger.info(TAG, "Load router map from cache.");
          routerMap = new HashSet<>(context.getSharedPreferences(AROUTER_SP_CACHE_KEY, Context.MODE_PRIVATE).getStringSet(AROUTER_SP_KEY_MAP, new HashSet<String>()));
            }

      //2、遍历set,将root、group、provider分类并填充到Warehouse路由表中
      for (String className : routerMap) {
          if (className.startsWith(ROUTE_ROOT_PAKCAGE + DOT + SDK_NAME + SEPARATOR + SUFFIX_ROOT)) {
              // This one of root elements, load root.
              ((IRouteRoot) (Class.forName(className).getConstructor().newInstance())).loadInto(Warehouse.groupsIndex);
          } else if (className.startsWith(ROUTE_ROOT_PAKCAGE + DOT + SDK_NAME + SEPARATOR + SUFFIX_INTERCEPTORS)) {
              // Load interceptorMeta
              ((IInterceptorGroup) (Class.forName(className).getConstructor().newInstance())).loadInto(Warehouse.interceptorsIndex);
          } else if (className.startsWith(ROUTE_ROOT_PAKCAGE + DOT + SDK_NAME + SEPARATOR + SUFFIX_PROVIDERS)) {
              // Load providerIndex
              ((IProviderGroup) (Class.forName(className).getConstructor().newInstance())).loadInto(Warehouse.providersIndex);
          }
      }
  }
}

LogisticsCenter.init方法比较长,上面只保留了核心代码,ARouter优先使用arouter-auto-register插件去解析并填充Warehouse路由表,忽略这种方式。我们来看上面这种加载方式,PackageUtils.isNewVersion(context)中判断SharedPreferences(后面简称sp)里面是否有存储versionNameversionCode,如果没有或者他们有更新的时候,需要重新加载一次com.alibaba.android.arouter.routes这个路径下的类名并填充到Set中,否则直接从sp中取数据并赋值到Set中去。接着就开始遍历这个Set,并通过Class.forName(className)这种反射方式去实例化类并调用类中的loadInto方法将注解对应的索引信息添加到Warehouse路由表中。画个图来总结一下:

ARouter跳转

ARouter跳转时,直接使用ARouter.getInstance().build("xxx/xxx").navigation()即可完成跳转,那我们就来看一下源码,看看里面都做了什么,首先是build方法:

/**
 * Build postcard by path and default group
 */
protected Postcard build(String path) {
    if (TextUtils.isEmpty(path)) {
        throw new HandlerException(Consts.TAG + "Parameter is invalid!");
    } else {
        PathReplaceService pService = navigation(PathReplaceService.class);
        if (null != pService) {
            path = pService.forString(path);
        }
        return build(path, extractGroup(path));
    }
}

/**
 * Build postcard by uri
 */
protected Postcard build(Uri uri) {
    if (null == uri || TextUtils.isEmpty(uri.toString())) {
        throw new HandlerException(Consts.TAG + "Parameter invalid!");
    } else {
        PathReplaceService pService = ARouter.getInstance().navigation(PathReplaceService.class);
        if (null != pService) {
            uri = pService.forUri(uri);
        }
        return new Postcard(uri.getPath(), extractGroup(uri.getPath()), uri, null);
    }
}

/**
 * Build postcard by path and group
 */
protected Postcard build(String path, String group) {
    if (TextUtils.isEmpty(path) || TextUtils.isEmpty(group)) {
        throw new HandlerException(Consts.TAG + "Parameter is invalid!");
    } else {
        PathReplaceService pService = ARouter.getInstance().navigation(PathReplaceService.class);
        if (null != pService) {
            path = pService.forString(path);
        }
        return new Postcard(path, group);
    }
}

三个方法中都有,PathReplaceService pService = ARouter.getInstance().navigation(PathReplaceService.class); 那么这个PathReplaceService是干啥的,点进去看看:

/**
 * Preprocess your path
 */
public interface PathReplaceService extends IProvider {

    /**
     * For normal path.
     *
     * @param path raw path
     */
    String forString(String path);

    /**
     * For uri type.
     *
     * @param uri raw uri
     */
    Uri forUri(Uri uri);
}

看它的介绍就知道了,原来这个类是用来预处理path和uri的,调用方需要实现PathReplaceService就可以做预处理,如果不实现,默认pService==null,那么直接走下面的去初始化Postcard实体类。

接着来看navigation方法,因为build方法返回的是PostCard类,所以调用的是PostCard类的navigation方法,经过一系列跳转,最终来到_ARouter.getInstance().navigation(mContext, postcard, requestCode, callback)

protected Object navigation(final Context context, final Postcard postcard, final int requestCode, final NavigationCallback callback) {
    try {
        LogisticsCenter.completion(postcard);
      } catch (NoRouteFoundException ex) {
        logger.warning(Consts.TAG, ex.getMessage());
     }
        return null;
    }

    if (null != callback) {
        callback.onFound(postcard);
    }

    if (!postcard.isGreenChannel()) {   
       // It must be run in async thread, maybe interceptor cost too mush time made ANR.
        interceptorService.doInterceptions(postcard, new InterceptorCallback() {

            @Override
            public void onContinue(Postcard postcard) {
                _navigation(context, postcard, requestCode, callback);
            }

            @Override
            public void onInterrupt(Throwable exception) {
                if (null != callback) {
                    callback.onInterrupt(postcard);
                }
            }
        });
    } else {
        return _navigation(context, postcard, requestCode, callback);
    }
    return null;
}

去除了部分无关代码,只保留了核心代码,首先调用了LogisticsCenter.completion方法,我们追进去看看:

//LogisticsCenter.java
/**
 * Completion the postcard by route metas
 *
 * @param postcard Incomplete postcard, should complete by this method.
 */
public synchronized static void completion(Postcard postcard) {
    RouteMeta routeMeta = Warehouse.routes.get(postcard.getPath());
    if (null == routeMeta) {    
        // Maybe its does't exist, or didn't load.
        Class<? extends IRouteGroup> groupMeta = Warehouse.groupsIndex.get(postcard.getGroup());  // Load route meta.
        if (null == groupMeta) {
            throw new NoRouteFoundException(TAG + "There is no route match the path [" + postcard.getPath() + "], in group [" + postcard.getGroup() + "]");
        } else {
            // Load route and cache it into memory, then delete from metas.
            try {
                IRouteGroup iGroupInstance = groupMeta.getConstructor().newInstance();
                iGroupInstance.loadInto(Warehouse.routes);
                Warehouse.groupsIndex.remove(postcard.getGroup());

            } catch (Exception e) {
                throw new HandlerException(TAG + "Fatal exception when loading group meta. [" + e.getMessage() + "]");
            }

            completion(postcard);   // Reload
        }
    } else {
        postcard.setDestination(routeMeta.getDestination());
        postcard.setType(routeMeta.getType());
        postcard.setPriority(routeMeta.getPriority());
        postcard.setExtra(routeMeta.getExtra());

        Uri rawUri = postcard.getUri();
        if (null != rawUri) {   // Try to set params into bundle.
            Map<String, String> resultMap = TextUtils.splitQueryParameters(rawUri);
            Map<String, Integer> paramsType = routeMeta.getParamsType();

            if (MapUtils.isNotEmpty(paramsType)) {
                // Set value by its type, just for params which annotation by @Param
                for (Map.Entry<String, Integer> params : paramsType.entrySet()) {
                    setValue(postcard,
                            params.getValue(),
                            params.getKey(),
                            resultMap.get(params.getKey()));
                }

                // Save params name which need auto inject.
                postcard.getExtras().putStringArray(ARouter.AUTO_INJECT, paramsType.keySet().toArray(new String[]{}));
            }

            // Save raw uri
            postcard.withString(ARouter.RAW_URI, rawUri.toString());
        }

        switch (routeMeta.getType()) {
            case PROVIDER:  // if the route is provider, should find its instance
                // Its provider, so it must implement IProvider
                Class<? extends IProvider> providerMeta = (Class<? extends IProvider>) routeMeta.getDestination();
                IProvider instance = Warehouse.providers.get(providerMeta);
                if (null == instance) { // There's no instance of this provider
                    IProvider provider;
                    try {
                        provider = providerMeta.getConstructor().newInstance();
                        provider.init(mContext);
                        Warehouse.providers.put(providerMeta, provider);
                        instance = provider;
                    } catch (Exception e) {
                        throw new HandlerException("Init provider failed! " + e.getMessage());
                    }
                }
                postcard.setProvider(instance);
                postcard.greenChannel();    // Provider should skip all of interceptors
                break;
            case FRAGMENT:
                postcard.greenChannel();    // Fragment needn't interceptors
            default:
                break;
        }
    }
}

这个类很长,但是逻辑还是很清晰的:首先从Warehouse路由表的routes中获取RouteMeta,但是第一次获取的时候为空(因为init时只填充了Warehouse路由表的groupsIndex、interceptorsIndex、providersIndex,还记得吗?),接着从Warehouse.groupsIndex中根据group的名字找到对应的group索引,并将生成的索引类的map数据加载到Warehouse.routes中,然后把Warehouse.groupsIndex中对应的group删除掉,以免重复加载数据,然后调用了completion(postcard)进行重新加载。此时Warehouse.routes已经不为空,根据path获取对应的RouteMeta,就会走到else逻辑中,先是对PostCard设置了一堆属性,最后对IProvider的子类进行了初始化并加载到Warehouse.providers中,同时也设置到PostCard中,并给PROVIDERFRAGMENT设置了绿色通道(不会被拦截)。总结一下:主要逻辑就是通过Warehouse.groupsIndex找到对应的group并进行加载,实现了分组加载路由表。

我们继续回到navigation方法中往下走,首先通过postcard.isGreenChannel()判断是否会拦截,如果拦截,就会走interceptorService的逻辑(interceptorService是在afeterInit中初始化的),否则就走到了_navigation逻辑中,那么来看_navigation方法:

private Object _navigation(final Context context, final Postcard postcard, final int requestCode, final NavigationCallback callback) {
    final Context currentContext = null == context ? mContext : context;

    switch (postcard.getType()) {
        case ACTIVITY:
            // Build intent
            final Intent intent = new Intent(currentContext, postcard.getDestination());
            intent.putExtras(postcard.getExtras());

            // Set flags.
            int flags = postcard.getFlags();
            if (-1 != flags) {
                intent.setFlags(flags);
            } else if (!(currentContext instanceof Activity)) {    // Non activity, need less one flag.
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            }

            // Set Actions
            String action = postcard.getAction();
            if (!TextUtils.isEmpty(action)) {
                intent.setAction(action);
            }

            // Navigation in main looper.
            runInMainThread(new Runnable() {
                @Override
                public void run() {
                    startActivity(requestCode, currentContext, intent, postcard, callback);
                }
            });

            break;
        case PROVIDER:
            return postcard.getProvider();
        case BOARDCAST:
        case CONTENT_PROVIDER:
        case FRAGMENT:
            Class fragmentMeta = postcard.getDestination();
            try {
                Object instance = fragmentMeta.getConstructor().newInstance();
                if (instance instanceof Fragment) {
                    ((Fragment) instance).setArguments(postcard.getExtras());
                } else if (instance instanceof android.support.v4.app.Fragment) {
                    ((android.support.v4.app.Fragment) instance).setArguments(postcard.getExtras());
                }

                return instance;
            } catch (Exception ex) {
                logger.error(Consts.TAG, "Fetch fragment instance error, " + TextUtils.formatStackTrace(ex.getStackTrace()));
            }
        case METHOD:
        case SERVICE:
        default:
            return null;
    }

    return null;
}

private void startActivity(int requestCode, Context currentContext, Intent intent, Postcard postcard, NavigationCallback callback) {
    if (requestCode >= 0) {  
        // Need start for result
        if (currentContext instanceof Activity) {
            ActivityCompat.startActivityForResult((Activity) currentContext, intent, requestCode, postcard.getOptionsBundle());
        }
    } else {
        ActivityCompat.startActivity(currentContext, intent, postcard.getOptionsBundle());
    }

    if ((-1 != postcard.getEnterAnim() && -1 != postcard.getExitAnim()) && currentContext instanceof Activity) {    // Old version.
        ((Activity) currentContext).overridePendingTransition(postcard.getEnterAnim(), postcard.getExitAnim());
    }

    if (null != callback) { // Navigation over.
        callback.onArrival(postcard);
    }
}

哦,原来ARouter跳转Activity最终也是用原生的Intent实现的,如果navigation()不传入context,则使用初始化时Application作为context,如果是FRAGMENT、PROVIDER、CONTENT_PROVIDER、BOARDCAST,通过反射方式初始化并返回即可。

尝试画个图来总结一下navigation:

嗯,到这里ARouter内部的主要流程就分析完了~

ARouter跳转原理:ARouter路由跳转本质上也是通过原生的startActiviy及startActivityForResult来实现的,只不过ARouter通过APT形式将编译期通过解析注解生成的索引加载到Warehouse路由表中,从而制造跳转规则。并且可以在跳转之前设置拦截或过滤。

下面整理了《Android 架构学习手册》学习笔记,根据自己学习中所做的一些笔录来整的,主要也是方便后续好复习翻阅,省掉在去网上查找的时间,以免在度踩坑,如果大家有需要的可以直接 通过点击此处↓↓↓ 进行参考学习:https://qr21.cn/CaZQLo?BIZ=ECOMMERCE

Android 架构学习手册

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android 路由框架ARouter源码解析 的相关文章

  • 为什么是 javascript:history.go(-1);无法在移动设备上工作?

    首先 一些背景 我有一个向用户呈现搜索页面 html 表单 的应用程序 填写标准并单击 搜索 按钮后 结果将显示在标准部分下方 在结果列表中 您可以通过单击将您带到新页面的链接来查看单个结果的详细信息 在详细信息页面中 我添加了一个 返回结
  • tomcat 中受密码保护的应用程序

    我正在使用 JSP Servlet 开发一个Web应用程序 并且我使用了Tomcat 7 0 33 as a web container 所以我的要求是tomcat中的每个应用程序都会password像受保护的manager applica
  • 如何访问JAR文件中的Maven资源? [复制]

    这个问题在这里已经有答案了 我有一个使用 Maven 构建的 Java 应用程序 我有一个资源文件夹com pkg resources 我需要从中访问文件 例如directory txt 我一直在查看各种教程和其他答案 但似乎没有一个对我有
  • 对于一个单元格,RecyclerView onBindViewHolder 调用次数过多

    我正在将 RecyclerView 与 GridLayoutManager 一起使用 对于网格中的每个项目 我需要调用 REST api 来检索数据 然后 从远程异步获取数据后 我使用 UIL 加载 显示图像 一切似乎都很好 但我发现 on
  • 尝试将 Web 服务部署到 TomEE 时出现“找不到...的 appInfo”

    我有一个非常简单的项目 用于培训目的 它是一个 RESTful Web 服务 我使用 js css 和 html 创建了一个客户端 我正在尝试将该服务部署到 TomEE 这是我尝试部署时遇到的错误 我在这里做错了什么 刚刚遇到这个问题 我曾
  • 为什么 Java 8 不允许非公共默认方法?

    让我们举个例子 public interface Testerface default public String example return Hello public class Tester implements Testerface
  • Android 中如何通过彩信发送图片?

    我正在开发多媒体应用程序 我正在通过相机捕获一张图像 并希望将该图像和文本发送到其他号码 但我不知道如何通过彩信发送图像 MMS 只是一个 http post 请求 您应该使用执行请求额外的网络功能 final ConnectivityMa
  • 您使用什么物理 Android 设备进行测试?

    有什么好的推荐用于测试目的的物理 Android 设备吗 我正在苹果阵营寻找像 iPod touch 这样的设备 可以帮助 iOS 开发人员测试他们的东西 我知道有 Nexus One 但那东西相当昂贵 而且我并不真正关心手机的东西 而是可
  • Eclipse 启动时崩溃;退出代码=13

    I am trying to work with Eclipse Helios on my x64 machine Im pretty sure now that this problem could occur with any ecli
  • 卡片视图 单击卡片移至新活动

    我是 Android 编程新手 正在研究卡片布局 我想知道如何使其可点击 android clickable true android foreground android attr selectableItemBackground 我的卡
  • 在命令行上卸载 Android SDK 的选定部分

    这与 卸载旧的 Android SDK 版本 https stackoverflow com questions 15182377 uninstall old android sdk versions 除非我想在无头 Linux CI 服务
  • 找不到符号 NOTIFICATION_SERVICE?

    package com test app import android app Notification import android app NotificationManager import android app PendingIn
  • 如何使用mockito模拟构建器

    我有一个建造者 class Builder private String name private String address public Builder setName String name this name name retur
  • 如何将双精度/浮点四舍五入为二进制精度?

    我正在编写对浮点数执行计算的代码的测试 不出所料 结果很少是准确的 我想在计算结果和预期结果之间设置一个容差 我已经证实 在实践中 使用双精度 在对最后两位有效小数进行四舍五入后 结果始终是正确的 但是usually四舍五入最后一位小数后
  • Spring Boot 无法更新 azure cosmos db(MongoDb) 上的分片集合

    我的数据库中存在一个集合 documentDev 其分片键为 dNumber 样本文件 id 12831221wadaee23 dNumber 115 processed false 如果我尝试使用以下命令通过任何查询工具更新此文档 db
  • Spring Rest 和 Jsonp

    我正在尝试让我的 Spring Rest 控制器返回jsonp但我没有快乐 如果我想返回 json 但我有返回的要求 完全相同的代码可以正常工作jsonp我添加了一个转换器 我在网上找到了用于执行 jsonp 转换的源代码 我正在使用 Sp
  • Android 后台倒计时器

    我有一个 Android 应用程序 它管理一个倒计时器 类 CountDownTimer 它显示在应用程序屏幕中 以显示到达 00 00 还剩多少时间 我现在的问题是 当我按主页按钮或启动另一个应用程序时 应用程序 计时器不会在后台运行 所
  • Android 屏幕方向错误

    我使用的是 Android HTC HERO 2 1 版本 我写的活动
  • Git 实验分支还是单独的实验存储库?

    我正在开发一个 Android 应用程序 并且在整个开发周期中一直使用 Git 现在 我想构建并发布实验性功能 供人们尝试和安装 同时仍将原始的 稳定的应用程序安装在他们的设备上 现在 这意味着我需要使用不同的包名称 这会更改开发项目中的一
  • Java中super关键字的范围和使用

    为什么无法使用 super 关键字访问父类变量 使用以下代码 输出为 feline cougar c c class Feline public String type f public Feline System out print fe

随机推荐

  • 实时汇率获取 解决跨域以及循环Ajax请求

    前端框架 ExtJs 币种代码 var currencys curCode USD curCode CNY curCode HKD setInterval function for var idx 0 len currencys lengt
  • Java 单链表

    package com abin lee tree test import com abin des algorithm common json jackson JsonUtil import java util concurrent at
  • vue动态表单封装

    需求 根据传参动态生成表单 例如搜索表格的表单 1 组件封装
  • Java--concurrent并发包下阻塞队列介绍

    JDK提供了7中阻塞队列 这里介绍其中3中 剩余的以此类推原理相同 1 ArrayBlockingQueue package com seeyon queue import java util concurrent ArrayBlockin
  • FastJson中JSONObject用法及常用方法总结

    人无远虑 必有近忧 1 什么是FastJson JSONObject fastjson是阿里巴巴的开源JSON解析库 它可以解析JSON格式的字符串 支持将Java Bean序列化为JSON字符串 也可以从JSON字符串反序列化到JavaB
  • 二本本科,银行外包开发工作 4 个月有余。聊聊外包公司工作的一些真实感受!...

    最近会更新一系列关于在外包工作的真实经历和感受的文章 挺多小伙伴都比较感兴趣的 文章内容都来自在外包公司工作的读者的真实经历 另外 不同的外包公司 不同的外包工作 不同的甲方等等因素都会影响每个人做外包工作的体验 希望大家在发表自己言论的时
  • [1128]commons-lang里面StringUtils方法说明以及案例

    文章目录 1 public static boolean isBlank String str 2 public static boolean isEmpty String str 3 public static boolean isNot
  • mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

    mysql Can t connect to local MySQL server through socket var lib mysql mysql sock 今天在linux中安装了mysql但在连接时出现Can t connect
  • 【数据结构】CH3 栈和队列

    目录 前言 一 栈 1 栈的定义 1 相关概念 2 栈的抽象数据类型 2 栈的顺序存储结构及其基本运算的实现 1 顺序存储结构 2 初始化栈InitStack s 3 销毁栈DestroyStack s 4 判断栈是否为空StackEmpt
  • 蓝桥杯真题:测试次数

    这题是用动态规划去做的 参考 蓝桥杯 2018蓝桥初赛 测试次数 扔手机 动态规划 Miserable ccf的博客 CSDN博客 我们的目标是求取第n层 有m台手机下最优策略最坏情况下的测试数 我们定义dp i j 代表剩余i层 j台手机
  • Qt Creator + github copilot配置教程:AI编程新体验

    文章目录 前言 一 环境介绍 二 Copilot配置 1 安装nodejs 2 源码下载 方法a 代码克隆 方法b 直接下载源码包 3 路径配置 4 github copilot开通 三 安装Qt Creator 1 安装包下载 2 安装目
  • 五款实用的微信小程序(免费证件照)

    在这里给大家推荐几个平时常用的微信小程序 真心方便实用 绝对不是打广告 小米云证件照 目前很多证件照APP不是要收费 就是里面内置了许多广告 体验不佳 小米云证件照可以用三个词概况 免费 干净 无广告 懂的自然懂 扫描全能王 老牌的扫描工具
  • docker基础:联合文件系统

    首先docker的镜像是由一层一层的文件系统组成的 不同 Docker 容器就可以共享一些基础的文件系统层 同时再加上自己独有的改动层 大大提高了存储的效率 这个基础是联合文件系统 联合文件系统 UnionFS 是一种分层 轻量级并且高性能
  • 修改host方法

    打开路径 C Windows System32 drivers etc 将hosts文件拷贝出来修改之后放回去覆盖即可 想得到ip可以先ping一下那个域名 以下是一个例子 左边是ip 右边是域名 不用加 223 6 248 220 www
  • vue3+Element-plus el-select 下拉表格组件(2023-08-21 解决TSelectTable组件表单编辑回显设置defaultSelectVal 无效)

    2023 08 21 解决TSelectTable组件表单编辑回显设置defaultSelectVal 无效 2023 06 28 TSelectTable组件新增查询条件 效果如下 一 最终效果 二 代码示例
  • 【故障处理】EXP-00091 Exporting questionable statistics

    数据库平台 soalris10 数据库版本 9i 日期 2013 2 19 项目 关键字 1 Exp 00091 2 Exp 问题 使用exp导出时 出现错误 分析 oracle10g oerr exp 00091 00091 00000
  • Python报错No module named 'cv2'

    import cv2 Python运行过程中报错No module named cv2 Traceback most recent call last File Users congjam PycharmProjects Jam Test
  • python uwsgi_Python/WSGI应用快速入门

    Python WSGI应用快速入门 这个快速入门将会告诉你如何部署简单的WSGI应用和常见的web框架 这里 Python指的是CPython 对于PyPy 你需要使用特定的插件 PyPy插件 Jython支持正在开发中 注解 要遵循此快速
  • mysql表分区

    1 分表与表分区的区别 1 1 关于分表 分表是将一个大表分为几个或是多个小表 例如 table 1每天有1Kw的数据量 table 1随便时间的增长会越来越大 最终达到mysql表的极限 在这种比较极端的情况下 我们可以考虑对table
  • Android 路由框架ARouter源码解析

    作者 小马快跑 我们知道在使用ARouter时 需要在build config里配置 annotationProcessor com alibaba arouter compiler 1 2 2 并且知道annotationProcesso