首页 \ 问答 \ memcached使用什么散列算法来散列密钥?(What hashing algorithm does memcached use to hash keys?)

memcached使用什么散列算法来散列密钥?(What hashing algorithm does memcached use to hash keys?)

Memcached使用分布式一致性散列来选择放置密钥的服务器,但是使用散列算法将字符串密钥映射到应用Ketama算法进行服务器选择的最终散列。 这个算法在向不同服务器传播类似密钥方面有多好。


Memcached uses distributed consistent hashing to choose which server to put a key on but which hashing algo does it use to map string key into the final hash on which the Ketama algo is applied for server selection. And how good is that algo at spreading similar keys to different servers.


原文:https://stackoverflow.com/questions/10434375
更新时间:2023-10-19 10:10

最满意答案

1)每个模块可以选择定义进入/ interface / theme / layouts /文件夹的布局文件。 您可以通过在模块的config.xml文件中指定布局来完成此操作,如下所示:

<frontend>
    <layout>
        <updates>
            <jason_page>
                <file>jasonpage.xml</file>
            </jason_page>
        </updates>
    </layout>
</frontend>

2)是的。

a)Magento的界面是使用后向性构建的。 模板和布局首先取自您选择的界面和主题,如果没有找到,将从基础中获取。 这允许您仅在定义创建新基础时从基础更改的那些内容。

b)如果使用块创建新模块,则将在config.xml中指定这些块的类路径:

<global>
    <blocks>
        <jason_page>
            <class>Jason_Page_Block</class>
        </jason_page>
    </blocks>
</global>

这将定义标记jason_page以引用您的块。 然后,在定义布局时,您将引用块作为:

<block type='jason_page/blockname' as='blockname' name='blockname' />

您的块将命名为: Jason_Page_Block_Blockname中的/app/code/local/Jason/Page/Block/Blockname.php

c)每次使用<reference>标签并添加一些子块时,它们会被添加到大树中。 确保使用不同的name / as块的标签,你会没事的。 如果名称相同,则可能会导致错误。

d)local.xml(在app / etc中)定义了站点的一些配置参数,例如数据库连接信息和加密密钥。 它与布局无关。

d第2部分)由于您定义了布局文件,包括它们的名称,因此您不应该引起冲突。 选择一个比Page更独特的模块名称就可以了。 如果您的模块与默认模块(例如Page)具有相同的名称,则在config.xml文件中声明文件时,请在文件前添加命名空间。

希望有所帮助!

谢谢,乔


1) Each module can choose to define layout files that go into the /interface/theme/layouts/ folder. You can accomplish this by specifying the layouts in your module's config.xml file like this:

<frontend>
    <layout>
        <updates>
            <jason_page>
                <file>jasonpage.xml</file>
            </jason_page>
        </updates>
    </layout>
</frontend>

2) Yes.

a) Magento's interface is built using descendency. Templates and layouts are first taken from your chosen interface and theme, and if not found there, will be taken from base. This allows you to define only those things that change from the base when creating a new them.

b) If you create a new module with blocks, you will specify the classpath for those blocks in your config.xml:

<global>
    <blocks>
        <jason_page>
            <class>Jason_Page_Block</class>
        </jason_page>
    </blocks>
</global>

This will define the tag jason_page to refer to your blocks. Then, when defining a layout, you will reference your blocks as:

<block type='jason_page/blockname' as='blockname' name='blockname' />

And your blocks will be named as: Jason_Page_Block_Blockname in /app/code/local/Jason/Page/Block/Blockname.php

c) Each time you use a <reference> tag and add some child blocks, they are added to the large tree as you say. Make sure to use different name/as tags for the blocks, and you'll be fine. If the name is identical, you will probably cause errors.

d) local.xml (in app/etc) defines some configuration parameters for your site, such as database connection information and encryption keys. it doesn't have to do with layouts.

d part 2) Since you define your layout files, including their names, it's up to you to not cause collisions. Choosing a module name more unique than Page would go far here. If you do have a module with the same name as a default module (e.g. Page), prefix the file with your namespace when declaring it in your config.xml file.

Hope that helps!

Thanks, Joe

相关问答

更多
  • 答案内联 yotta和CLI有什么区别? Yotta是用于构建mbed v3项目的构建工具。 mbed CLI是用于构建mbed v5项目的工具。 breif的历史是v3并没有向后兼容v2,又名mbed classic,所以我们把v3的最佳部分和v2的最佳部分放在一起形成mbed v5。 在mbed v5中,就像在v2中一样,您可以使用在线编译器( https://developer.mbed.org/compiler ),也可以离线编译。 称为mbed CLI的工具与在线编译器后面的工具相同,它刚刚被包装 ...
  • 1)在测试粒度(因而易于诊断)和单元测试代码的详细程度之间进行权衡。 我个人很高兴能够采用相对粗糙的测试方法,特别是一旦测试和测试代码稳定下来。 粒度问题仅在测试失败时才适用。 (如果我在多断言测试用例中遇到了问题,我可以修复第一个失败并重复,或者根据需要临时破解测试用例,以确定发生了什么。) 2)使用你的常识。 根据您对编写代码的理解,设计您的测试以锻炼所有质量不同的子数据库。 认识到除了最微不足道的情况外, 不可能测试所有可能的输入。 3)单元测试的目的是提供一定程度的保证,使得被测方法能够做到他们需要 ...
  • 1)没有 2)没有 看到这个“自我解释”的片段 import Foundation let options: NSDirectoryEnumerationOptions = [.SkipsHiddenFiles, .SkipsPackageDescendants, .SkipsSubdirectoryDescendants] let res = options.rawValue == NSDirectoryEnumerationOptions.SkipsHiddenFiles.rawValue | NS ...
  • 这个英寸帖子是一个非常好的起点(像往常一样): http : //inchoo.net/ecommerce/magento/how-to-add-custom-product-relations-in-magento/ 这张另一张海报可能也有所帮助: http : //magebase.com/magento-tutorials/understanding-the-grid-serializer-block/ 要解决此问题,请按照问题中描述的步骤操作。 要解决UI问题,请使用以下线程中描述的方法: Mage ...
  • 最新的RXJS发行版提供了分解模块,以减轻巨大的文件大小,Lodash。 导入rxjs/Rx (如另一个答案所示)将为您提供整个库,不建议使用。 相反,单独导入方法和运算符: 对于核心类,从其作用域模块导入类: import { Observable } from 'rxjs/Observable' 例如方法,在“添加”范围中使用实例范围: import 'rxjs/add/observable/fromEvent' (注意,没有要导入的析构对象 - 导入时会自动添加该方法) 对于运算符,从add/oper ...
  • 1)每个模块可以选择定义进入/ interface / theme / layouts /文件夹的布局文件。 您可以通过在模块的config.xml文件中指定布局来完成此操作,如下所示: jasonpage.xml
  • 如果我正确地阅读了该问题,请尝试: $this->getLayout()->getBlock('root')->getTemplate(); If I read the question correctly, then try: $this->getLayout()->getBlock('root')->getTemplate();
  • 根据我之前的评论,你需要mysql4模型类让类通过Magento DB抽象层与数据库“对话”。 模型实例化的问题应该是由于配置文件中缺少标记: 0.1.0 ...
  • 其中一些可能特定于Oracle。 查询的完整结果不需要复制每个用户获得一个游标(如指针),该游标维护已检索哪些行,以及还需要获取哪些行。 数据库将缓存尽可能多的数据,因为它会从表中读取数据。 两位用户的主体只有文件上的只读文件句柄。 游标每个连接都维护一次,下一行的数据可能已经或可能不在内存中。 大部分连接都是单线程连接,一次只有一个客户端可以使用连接。 如果在同一连接上执行两次相同的查询,则会重置光标位置。 如果在正在更新的表上打开游标,则将旧行复制到单独的空间中(在Oracle中撤销)并在游标的整个生命 ...
  • 1)直接在视图中键入ng-controller ,视图与该控制器直接相关。 在路径中定义控制器允许您重用视图以满足其他需求。 例如,您有一个显示名称列表的视图。
    • {{item.name}}
    现在,在您的应用程序中的其他位置,您具有相同的确切结构,显示您需要再次执行相同操作的名称列表。
      ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。