第一步:read系统调用,通过DMA调用,从磁盘/存储设备copy文件到kernel缓冲空间,发生一次用户态-内核态上下文切换
第二步:read系统调用返回后,发生一次从内核态-用户态的上下文切换,数据从内核缓冲空间复制到用户地址缓冲区(通过CPU copy);
第三步:发生write系统调用,把数据从用户地址空间复制到内核地址空间缓冲区,此次的内核缓冲区和socket关联,再次发生一次用户态-内核态上下文切换(CPU copy);
第四步:write系统调用返回,异步的发送数据到网络设备(DMA),发生一次内核态-用户态上下文切换;
^    匹配开始 一般和 $ 成对出现()    表示一个子表达式*     匹配前面的子表达式0到多次+     匹配前面的子表达式1到多次 和* 注意区分.     匹配除换行符 \n 之外的任意单个字符  针对单个[]    表达式,和()区别是 [] 只匹配单个字符?     匹配前面的子表达式0次或1次  注意和 *,+ 做区分\     转义符{}    范围限定符,描述出现频率范围  例如:ab{0,3} 表示 b最多出现3次,最少出现0次\    或$     匹配结尾 如果设置了 RegExp 对象的 Multiline 属性,则 $ 也匹配 ‘\n’ 或 ‘\r’。要匹配 $ 字符本身,请使用 $。利用zset,score保存时间戳:
ZRANGEBYSCORE [key] [min] [max] ZREMRANGEBYSCORE [key][min][max]ZADD [key] [member] [score]ZSCORE [key] [member]原因
OpenOffice默认的纸张大小为A4,当尺寸超过A4纸时,会出现折行问题(基于jodconverter);
可以通过修改XPrintable的PageFormat和PageSize解决
处理逻辑主要在抽象类org.jodconverter.AbstractConversionTask
中的execute(final OfficeContext context)方法;
@Override
  public void execute(final OfficeContext context) throws OfficeException {
      /**省略了try-catch及部分代码*/
   	  XComponent document = null;
   	  //加载文件
      document = loadDocument(context);
      //处理文件(抽象方法)
      modifyDocument(context, document);
      //保存文件
      storeDocument(document);
   
  }
其中modifyDocument(context,document)方法是抽象方法,另外两个是私有方法,所以可以重写此方法:
 @Override
    protected void modifyDocument(XComponent document) throws OfficeException {
        XRefreshable refreshable = UnoRuntime.queryInterface(XRefreshable.class, document);
        if (refreshable != null) {
            refreshable.refresh();
        }
        //获取XPrintable实例,修改PagerFormat和PaperSize的Value即可
        XPrintable xPrintable = UnoRuntime.queryInterface(XPrintable.class, document);
        PropertyValue[] printer = xPrintable.getPrinter();
        for (PropertyValue propertyValue:printer){
            if(propertyValue.Name.equalsIgnoreCase("PaperFormat")){
               //PaperFormat.USER表示用户自定义
               propertyValue.Value= PaperFormat.USER;
            }
            if(propertyValue.Name.equalsIgnoreCase("PaperSize")){
                Size A2 = new Size(42000, 59400);
                propertyValue.Value=A2;
            }
        }
        try {
            //重设printer值
            xPrintable.setPrinter(printer);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        }
    }
com.sun.star.view.PaperFormat 用于定义纸张格式,不过经过测试好像PaperSize 只能定义标准纸张尺寸,不太确定;
原因1
Constructor threw exception; nested exception is org.redisson.client.RedisConnectionException: Can't init enough connections amount! Only 0 from 10 were initialized. Server: /127.0.0.1:6379
原因,打开redis.conf文件,搜索protected-mode:
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
#    "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
redis默认会开启保护模式,当没有设置密码时会不允许连接;
设置为no重启即可
原因2
redis配置文件没有设置密码,但是spring boot 配置文件设置了密码password=,把这一行注释掉就可以
ApplicationContext是BeanFactory的子接口,对BeanFactory进行了一定的扩展,增加了: