首页 \ 问答 \ 如何使用apache Cassandra构建分层数据库(How do i build a hierarchical database with apache Cassandra)

如何使用apache Cassandra构建分层数据库(How do i build a hierarchical database with apache Cassandra)

我想开发一个分层数据库来存储文件系统中的目录结构

就像

 Root
   -dir
     -subdir
     -subdir
        -subdir
            -subdir
            -subdir
     -subdir
     -subdir

我可以使用Apache Cassandra吗?

一个java示例将更好地理解。


I want to develop a hierarchical database to store directory structure in the filesystem.

Just like

 Root
   -dir
     -subdir
     -subdir
        -subdir
            -subdir
            -subdir
     -subdir
     -subdir

can i use Apache Cassandra for this

a java example will be better to understand.


原文:https://stackoverflow.com/questions/6800791
更新时间:2022-10-06 06:10

最满意答案

我已将CustomCode_InvisibleProducts的扩展名更改为CustomCode_Visible,因为我不知道还能做什么。

不知何故,扩展程序立即开始运作。

最终代码:

应用程序的/ etc /模块/ CustomCode_Visible.xml

<?xml version="1.0"?>
<config>
  <modules>
    <CustomCode_Visible>
      <active>true</active>
      <codePool>local</codePool>
    </CustomCode_Visible>
  </modules>
</config>

应用程序/代码/本地/ CustomCode /可见光的/ etc / config.xml中

<?xml version="1.0"?>
<config>
    <modules>
        <CustomCode_Visible>
            <version>0.2.0</version>
        </CustomCode_Visible>
    </modules>
    <global>
        <models>
            <customcode_visible>
                <class>CustomCode_Visible_Model</class>
            </customcode_visible>
            <catalog>
                <rewrite>
                    <product_visibility>CustomCode_Visible_Model_Catalog_Product_Visibility</product_visibility>
                </rewrite>
            </catalog>
        </models>
    </global>
</config>

应用程序/代码/本地/ CustomCode /型号/目录/产品/ Visibility.php

class CustomCode_Visible_Model_Catalog_Product_Visibility extends Mage_Catalog_Model_Product_Visibility
{

  ....

        public function getVisibleInSiteIds()
    {
        return array(self::VISIBILITY_IN_SEARCH, self::VISIBILITY_IN_CATALOG, self::VISIBILITY_BOTH, self::VISIBILITY_NOT_VISIBLE);
    }

I've changed the name of the extension from CustomCode_InvisibleProducts to CustomCode_Visible, because I didn't know what else to do.

And somehow, the extension started working right away.

Final code:

app/etc/modules/CustomCode_Visible.xml

<?xml version="1.0"?>
<config>
  <modules>
    <CustomCode_Visible>
      <active>true</active>
      <codePool>local</codePool>
    </CustomCode_Visible>
  </modules>
</config>

app/code/local/CustomCode/Visible/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <CustomCode_Visible>
            <version>0.2.0</version>
        </CustomCode_Visible>
    </modules>
    <global>
        <models>
            <customcode_visible>
                <class>CustomCode_Visible_Model</class>
            </customcode_visible>
            <catalog>
                <rewrite>
                    <product_visibility>CustomCode_Visible_Model_Catalog_Product_Visibility</product_visibility>
                </rewrite>
            </catalog>
        </models>
    </global>
</config>

app/code/local/CustomCode/Model/Catalog/Product/Visibility.php

class CustomCode_Visible_Model_Catalog_Product_Visibility extends Mage_Catalog_Model_Product_Visibility
{

  ....

        public function getVisibleInSiteIds()
    {
        return array(self::VISIBILITY_IN_SEARCH, self::VISIBILITY_IN_CATALOG, self::VISIBILITY_BOTH, self::VISIBILITY_NOT_VISIBLE);
    }

相关问答

更多
  • 我从字面上发现了一些错误。 请更正这些错误: - 在“ local ”代码池中,您在问题中提到的所有文件结构在“ app ”文件夹内都有一个缺少文件夹名称“ code ”。 因此,本地模块的每个文件结构都必须如下所示: “ app/code/local/[namespace]/Sales/... ” 。 如果此文件夹结构错误,那么您的[namespace]_Sales模块可能无法按预期工作。 其次,文件“ config.xml ”的内容有点不对。 正确的将是: - ...
  • magento处理此问题的方法是使用事件/观察者。 例如,如果您在下订单后需要将订单信息发送到另一个系统,则可以创建一个观察sales_order_place_after的自定义模块。 阅读更多信息@ http://codemagento.com/2011/04/observers-and-dispatching-events/ 要获取事件列表,请参阅https://magento.stackexchange.com/questions/153/where-can-i-find-a-complete-lis ...
  • 我已将CustomCode_InvisibleProducts的扩展名更改为CustomCode_Visible,因为我不知道还能做什么。 不知何故,扩展程序立即开始运作。 最终代码: 应用程序的/ etc /模块/ CustomCode_Visible.xml true local
  • 通过论坛调试这些问题非常困难。 这是一个具有工作覆盖的模块(至少,它适用于我的1.4 CE安装)与你的差异,看看有什么不同,或者只是尝试在你的安装上安装,如果它不起作用,你知道有一个其他问题。 http://alanstorm.com/testbed/Mycomp.tar.gz These kinds of problems are notriously difficult to debug via a forum. Here's a module with a working override (at l ...
  • 根据平台, Mage::getModel('mymodule/mymodule'); 在查找要加载的文件时可能区分大小写(即它应该是Mage::getModel('myModule/myModule');给定您的文件夹结构和命名) 检查get_class(Mage :: getModel('mymodule / mymodule'))返回的内容。 它是你班级的班级名字吗? 如果没有,那么你甚至没有制作你的对象的实例。 早点检查驼峰套管,并确实有一个文件/MyVendor/MyModule/Model/MyM ...
  • 经过超过24小时的研究,我终于开始工作了。 由于文件夹权限,我遇到此错误(找不到文件)。 当我授予它工作的文件夹的权限。 谢谢你的帮助。 After researching for more than 24 hours, i finally got it to work. I was having this error (File Not Found) because of folder permissions. When i gave the permission to the folder it wor ...
  • 您可以跨自定义模型扩展Model类: class Namespace_Module_Model_Customer1 extends Mage_Customer_Model_Customer 在app / code / local / Namespace / Customer / Model / Customer1.php中定义,并且: class Namespace_Module_Model_Customer2 extends Mage_Customer_Model_Customer 在app / code ...
  • 这是因为在您的生产环境中启用了编译,但该文件尚未“编译”(复制到includes / src)。 请参阅此答案以获得解决方案。 This is due to compilation being enabled on your production environment, but that file has not been 'compiled' (copied to includes/src). See this answer for a solution.
  • 最好将模块的内容保存在其模块文件夹中。 如果您正在谈论的扩展是模块功能的一部分,那么您应该将它们放在该模块的文件夹中。 然后路径将是local / mycompany / Mymodule / Model / Shipping / Rate / Request.php。 我会在dir结构中创建这个额外的级别,以便更清楚重写的Request.php来自Shipping模块,但这绝对不是必需的。 这是一个很好的做法当然是模块化的原因。 您将能够更好地添加,删除和版本一个文件夹中包含的模块。 想想app / et ...
  • 用这个 local Use this local

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)