Exemplo n.º 1
0
        // 压缩掉那些已标记删除事项占据的磁盘空间
        // 对于index文件,如果其中没有包含标记删除的事项,可以使用乘法搜索,速度快。
        // 一般要求排序前,Compress一下,否则排序速度很慢。
        public void CompressDeletedItem(CompressStyle style)
        {
            if ((style & CompressStyle.Data) == CompressStyle.Data)
            {
                // 删除标志在index文件中

                throw (new Exception("暂时不支持此功能"));
                /*
                // 清除老index
                RemoveIndexFile();
                OpenIndexFile();
                */
            }

            if ((style & CompressStyle.Index) == CompressStyle.Index)
            {
                if (m_streamSmall == null)
                    return;
                CompressIndex(m_streamSmall);
                bDirty = false;
            }

        }
Exemplo n.º 2
0
        // ѹ������Щ�ѱ��ɾ������ռ�ݵĴ��̿ռ�
        // ����index�ļ����������û�а������ɾ�����������ʹ�ó˷��������ٶȿ졣
        // һ��Ҫ������ǰ��Compressһ�£����������ٶȺ�����
        public void CompressDeletedItem(CompressStyle style)
        {
            if ((style & CompressStyle.Data) == CompressStyle.Data)
            {
                // ɾ����־��index�ļ���

                throw(new Exception("��ʱ��֧�ִ˹���"));
                /*
                // �����index
                RemoveIndexFile();
                OpenIndexFile();
                */
            }

            if ((style & CompressStyle.Index) == CompressStyle.Index)
            {
                if (m_streamSmall == null)
                    return;
                CompressIndex(m_streamSmall);
                bDirty = false;
            }
        }