zoukankan      html  css  js  c++  java
  • SSM 是如何生存Key的?

    源码中有一个接口:KeyProvider的 方法 String generateKey(final Object keyObject);

    /**
         * From the supplied object, create a (no-whitespace) part of the key by which a value will be stored in Memcached.
         * (Hint: This value, plus the Namespace value, plus optional other key should be no longer than 250 characters.)
         * 
         * @param keyObject
         * @return
         */
        String generateKey(final Object keyObject);

    根据CacheMethod 返回的值,已经斜线,命名空间生成key

    private String buildCacheKey(final String[] objectIds, final String namespace) {
            if (objectIds.length == 1) {
                checkKeyPart(objectIds[0]);
                return namespace + SEPARATOR + objectIds[0];
            }
    
            StringBuilder cacheKey = new StringBuilder(namespace);
            cacheKey.append(SEPARATOR);
            for (String id : objectIds) {
                checkKeyPart(id);
                cacheKey.append(id);
                cacheKey.append(ID_SEPARATOR);
            }
    
            cacheKey.deleteCharAt(cacheKey.length() - 1);
            return cacheKey.toString();
        }
  • 相关阅读:
    redis 哨兵集群
    图像噪声概述
    基于FPGA的图像去噪
    参考文献写法
    zynq 之u-boot
    图像去噪算法
    制作根文件系统(接上次嵌入式交叉编译环境)
    ubuntu OPENCV移植
    zedboard OPENCV移植
    zedboard 构建嵌入式linux
  • 原文地址:https://www.cnblogs.com/pan2011/p/3650302.html
Copyright © 2011-2022 走看看