├── build.sh
├── config
├── doc_run.conf
├── docserver.conf
├── log4j.properties
├── log4j.xml
├── mileCliClent.properties.prod
├── proxy.cfg
├── servers.xml
├── sharding.cfg
└── test_daily_index.sh
├── docserver
├── cmockery-0.1.2
│ ├── AUTHORS
│ ├── COPYING
│ ├── ChangeLog
│ ├── INSTALL
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── NEWS
│ ├── aclocal.m4
│ ├── compile
│ ├── config.guess
│ ├── config.sub
│ ├── configure
│ ├── configure.ac
│ ├── depcomp
│ ├── doc
│ │ └── index.html
│ ├── install-sh
│ ├── libtool
│ ├── ltmain.sh
│ ├── m4
│ │ ├── google_namespace.m4
│ │ ├── namespaces.m4
│ │ └── stl_namespace.m4
│ ├── missing
│ └── mkinstalldirs
├── gtest-1.5.0
│ ├── CHANGES
│ ├── CMakeLists.txt
│ ├── CONTRIBUTORS
│ ├── COPYING
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── README
│ ├── aclocal.m4
│ ├── build-aux
│ │ ├── config.guess
│ │ ├── config.h.in
│ │ ├── config.sub
│ │ ├── depcomp
│ │ ├── install-sh
│ │ ├── ltmain.sh
│ │ └── missing
│ ├── codegear
│ │ ├── gtest.cbproj
│ │ ├── gtest.groupproj
│ │ ├── gtest_all.cc
│ │ ├── gtest_link.cc
│ │ ├── gtest_main.cbproj
│ │ └── gtest_unittest.cbproj
│ ├── configure
│ ├── configure.ac
│ ├── fused-src
│ │ └── gtest
│ │ │ ├── gtest-all.cc
│ │ │ ├── gtest.h
│ │ │ └── gtest_main.cc
│ ├── include
│ │ └── gtest
│ │ │ ├── gtest-death-test.h
│ │ │ ├── gtest-message.h
│ │ │ ├── gtest-param-test.h
│ │ │ ├── gtest-param-test.h.pump
│ │ │ ├── gtest-spi.h
│ │ │ ├── gtest-test-part.h
│ │ │ ├── gtest-typed-test.h
│ │ │ ├── gtest.h
│ │ │ ├── gtest_pred_impl.h
│ │ │ ├── gtest_prod.h
│ │ │ └── internal
│ │ │ ├── gtest-death-test-internal.h
│ │ │ ├── gtest-filepath.h
│ │ │ ├── gtest-internal.h
│ │ │ ├── gtest-linked_ptr.h
│ │ │ ├── gtest-param-util-generated.h
│ │ │ ├── gtest-param-util-generated.h.pump
│ │ │ ├── gtest-param-util.h
│ │ │ ├── gtest-port.h
│ │ │ ├── gtest-string.h
│ │ │ ├── gtest-tuple.h
│ │ │ ├── gtest-tuple.h.pump
│ │ │ ├── gtest-type-util.h
│ │ │ └── gtest-type-util.h.pump
│ ├── m4
│ │ ├── acx_pthread.m4
│ │ └── gtest.m4
│ ├── make
│ │ └── Makefile
│ ├── msvc
│ │ ├── gtest-md.sln
│ │ ├── gtest-md.vcproj
│ │ ├── gtest.sln
│ │ ├── gtest.vcproj
│ │ ├── gtest_main-md.vcproj
│ │ ├── gtest_main.vcproj
│ │ ├── gtest_prod_test-md.vcproj
│ │ ├── gtest_prod_test.vcproj
│ │ ├── gtest_unittest-md.vcproj
│ │ └── gtest_unittest.vcproj
│ ├── samples
│ │ ├── prime_tables.h
│ │ ├── sample1.cc
│ │ ├── sample1.h
│ │ ├── sample10_unittest.cc
│ │ ├── sample1_unittest.cc
│ │ ├── sample2.cc
│ │ ├── sample2.h
│ │ ├── sample2_unittest.cc
│ │ ├── sample3-inl.h
│ │ ├── sample3_unittest.cc
│ │ ├── sample4.cc
│ │ ├── sample4.h
│ │ ├── sample4_unittest.cc
│ │ ├── sample5_unittest.cc
│ │ ├── sample6_unittest.cc
│ │ ├── sample7_unittest.cc
│ │ ├── sample8_unittest.cc
│ │ └── sample9_unittest.cc
│ ├── scripts
│ │ ├── fuse_gtest_files.py
│ │ ├── gen_gtest_pred_impl.py
│ │ ├── gtest-config.in
│ │ ├── pump.py
│ │ └── test
│ │ │ └── Makefile
│ ├── src
│ │ ├── gtest-all.cc
│ │ ├── gtest-death-test.cc
│ │ ├── gtest-filepath.cc
│ │ ├── gtest-internal-inl.h
│ │ ├── gtest-port.cc
│ │ ├── gtest-test-part.cc
│ │ ├── gtest-typed-test.cc
│ │ ├── gtest.cc
│ │ └── gtest_main.cc
│ ├── test
│ │ ├── gtest-death-test_test.cc
│ │ ├── gtest-filepath_test.cc
│ │ ├── gtest-linked_ptr_test.cc
│ │ ├── gtest-listener_test.cc
│ │ ├── gtest-message_test.cc
│ │ ├── gtest-options_test.cc
│ │ ├── gtest-param-test2_test.cc
│ │ ├── gtest-param-test_test.cc
│ │ ├── gtest-param-test_test.h
│ │ ├── gtest-port_test.cc
│ │ ├── gtest-test-part_test.cc
│ │ ├── gtest-tuple_test.cc
│ │ ├── gtest-typed-test2_test.cc
│ │ ├── gtest-typed-test_test.cc
│ │ ├── gtest-typed-test_test.h
│ │ ├── gtest-unittest-api_test.cc
│ │ ├── gtest_all_test.cc
│ │ ├── gtest_break_on_failure_unittest.py
│ │ ├── gtest_break_on_failure_unittest_.cc
│ │ ├── gtest_color_test.py
│ │ ├── gtest_color_test_.cc
│ │ ├── gtest_env_var_test.py
│ │ ├── gtest_env_var_test_.cc
│ │ ├── gtest_environment_test.cc
│ │ ├── gtest_filter_unittest.py
│ │ ├── gtest_filter_unittest_.cc
│ │ ├── gtest_help_test.py
│ │ ├── gtest_help_test_.cc
│ │ ├── gtest_list_tests_unittest.py
│ │ ├── gtest_list_tests_unittest_.cc
│ │ ├── gtest_main_unittest.cc
│ │ ├── gtest_no_test_unittest.cc
│ │ ├── gtest_output_test.py
│ │ ├── gtest_output_test_.cc
│ │ ├── gtest_output_test_golden_lin.txt
│ │ ├── gtest_output_test_golden_win.txt
│ │ ├── gtest_pred_impl_unittest.cc
│ │ ├── gtest_prod_test.cc
│ │ ├── gtest_repeat_test.cc
│ │ ├── gtest_shuffle_test.py
│ │ ├── gtest_shuffle_test_.cc
│ │ ├── gtest_sole_header_test.cc
│ │ ├── gtest_stress_test.cc
│ │ ├── gtest_test_utils.py
│ │ ├── gtest_throw_on_failure_ex_test.cc
│ │ ├── gtest_throw_on_failure_test.py
│ │ ├── gtest_throw_on_failure_test_.cc
│ │ ├── gtest_uninitialized_test.py
│ │ ├── gtest_uninitialized_test_.cc
│ │ ├── gtest_unittest.cc
│ │ ├── gtest_xml_outfile1_test_.cc
│ │ ├── gtest_xml_outfile2_test_.cc
│ │ ├── gtest_xml_outfiles_test.py
│ │ ├── gtest_xml_output_unittest.py
│ │ ├── gtest_xml_output_unittest_.cc
│ │ ├── gtest_xml_test_utils.py
│ │ ├── production.cc
│ │ ├── production.h
│ │ ├── run_tests_util.py
│ │ └── run_tests_util_test.py
│ └── xcode
│ │ ├── Config
│ │ ├── DebugProject.xcconfig
│ │ ├── FrameworkTarget.xcconfig
│ │ ├── General.xcconfig
│ │ ├── ReleaseProject.xcconfig
│ │ ├── StaticLibraryTarget.xcconfig
│ │ └── TestTarget.xcconfig
│ │ ├── Resources
│ │ └── Info.plist
│ │ ├── Samples
│ │ └── FrameworkSample
│ │ │ ├── Info.plist
│ │ │ ├── WidgetFramework.xcodeproj
│ │ │ └── project.pbxproj
│ │ │ ├── runtests.sh
│ │ │ ├── widget.cc
│ │ │ ├── widget.h
│ │ │ └── widget_test.cc
│ │ ├── Scripts
│ │ ├── runtests.sh
│ │ └── versiongenerate.py
│ │ └── gtest.xcodeproj
│ │ └── project.pbxproj
├── indexengine
│ ├── COPYRIGHT
│ ├── MK.config
│ ├── Makefile
│ ├── README
│ ├── VERSION
│ ├── etc
│ │ ├── consume.xml
│ │ ├── doc_run.conf
│ │ └── docserver.conf
│ ├── indexengine.prj
│ ├── integration_tests
│ │ ├── base_test.sh
│ │ ├── docdb_replication_test.sh
│ │ ├── export_import_test.sh
│ │ ├── ldb_replication_test.sh
│ │ ├── multi_docserver_test.sh
│ │ ├── multi_storage_test.sh
│ │ └── slave_restart_test.sh
│ ├── lib
│ │ ├── 32
│ │ │ └── libevent.a
│ │ └── 64
│ │ │ └── libevent.a
│ ├── scripts
│ │ ├── deploy_controller.sh
│ │ ├── deploy_handler.sh
│ │ ├── doc_run.py
│ │ ├── mile.sh
│ │ ├── monitor_index.sh
│ │ ├── seg_receive.conf
│ │ ├── seg_receive.sh
│ │ └── seg_upload.sh
│ ├── src
│ │ ├── Makefile
│ │ ├── client.c
│ │ ├── common
│ │ │ ├── AggrFunc.cpp
│ │ │ ├── AggrFunc.h
│ │ │ ├── Clonable.h
│ │ │ ├── Comparator.h
│ │ │ ├── ConfigFile.cpp
│ │ │ ├── ConfigFile.h
│ │ │ ├── Equals.h
│ │ │ ├── HashCoding.h
│ │ │ ├── HashSet.cpp
│ │ │ ├── HashSet.h
│ │ │ ├── LDEquals.cpp
│ │ │ ├── LDEquals.h
│ │ │ ├── LDHash.cpp
│ │ │ ├── LDHash.h
│ │ │ ├── MPAlloc.h
│ │ │ ├── Makefile
│ │ │ ├── MileArray.cpp
│ │ │ ├── MileArray.h
│ │ │ ├── MileHashMap.cpp
│ │ │ ├── MileHashMap.h
│ │ │ ├── MileIterator.cpp
│ │ │ ├── MileIterator.h
│ │ │ ├── MileList.cpp
│ │ │ ├── MileList.h
│ │ │ ├── Mutex.h
│ │ │ ├── ResultSet.h
│ │ │ ├── atomic.h
│ │ │ ├── common_util.c
│ │ │ ├── common_util.h
│ │ │ ├── def.cc
│ │ │ ├── def.h
│ │ │ ├── file_op.c
│ │ │ ├── file_op.h
│ │ │ ├── hash.c
│ │ │ ├── hash.h
│ │ │ ├── list.h
│ │ │ ├── log.c
│ │ │ ├── log.h
│ │ │ ├── mem.c
│ │ │ ├── mem.h
│ │ │ ├── profiles.c
│ │ │ ├── profiles.h
│ │ │ ├── stat_collect.c
│ │ │ ├── stat_collect.h
│ │ │ ├── string_map.c
│ │ │ ├── string_map.h
│ │ │ └── test
│ │ │ │ ├── Makefile
│ │ │ │ ├── common_util_test.cpp
│ │ │ │ ├── config_file_test.cpp
│ │ │ │ ├── mpalloc_test.cpp
│ │ │ │ └── stat_collect_test.cpp
│ │ ├── data_export.cpp
│ │ ├── data_import.c
│ │ ├── docserver.cpp
│ │ ├── docserver.h
│ │ ├── execute
│ │ │ ├── CommonRS.cpp
│ │ │ ├── CommonRS.h
│ │ │ ├── CountAllStep.cpp
│ │ │ ├── CountAllStep.h
│ │ │ ├── CumulativeQueryStep.cpp
│ │ │ ├── CumulativeQueryStep.h
│ │ │ ├── CumulativeRS.h
│ │ │ ├── DeleteSubstep.cpp
│ │ │ ├── DeleteSubstep.h
│ │ │ ├── DistOrdRS.cpp
│ │ │ ├── DistOrdRS.h
│ │ │ ├── DistinctRS.cpp
│ │ │ ├── DistinctRS.h
│ │ │ ├── ExecutePlan.cpp
│ │ │ ├── ExecutePlan.h
│ │ │ ├── ExecuteStep.h
│ │ │ ├── ExecuteSubstep.h
│ │ │ ├── ExportSubstep.cpp
│ │ │ ├── ExportSubstep.h
│ │ │ ├── Expression.cpp
│ │ │ ├── Expression.h
│ │ │ ├── FilterSubstep.cpp
│ │ │ ├── FilterSubstep.h
│ │ │ ├── GroupRS.cpp
│ │ │ ├── GroupRS.h
│ │ │ ├── IndexStep.cpp
│ │ │ ├── IndexStep.h
│ │ │ ├── InsertStep.cpp
│ │ │ ├── InsertStep.h
│ │ │ ├── MainStep.cpp
│ │ │ ├── MainStep.h
│ │ │ ├── Makefile
│ │ │ ├── OrderComparator.cpp
│ │ │ ├── OrderComparator.h
│ │ │ ├── OrderedRS.cpp
│ │ │ ├── OrderedRS.h
│ │ │ ├── RefillStep.cpp
│ │ │ ├── RefillStep.h
│ │ │ ├── RowClone.cpp
│ │ │ ├── RowClone.h
│ │ │ ├── RowEquals.cpp
│ │ │ ├── RowEquals.h
│ │ │ ├── RowHash.cpp
│ │ │ ├── RowHash.h
│ │ │ ├── SelectSubstep.cpp
│ │ │ ├── SelectSubstep.h
│ │ │ ├── SqlAnalyzer.cpp
│ │ │ ├── SqlAnalyzer.h
│ │ │ ├── UpdateSubstep.cpp
│ │ │ ├── UpdateSubstep.h
│ │ │ ├── slave.c
│ │ │ ├── slave.h
│ │ │ └── subselect.c
│ │ ├── hi_control_segment.c
│ │ ├── load_monitor_data.c
│ │ ├── milebinlog.cpp
│ │ ├── protocol
│ │ │ ├── Makefile
│ │ │ ├── databuffer.c
│ │ │ ├── databuffer.h
│ │ │ ├── heartbeat.c
│ │ │ ├── heartbeat.h
│ │ │ ├── packet.cpp
│ │ │ ├── packet.h
│ │ │ ├── protocol.cpp
│ │ │ ├── protocol.h
│ │ │ └── subselect.h
│ │ ├── storage
│ │ │ ├── Makefile
│ │ │ ├── MileHandler.cpp
│ │ │ ├── MileHandler.h
│ │ │ ├── RecordIterator.cpp
│ │ │ ├── RecordIterator.h
│ │ │ ├── StateManager.cpp
│ │ │ ├── StateManager.h
│ │ │ ├── StorageEngine.cpp
│ │ │ ├── StorageEngine.h
│ │ │ ├── StorageEngineFactory.cpp
│ │ │ ├── StorageEngineFactory.h
│ │ │ ├── TableManager.cpp
│ │ │ ├── TableManager.h
│ │ │ ├── binlog.c
│ │ │ ├── binlog.h
│ │ │ ├── docdb
│ │ │ │ ├── DocEngine.cpp
│ │ │ │ ├── DocEngine.h
│ │ │ │ ├── DocHandler.cpp
│ │ │ │ ├── DocHandler.h
│ │ │ │ ├── DocIterator.cpp
│ │ │ │ ├── DocIterator.h
│ │ │ │ ├── DocTableMgr.cpp
│ │ │ │ ├── DocTableMgr.h
│ │ │ │ ├── Makefile
│ │ │ │ ├── bitmark.c
│ │ │ │ ├── bitmark.h
│ │ │ │ ├── bitops.h
│ │ │ │ ├── config_parser.c
│ │ │ │ ├── config_parser.h
│ │ │ │ ├── data_field.c
│ │ │ │ ├── data_field.h
│ │ │ │ ├── db.c
│ │ │ │ ├── db.h
│ │ │ │ ├── docdb_packet.c
│ │ │ │ ├── docdb_packet.h
│ │ │ │ ├── doclist.c
│ │ │ │ ├── doclist.h
│ │ │ │ ├── dynamic_hash_index.c
│ │ │ │ ├── dynamic_hash_index.h
│ │ │ │ ├── filter_index.c
│ │ │ │ ├── filter_index.h
│ │ │ │ ├── filtercompress.c
│ │ │ │ ├── filtercompress.h
│ │ │ │ ├── hash_index.c
│ │ │ │ ├── hash_index.h
│ │ │ │ ├── hash_memcompress.c
│ │ │ │ ├── hash_memcompress.h
│ │ │ │ ├── hashcompress.c
│ │ │ │ ├── hashcompress.h
│ │ │ │ ├── index_field.c
│ │ │ │ ├── index_field.h
│ │ │ │ ├── rowid_list.c
│ │ │ │ ├── rowid_list.h
│ │ │ │ ├── segment.c
│ │ │ │ ├── segment.h
│ │ │ │ ├── set_operator.c
│ │ │ │ ├── set_operator.h
│ │ │ │ ├── storage.c
│ │ │ │ ├── storage.h
│ │ │ │ ├── suffix.c
│ │ │ │ ├── suffix.h
│ │ │ │ ├── table.c
│ │ │ │ ├── table.h
│ │ │ │ ├── test
│ │ │ │ │ ├── Makefile
│ │ │ │ │ ├── db_test.cpp
│ │ │ │ │ ├── doclist_test.cpp
│ │ │ │ │ ├── dynamic_hash_index_test.cpp
│ │ │ │ │ ├── hashcompress_test.cpp
│ │ │ │ │ └── hashindex_test.cpp
│ │ │ │ ├── vstorage.c
│ │ │ │ └── vstorage.h
│ │ │ ├── ldb
│ │ │ │ ├── AggregateDesc.cpp
│ │ │ │ ├── AggregateDesc.h
│ │ │ │ ├── LdbComparator.cpp
│ │ │ │ ├── LdbComparator.h
│ │ │ │ ├── LdbConfig.h
│ │ │ │ ├── LdbEngine.cpp
│ │ │ │ ├── LdbEngine.h
│ │ │ │ ├── LdbFilter.cpp
│ │ │ │ ├── LdbFilter.h
│ │ │ │ ├── LdbHandler.cpp
│ │ │ │ ├── LdbHandler.h
│ │ │ │ ├── LdbIterator.cpp
│ │ │ │ ├── LdbIterator.h
│ │ │ │ ├── LdbTableImpl.cpp
│ │ │ │ ├── LdbTableImpl.h
│ │ │ │ ├── LdbTableMgr.cpp
│ │ │ │ ├── LdbTableMgr.h
│ │ │ │ ├── Makefile
│ │ │ │ ├── leveldb
│ │ │ │ │ ├── AUTHORS
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── Makefile
│ │ │ │ │ ├── NEWS
│ │ │ │ │ ├── README
│ │ │ │ │ ├── TODO
│ │ │ │ │ ├── build_detect_platform
│ │ │ │ │ ├── db
│ │ │ │ │ │ ├── builder.cc
│ │ │ │ │ │ ├── builder.h
│ │ │ │ │ │ ├── c.cc
│ │ │ │ │ │ ├── c_test.c
│ │ │ │ │ │ ├── corruption_test.cc
│ │ │ │ │ │ ├── db_bench.cc
│ │ │ │ │ │ ├── db_impl.cc
│ │ │ │ │ │ ├── db_impl.h
│ │ │ │ │ │ ├── db_iter.cc
│ │ │ │ │ │ ├── db_iter.h
│ │ │ │ │ │ ├── db_test.cc
│ │ │ │ │ │ ├── dbformat.cc
│ │ │ │ │ │ ├── dbformat.h
│ │ │ │ │ │ ├── dbformat_test.cc
│ │ │ │ │ │ ├── filename.cc
│ │ │ │ │ │ ├── filename.h
│ │ │ │ │ │ ├── filename_test.cc
│ │ │ │ │ │ ├── log_format.h
│ │ │ │ │ │ ├── log_reader.cc
│ │ │ │ │ │ ├── log_reader.h
│ │ │ │ │ │ ├── log_test.cc
│ │ │ │ │ │ ├── log_writer.cc
│ │ │ │ │ │ ├── log_writer.h
│ │ │ │ │ │ ├── memtable.cc
│ │ │ │ │ │ ├── memtable.h
│ │ │ │ │ │ ├── repair.cc
│ │ │ │ │ │ ├── skiplist.h
│ │ │ │ │ │ ├── skiplist_test.cc
│ │ │ │ │ │ ├── snapshot.h
│ │ │ │ │ │ ├── table_cache.cc
│ │ │ │ │ │ ├── table_cache.h
│ │ │ │ │ │ ├── version_edit.cc
│ │ │ │ │ │ ├── version_edit.h
│ │ │ │ │ │ ├── version_edit_test.cc
│ │ │ │ │ │ ├── version_set.cc
│ │ │ │ │ │ ├── version_set.h
│ │ │ │ │ │ ├── version_set_test.cc
│ │ │ │ │ │ ├── write_batch.cc
│ │ │ │ │ │ ├── write_batch_internal.h
│ │ │ │ │ │ └── write_batch_test.cc
│ │ │ │ │ ├── doc
│ │ │ │ │ │ ├── bench
│ │ │ │ │ │ │ ├── db_bench_sqlite3.cc
│ │ │ │ │ │ │ └── db_bench_tree_db.cc
│ │ │ │ │ │ ├── benchmark.html
│ │ │ │ │ │ ├── doc.css
│ │ │ │ │ │ ├── impl.html
│ │ │ │ │ │ ├── index.html
│ │ │ │ │ │ ├── log_format.txt
│ │ │ │ │ │ └── table_format.txt
│ │ │ │ │ ├── helpers
│ │ │ │ │ │ └── memenv
│ │ │ │ │ │ │ ├── memenv.cc
│ │ │ │ │ │ │ ├── memenv.h
│ │ │ │ │ │ │ └── memenv_test.cc
│ │ │ │ │ ├── include
│ │ │ │ │ │ └── leveldb
│ │ │ │ │ │ │ ├── c.h
│ │ │ │ │ │ │ ├── cache.h
│ │ │ │ │ │ │ ├── comparator.h
│ │ │ │ │ │ │ ├── db.h
│ │ │ │ │ │ │ ├── env.h
│ │ │ │ │ │ │ ├── filter_policy.h
│ │ │ │ │ │ │ ├── iterator.h
│ │ │ │ │ │ │ ├── options.h
│ │ │ │ │ │ │ ├── slice.h
│ │ │ │ │ │ │ ├── status.h
│ │ │ │ │ │ │ ├── table.h
│ │ │ │ │ │ │ ├── table_builder.h
│ │ │ │ │ │ │ └── write_batch.h
│ │ │ │ │ ├── port
│ │ │ │ │ │ ├── README
│ │ │ │ │ │ ├── atomic_pointer.h
│ │ │ │ │ │ ├── port.h
│ │ │ │ │ │ ├── port_example.h
│ │ │ │ │ │ ├── port_posix.cc
│ │ │ │ │ │ ├── port_posix.h
│ │ │ │ │ │ └── win
│ │ │ │ │ │ │ └── stdint.h
│ │ │ │ │ ├── table
│ │ │ │ │ │ ├── block.cc
│ │ │ │ │ │ ├── block.h
│ │ │ │ │ │ ├── block_builder.cc
│ │ │ │ │ │ ├── block_builder.h
│ │ │ │ │ │ ├── filter_block.cc
│ │ │ │ │ │ ├── filter_block.h
│ │ │ │ │ │ ├── filter_block_test.cc
│ │ │ │ │ │ ├── format.cc
│ │ │ │ │ │ ├── format.h
│ │ │ │ │ │ ├── iterator.cc
│ │ │ │ │ │ ├── iterator_wrapper.h
│ │ │ │ │ │ ├── merger.cc
│ │ │ │ │ │ ├── merger.h
│ │ │ │ │ │ ├── table.cc
│ │ │ │ │ │ ├── table_builder.cc
│ │ │ │ │ │ ├── table_test.cc
│ │ │ │ │ │ ├── two_level_iterator.cc
│ │ │ │ │ │ └── two_level_iterator.h
│ │ │ │ │ └── util
│ │ │ │ │ │ ├── arena.cc
│ │ │ │ │ │ ├── arena.h
│ │ │ │ │ │ ├── arena_test.cc
│ │ │ │ │ │ ├── bloom.cc
│ │ │ │ │ │ ├── bloom_test.cc
│ │ │ │ │ │ ├── cache.cc
│ │ │ │ │ │ ├── cache_test.cc
│ │ │ │ │ │ ├── coding.cc
│ │ │ │ │ │ ├── coding.h
│ │ │ │ │ │ ├── coding_test.cc
│ │ │ │ │ │ ├── comparator.cc
│ │ │ │ │ │ ├── config.cc
│ │ │ │ │ │ ├── config.h
│ │ │ │ │ │ ├── crc32c.cc
│ │ │ │ │ │ ├── crc32c.h
│ │ │ │ │ │ ├── crc32c_test.cc
│ │ │ │ │ │ ├── env.cc
│ │ │ │ │ │ ├── env_posix.cc
│ │ │ │ │ │ ├── env_test.cc
│ │ │ │ │ │ ├── filter_policy.cc
│ │ │ │ │ │ ├── hash.cc
│ │ │ │ │ │ ├── hash.h
│ │ │ │ │ │ ├── histogram.cc
│ │ │ │ │ │ ├── histogram.h
│ │ │ │ │ │ ├── logging.cc
│ │ │ │ │ │ ├── logging.h
│ │ │ │ │ │ ├── mutexlock.h
│ │ │ │ │ │ ├── options.cc
│ │ │ │ │ │ ├── posix_logger.h
│ │ │ │ │ │ ├── random.h
│ │ │ │ │ │ ├── status.cc
│ │ │ │ │ │ ├── testharness.cc
│ │ │ │ │ │ ├── testharness.h
│ │ │ │ │ │ ├── testutil.cc
│ │ │ │ │ │ └── testutil.h
│ │ │ │ └── snappy
│ │ │ │ │ ├── AUTHORS
│ │ │ │ │ ├── COPYING
│ │ │ │ │ ├── ChangeLog
│ │ │ │ │ ├── Makefile.am
│ │ │ │ │ ├── NEWS
│ │ │ │ │ ├── README
│ │ │ │ │ ├── autogen.sh
│ │ │ │ │ ├── configure.ac
│ │ │ │ │ ├── format_description.txt
│ │ │ │ │ ├── framing_format.txt
│ │ │ │ │ ├── m4
│ │ │ │ │ └── gtest.m4
│ │ │ │ │ ├── snappy-c.cc
│ │ │ │ │ ├── snappy-c.h
│ │ │ │ │ ├── snappy-internal.h
│ │ │ │ │ ├── snappy-sinksource.cc
│ │ │ │ │ ├── snappy-sinksource.h
│ │ │ │ │ ├── snappy-stubs-internal.cc
│ │ │ │ │ ├── snappy-stubs-internal.h
│ │ │ │ │ ├── snappy-stubs-public.h.in
│ │ │ │ │ ├── snappy-test.cc
│ │ │ │ │ ├── snappy-test.h
│ │ │ │ │ ├── snappy.cc
│ │ │ │ │ ├── snappy.h
│ │ │ │ │ ├── snappy_unittest.cc
│ │ │ │ │ └── testdata
│ │ │ │ │ ├── alice29.txt
│ │ │ │ │ ├── asyoulik.txt
│ │ │ │ │ ├── baddata1.snappy
│ │ │ │ │ ├── baddata2.snappy
│ │ │ │ │ ├── baddata3.snappy
│ │ │ │ │ ├── cp.html
│ │ │ │ │ ├── fields.c
│ │ │ │ │ ├── geo.protodata
│ │ │ │ │ ├── grammar.lsp
│ │ │ │ │ ├── house.jpg
│ │ │ │ │ ├── html
│ │ │ │ │ ├── html_x_4
│ │ │ │ │ ├── kennedy.xls
│ │ │ │ │ ├── kppkn.gtb
│ │ │ │ │ ├── lcet10.txt
│ │ │ │ │ ├── mapreduce-osdi-1.pdf
│ │ │ │ │ ├── plrabn12.txt
│ │ │ │ │ ├── ptt5
│ │ │ │ │ ├── sum
│ │ │ │ │ ├── urls.10K
│ │ │ │ │ └── xargs.1
│ │ │ └── test
│ │ │ │ ├── Makefile
│ │ │ │ ├── cumulative_index_test.cpp
│ │ │ │ ├── doc_engine_test.cpp
│ │ │ │ ├── ldb_engine_test.cpp
│ │ │ │ ├── storage_engine_helper.cpp
│ │ │ │ └── storage_engine_helper.h
│ │ ├── table_meta_trans.c
│ │ └── update_dumped_seg_time.cpp
│ └── tests
│ │ ├── Makefile
│ │ ├── Makefile.old
│ │ ├── Makefile_man
│ │ ├── README
│ │ ├── config.c
│ │ ├── config.h
│ │ ├── def.h
│ │ ├── docserver.conf
│ │ ├── fake_protocol.cpp
│ │ ├── fake_protocol.h
│ │ ├── generate.c
│ │ ├── hi_db_mock.c
│ │ ├── hi_db_mock.h
│ │ ├── hi_suffix_mock.c
│ │ ├── hyperindex_db_mock.h
│ │ ├── insert_test.c
│ │ ├── mapped_file_size.sh
│ │ ├── multi_inserttest.c
│ │ ├── seg_rowid_list_test.c
│ │ ├── seg_rowid_list_test.h
│ │ ├── sh_inserttest.sh
│ │ ├── terminal.pm
│ │ ├── test.pl
│ │ ├── unit_binlog.cpp
│ │ ├── unit_bitmark_test.cpp
│ │ ├── unit_block_manager.cpp
│ │ ├── unit_btree.cpp
│ │ ├── unit_databuffer_test.cpp
│ │ ├── unit_db_integration.cpp
│ │ ├── unit_doclist_test.cpp
│ │ ├── unit_dump_test.cpp
│ │ ├── unit_filtercompress.cpp
│ │ ├── unit_filterindex_test.cpp
│ │ ├── unit_hash_test.cpp
│ │ ├── unit_hashcompress_test.cpp
│ │ ├── unit_hashindex_test.cpp
│ │ ├── unit_hashmap_test.cpp
│ │ ├── unit_hi_packet_execute_test.cpp
│ │ ├── unit_interface_test.cpp
│ │ ├── unit_mem.cpp
│ │ ├── unit_packet_execute_test.cpp
│ │ ├── unit_profile.cpp
│ │ ├── unit_replication_test.cpp
│ │ ├── unit_set_operator_test.cpp
│ │ ├── unit_sort_test.cpp
│ │ ├── unit_sql_execute_test.cpp
│ │ ├── unit_stats_test.cpp
│ │ ├── unit_suffix.cpp
│ │ └── unit_test.cpp
└── test
├── mergeserver
├── client
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ └── client
│ │ ├── ApplationClientImpl.java
│ │ ├── CheckMergeServersTimerTask.java
│ │ ├── SqlClientTemplate.java
│ │ └── result
│ │ ├── MileDeleteResult.java
│ │ ├── MileExportResult.java
│ │ ├── MileInsertResult.java
│ │ ├── MileQueryResult.java
│ │ ├── MileSqlResult.java
│ │ └── MileUpdateResult.java
├── cmd
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ └── client
│ │ ├── CliDriverToTest.java
│ │ ├── CommonSqltoSql.java
│ │ ├── CtuEventDailyToSql.java
│ │ ├── DBDataToSql.java
│ │ ├── DataToSql.java
│ │ ├── LoadCtuDataFromLog.java
│ │ ├── LoadExportSqlTest.java
│ │ ├── LogDataReloader.java
│ │ ├── RecordReloader.java
│ │ ├── SimpleClientTest.java
│ │ └── SqlParamParser.java
├── common
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ ├── Config.java
│ │ ├── Constants.java
│ │ ├── DocDigestData.java
│ │ ├── Expression.java
│ │ ├── FieldDesc.java
│ │ ├── OperatorExp.java
│ │ ├── Record.java
│ │ ├── SqlResultSet.java
│ │ ├── communication
│ │ ├── ApplationClientService.java
│ │ ├── MessageClientPipelineFactory.java
│ │ ├── MessageListener.java
│ │ ├── MessageManager.java
│ │ ├── MessageServerPipelineFactory.java
│ │ ├── MileClient.java
│ │ ├── MileClientChannelPipeline.java
│ │ ├── MileClientHandler.java
│ │ ├── MileMessageDecoder.java
│ │ ├── MileMessageEncoder.java
│ │ ├── MileServer.java
│ │ ├── MileServerChannelPipeline.java
│ │ ├── MileServerHandler.java
│ │ ├── Node.java
│ │ ├── ReceiveDataHandle.java
│ │ ├── SendFuture.java
│ │ ├── SendFutureCleanTimerTask.java
│ │ └── ServerRef.java
│ │ ├── log
│ │ ├── DigestLogUtil.java
│ │ ├── RequestCounter.java
│ │ ├── RequestDigest.java
│ │ ├── TopLinkedList.java
│ │ └── TopSqlData.java
│ │ ├── message
│ │ ├── AbstractMessage.java
│ │ ├── AccessRsMessage.java
│ │ ├── AccessSpecifyQueryRsMessage.java
│ │ ├── AccessSqlExeErrorMessage.java
│ │ ├── AccessStateRsMessage.java
│ │ ├── ClientConnRespError.java
│ │ ├── ClientConnRespOKMessage.java
│ │ ├── ClientConnectMessage.java
│ │ ├── ClientReConnectMessage.java
│ │ ├── CommonErrorMessage.java
│ │ ├── CommonOkMessage.java
│ │ ├── DocStartCommandMessage.java
│ │ ├── DocStopCommandMessage.java
│ │ ├── KeyValueData.java
│ │ ├── MergeStartCommandMessage.java
│ │ ├── MergeStartLeadQueryMessage.java
│ │ ├── MergeStopCommandMessage.java
│ │ ├── MergeStopLeadQueryMessage.java
│ │ ├── MergerDocHeartcheck.java
│ │ ├── Message.java
│ │ ├── MessageFactory.java
│ │ ├── SpecifyQueryExecuteRsMessage.java
│ │ ├── SqlExectueErrorMessage.java
│ │ ├── SqlExecuteMessage.java
│ │ ├── SqlExecuteRsMessage.java
│ │ ├── SqlPreExecuteMessage.java
│ │ └── TypeCode.java
│ │ ├── mileexception
│ │ ├── ArgumentFormantException.java
│ │ ├── IllegalSqlException.java
│ │ ├── MileException.java
│ │ ├── SQLException.java
│ │ └── SqlExecuteException.java
│ │ └── util
│ │ ├── ByteConveror.java
│ │ ├── DailyRollingFileAppender.java
│ │ └── SimpleThreadFactory.java
├── perf
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ └── benchmark
│ │ ├── Benchmark.java
│ │ ├── BenchmarkUtils.java
│ │ ├── ClientWrapper.java
│ │ ├── CmdProvider.java
│ │ ├── DiscreteGenerator.java
│ │ ├── FileProvider.java
│ │ ├── InsertProvider.java
│ │ ├── Measurement.java
│ │ ├── Metrics.java
│ │ ├── MileCmdParser.java
│ │ ├── QueryProvider.java
│ │ ├── SqlFileProvider.java
│ │ ├── Workload.java
│ │ ├── ctu
│ │ ├── CtuMiniSearchProvider.java
│ │ ├── Segmenter.java
│ │ ├── SimilarityEvaluator.java
│ │ ├── SimilarityEvaluatorImpl.java
│ │ ├── WordSegment.java
│ │ └── ZlibUtils.java
│ │ └── util
│ │ ├── CmdUtils.java
│ │ ├── ConfigurationException.java
│ │ ├── FileLine.java
│ │ ├── Generator.java
│ │ ├── Props.java
│ │ ├── SqlParamEntry.java
│ │ ├── SystemTime.java
│ │ ├── Time.java
│ │ ├── UndefinedPropertyException.java
│ │ └── Utils.java
├── pom.xml
├── server
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── com
│ │ │ └── alipay
│ │ │ └── mile
│ │ │ ├── message
│ │ │ └── m2d
│ │ │ │ ├── AccessStateMessage.java
│ │ │ │ ├── AccessStatementMessage.java
│ │ │ │ └── SpecifyQueryExecuteMessage.java
│ │ │ ├── plan
│ │ │ ├── CombineStep.java
│ │ │ ├── DeleteStep.java
│ │ │ ├── ExecutePlan.java
│ │ │ ├── ExecuteStep.java
│ │ │ ├── ExportStep.java
│ │ │ ├── GetKVStep.java
│ │ │ ├── GroupStep.java
│ │ │ ├── HavingStep.java
│ │ │ ├── InsertStep.java
│ │ │ ├── MessageProcessor.java
│ │ │ ├── OrderComparator.java
│ │ │ ├── OrderStep.java
│ │ │ ├── OutputStep.java
│ │ │ ├── ParamBindStep.java
│ │ │ ├── SelectStep.java
│ │ │ ├── SetOperateStep.java
│ │ │ ├── SqlAnalyzer.java
│ │ │ └── UpdateStep.java
│ │ │ └── server
│ │ │ ├── CheckDocServersTimerTask.java
│ │ │ ├── Main.java
│ │ │ ├── MergeServerMessageListener.java
│ │ │ ├── ProxyServer.java
│ │ │ ├── T2
│ │ │ ├── mileSqlCondition.g
│ │ │ ├── mileSqlConditionLexer.java
│ │ │ ├── mileSqlConditionParser.java
│ │ │ ├── milesql.g
│ │ │ ├── milesqlLexer.java
│ │ │ ├── milesqlParser.java
│ │ │ └── milesqlo.g
│ │ │ ├── merge
│ │ │ ├── BoundedConcurrentHashMap.java
│ │ │ ├── DocumentChooseStrategy.java
│ │ │ ├── DocumentServerPolicy.java
│ │ │ ├── Merger.java
│ │ │ ├── Policy.java
│ │ │ ├── RandomStrategy.java
│ │ │ └── ShardingStrategy.java
│ │ │ ├── query
│ │ │ ├── ColumnExp.java
│ │ │ ├── ColumnSubSelectExp.java
│ │ │ ├── DeleteStatement.java
│ │ │ ├── DocHint.java
│ │ │ ├── ExportStatement.java
│ │ │ ├── FieldValuePair.java
│ │ │ ├── GetkvStatement.java
│ │ │ ├── InsertStatement.java
│ │ │ ├── OrderDesc.java
│ │ │ ├── QueryStatement.java
│ │ │ ├── QueryStatementExpression.java
│ │ │ ├── RangeDesc.java
│ │ │ ├── SetOperatorExpression.java
│ │ │ ├── Statement.java
│ │ │ ├── TimeHint.java
│ │ │ ├── UpdateStatement.java
│ │ │ ├── ValueDesc.java
│ │ │ └── special
│ │ │ │ ├── AbstractSubSelect.java
│ │ │ │ ├── MaxFuncResult.java
│ │ │ │ ├── MaxFuncSelect.java
│ │ │ │ ├── MaxFuncSelectDesc.java
│ │ │ │ ├── SpecifyQuery.java
│ │ │ │ ├── SpecifyQueryStatement.java
│ │ │ │ ├── SubSelect.java
│ │ │ │ ├── SubSelectDesc.java
│ │ │ │ ├── SubSelectDescFactory.java
│ │ │ │ ├── SubSelectFactory.java
│ │ │ │ ├── SubSelectResult.java
│ │ │ │ └── SubSelectResultFactory.java
│ │ │ └── sharding
│ │ │ ├── BetweenShardingRule.java
│ │ │ ├── DefaultShardConfig.java
│ │ │ ├── ModShardingRule.java
│ │ │ ├── ShardConstants.java
│ │ │ ├── ShardingRule.java
│ │ │ ├── SingleShardingRule.java
│ │ │ ├── TableRule.java
│ │ │ └── TimeSingleShardingRule.java
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ └── server
│ │ └── sharding
│ │ ├── BetweenShardingTest.java
│ │ ├── ModShardingTest.java
│ │ └── SingleShardingTest.java
└── test
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ └── org.eclipse.jdt.core.prefs
│ ├── pom.xml
│ ├── src
│ └── test
│ │ └── java
│ │ └── com
│ │ └── alipay
│ │ └── mile
│ │ ├── integration
│ │ ├── MileClientAbstract.java
│ │ ├── TestAll.java
│ │ ├── TestTools.java
│ │ ├── fulltext
│ │ │ └── MileClientFulltextSelectTest.java
│ │ ├── function
│ │ │ ├── MileClientCountDistinctFuncTest.java
│ │ │ ├── MileClientCountFuncTest.java
│ │ │ ├── MileClientCutAvgFuncLdbTest.java
│ │ │ ├── MileClientCutAvgFuncTest.java
│ │ │ ├── MileClientCutCountFuncLdbTest.java
│ │ │ ├── MileClientCutCountFuncTest.java
│ │ │ ├── MileClientCutRowLdbTest.java
│ │ │ ├── MileClientCutRowTest.java
│ │ │ ├── MileClientMaxFuncTest.java
│ │ │ ├── MileClientMinFuncTest.java
│ │ │ ├── MileClientMixFuncTest.java
│ │ │ ├── MileClientMultiCountDistinctTest.java
│ │ │ ├── MileClientRangeFuncTest.java
│ │ │ ├── MileClientRepeatFuncTest.java
│ │ │ └── MileClientSumFuncTest.java
│ │ ├── groupby
│ │ │ ├── MileClientComplexGroupbyTest.java
│ │ │ ├── MileClientComplexHavingTest.java
│ │ │ ├── MileClientSimpleGroupbyTest.java
│ │ │ └── MileClientSimpleHavingTest.java
│ │ ├── insert
│ │ │ ├── MileClientPreInsertCount.java
│ │ │ ├── MileClientPrepareInsertCountTest.java
│ │ │ └── MileClientPrepareInsertTest.java
│ │ ├── mix
│ │ │ ├── CTUpreCtuClusterCountQueryTest.java
│ │ │ ├── CTUtpreCtuClusterQueryTest.java
│ │ │ ├── MileClientpreCtuClusterCountQueryTest.java
│ │ │ └── MileClientpreCtuClusterQueryTest.java
│ │ ├── orderby
│ │ │ ├── MileClientAscOrderTest.java
│ │ │ ├── MileClientDescOrderTest.java
│ │ │ ├── MileClientDistinctOrderTest.java
│ │ │ ├── MileClientGroupOrderTest.java
│ │ │ ├── MileClientLimitOrderTest.java
│ │ │ └── MileClientMultiOrderTest.java
│ │ ├── select
│ │ │ ├── MileClientAllCountSelectTest.java
│ │ │ ├── MileClientBetweenSelectTest.java
│ │ │ ├── MileClientBigIntersectTest.java
│ │ │ ├── MileClientComplexSelectTest.java
│ │ │ ├── MileClientCtuSpecialSelectTest.java
│ │ │ ├── MileClientDistinctSelectTest.java
│ │ │ ├── MileClientDochintSelectTest.java
│ │ │ ├── MileClientIntersectTest.java
│ │ │ ├── MileClientLimitSelectTest.java
│ │ │ ├── MileClientSimpleSelectTest.java
│ │ │ ├── MileClientSubSelectTest.java
│ │ │ ├── MileClientTimeHintSelectTest.java
│ │ │ └── MileClientWhereSelectTest.java
│ │ ├── test
│ │ │ └── MileClientPreCTUTest.java
│ │ └── update
│ │ │ └── MileClientUpdateTest.java
│ │ └── test
│ │ ├── DocdbTestTools.java
│ │ ├── LevdbTestTools.java
│ │ ├── SR621000.java
│ │ ├── SR621010.java
│ │ ├── SR621020.java
│ │ ├── SR621030.java
│ │ ├── SR621040.java
│ │ ├── SR621050.java
│ │ ├── SR621060.java
│ │ ├── SR621070.java
│ │ ├── SR621080.java
│ │ ├── SR621090.java
│ │ ├── SR621100.java
│ │ ├── SR621110.java
│ │ ├── SR621120.java
│ │ ├── SR621130.java
│ │ ├── SR621140.java
│ │ ├── SR621150.java
│ │ ├── SR621160.java
│ │ ├── SR621170.java
│ │ ├── SR621180.java
│ │ ├── SR621190.java
│ │ ├── SR621200.java
│ │ ├── SR621210.java
│ │ ├── SR621220.java
│ │ ├── SR621230.java
│ │ ├── SR621240.java
│ │ ├── SR621250.java
│ │ ├── SR621260.java
│ │ ├── SR621270.java
│ │ ├── SR621280.java
│ │ ├── SR622000.java
│ │ ├── SR622010.java
│ │ ├── SR622020.java
│ │ ├── SR622030.java
│ │ ├── SR622040.java
│ │ ├── SR622050.java
│ │ ├── SR622060.java
│ │ ├── SR622070.java
│ │ ├── SR622080.java
│ │ ├── SR622090.java
│ │ ├── SR622100.java
│ │ ├── SR622110.java
│ │ ├── SR622120.java
│ │ ├── SR622130.java
│ │ ├── SR622140.java
│ │ ├── SR622150.java
│ │ ├── SR622160.java
│ │ ├── SR622170.java
│ │ ├── SR622180.java
│ │ ├── SR622190.java
│ │ ├── SR622200.java
│ │ ├── SR622210.java
│ │ ├── SR622220.java
│ │ ├── SuitTest.java
│ │ ├── test-readme
│ │ └── test_daily_index.sh
│ └── testreport.html
├── package.sh
└── third-party
├── commons-daemon-1.0.5.jar
└── commons-daemon-native
├── LICENSE.txt
├── NOTICE.txt
├── README
├── RELEASE-NOTES.txt
├── unix
├── CHANGES.txt
├── INSTALL.txt
├── Makedefs.in
├── Makefile.in
├── configure
├── configure.in
├── man
│ ├── README
│ ├── fetch.sh
│ └── jsvc.1.xml
├── native
│ ├── .indent.pro
│ ├── Makefile.in
│ ├── arguments.c
│ ├── arguments.h
│ ├── debug.c
│ ├── debug.h
│ ├── dso-dlfcn.c
│ ├── dso-dyld.c
│ ├── dso.h
│ ├── help.c
│ ├── help.h
│ ├── home.c
│ ├── home.h
│ ├── java.c
│ ├── java.h
│ ├── jsvc-unix.c
│ ├── jsvc.h
│ ├── location.c
│ ├── location.h
│ ├── locks.c
│ ├── locks.h
│ ├── replace.c
│ ├── replace.h
│ ├── signals.c
│ ├── signals.h
│ └── version.h
├── samples
│ ├── Tomcat5.sh
│ └── Tomcat7.sh
└── support
│ ├── apfunctions.m4
│ ├── apjava.m4
│ ├── apsupport.m4
│ ├── buildconf.sh
│ ├── config.guess
│ ├── config.sub
│ ├── install.sh
│ └── mkdist.sh
└── windows
├── README
├── README.dev
├── apps
├── prunmgr
│ ├── Makefile
│ ├── prunmgr.c
│ ├── prunmgr.h
│ ├── prunmgr.manifest
│ └── prunmgr.rc
└── prunsrv
│ ├── Makefile
│ ├── prunsrv.c
│ ├── prunsrv.h
│ └── prunsrv.rc
├── include
├── Makefile.inc
├── apxwin.h
├── cmdline.h
├── console.h
├── gui.h
├── handles.h
├── javajni.h
├── log.h
├── registry.h
├── rprocess.h
└── service.h
├── resources
├── commons.bmp
├── license.rtf
├── procrunr.ico
├── procruns.ico
├── procrunw.ico
└── susers.bmp
├── src
├── cmdline.c
├── console.c
├── gui.c
├── handles.c
├── javajni.c
├── log.c
├── mclib.c
├── mclib.h
├── private.h
├── registry.c
├── rprocess.c
├── service.c
└── utils.c
└── xdocs
└── index.xml
/config/doc_run.conf:
--------------------------------------------------------------------------------
1 | [section docserver]
2 | command=sbin/docserver
3 | config_file=etc/docserver.conf
4 | home=/home/admin/mile/data/storage
5 | port=18518
6 | log_file=/home/admin/logs/__HOST_NAME__/doc_run.log
7 |
--------------------------------------------------------------------------------
/config/docserver.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/config/docserver.conf
--------------------------------------------------------------------------------
/config/log4j.properties:
--------------------------------------------------------------------------------
1 | # Set root logger level to DEBUG and its only appender to CONSOLE.
2 | log4j.rootLogger=INFO, CONSOLE
3 |
4 | # CONSOLE
5 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
6 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
7 | log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n
8 |
9 | log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
10 | log4j.appender.FILE.File=/home/admin/log/mile.log
11 | log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
12 | log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n
13 |
14 | log4j.logger.java.sql=ERROR
15 | log4j.logger.com.ibatis=debug
16 | log4j.logger.org.nuxeo.runtime.test=debug
--------------------------------------------------------------------------------
/config/log4j.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/config/log4j.xml
--------------------------------------------------------------------------------
/config/mileCliClent.properties.prod:
--------------------------------------------------------------------------------
1 | mile.client.user.name = test
2 | mile.client.user.password =test
3 | mile.client.boss.executor.thread.count=0
4 | mile.client.worker.executor.thread.count=0
5 | mile.client.execsql.timeout = 3000
6 | mile.client.merg.server = 127.0.0.1:8964
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/config/servers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1
6 |
7 | 127.0.0.1
8 | 18518
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/config/sharding.cfg:
--------------------------------------------------------------------------------
1 | # mile sharding config
2 | # table field data_type sharding_type value node_list
3 | # data_type: byte, short, int, longlong, float, double, string
4 | #
5 | # table1
6 | table1 col1 string 3:-3,-2 10 1:2,3:4,5:6,7:8,9:10,11:12,13:14,15:16,17:18,19:20
7 | #
8 |
--------------------------------------------------------------------------------
/config/test_daily_index.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | source /etc/profile
5 |
6 | export LC_ALL=C
7 | set -e
8 |
9 | home_dir=$(dirname $(dirname $(readlink -f $0)))
10 |
11 | echo Change to $home_dir directory.
12 | cd $home_dir
13 |
14 |
15 | ## index
16 |
17 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY TEST_ID 2 254"
18 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY TEST_IP 2 254"
19 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY TEST_NAME 2 254"
20 |
21 |
22 |
23 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY TEST_ID 3 254"
24 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY GMT_TEST 3 10"
25 | ./sbin/client -c 127.0.0.1:18518 -l "ensure_index TEST_DAILY 11 3 254"
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docserver/cmockery-0.1.2/AUTHORS:
--------------------------------------------------------------------------------
1 | opensource@google.com
2 |
3 |
--------------------------------------------------------------------------------
/docserver/cmockery-0.1.2/ChangeLog:
--------------------------------------------------------------------------------
1 | Mon Sep 15 17:21:22 2008 Google Inc.
2 | * cmockery: version 0.12
3 | * Made it possible to specify additional compiler, lib tool and link
4 | flags on Windows.
5 | * Added Windows makefile to the tar ball.
6 |
7 | Fri Aug 29 10:50:46 2008 Google Inc.
8 |
9 | * cmockery: version 0.11
10 | * Made it possible to specify executable, library and object output
11 | directories.
12 |
13 | Tue Aug 26 10:18:02 2008 Google Inc.
14 |
15 | * cmockery: initial release:
16 | A lightweight library to simplify and generalize the process of
17 | writing unit tests for C applications.
18 |
--------------------------------------------------------------------------------
/docserver/cmockery-0.1.2/NEWS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/cmockery-0.1.2/NEWS
--------------------------------------------------------------------------------
/docserver/cmockery-0.1.2/m4/namespaces.m4:
--------------------------------------------------------------------------------
1 | # Checks whether the compiler implements namespaces
2 | AC_DEFUN([AC_CXX_NAMESPACES],
3 | [AC_CACHE_CHECK(whether the compiler implements namespaces,
4 | ac_cv_cxx_namespaces,
5 | [AC_LANG_SAVE
6 | AC_LANG_CPLUSPLUS
7 | AC_TRY_COMPILE([namespace Outer {
8 | namespace Inner { int i = 0; }}],
9 | [using namespace Outer::Inner; return i;],
10 | ac_cv_cxx_namespaces=yes,
11 | ac_cv_cxx_namespaces=no)
12 | AC_LANG_RESTORE])
13 | if test "$ac_cv_cxx_namespaces" = yes; then
14 | AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces])
15 | fi])
16 |
--------------------------------------------------------------------------------
/docserver/gtest-1.5.0/xcode/Config/FrameworkTarget.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // FrameworkTarget.xcconfig
3 | //
4 | // These are Framework target settings for the gtest framework and examples. It
5 | // is set in the "Based On:" dropdown in the "Target" info dialog.
6 | // This file is based on the Xcode Configuration files in:
7 | // http://code.google.com/p/google-toolbox-for-mac/
8 | //
9 |
10 | // Dynamic libs need to be position independent
11 | GCC_DYNAMIC_NO_PIC = NO
12 |
13 | // Dynamic libs should not have their external symbols stripped.
14 | STRIP_STYLE = non-global
15 |
16 | // Let the user install by specifying the $DSTROOT with xcodebuild
17 | SKIP_INSTALL = NO
18 |
--------------------------------------------------------------------------------
/docserver/gtest-1.5.0/xcode/Config/StaticLibraryTarget.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // StaticLibraryTarget.xcconfig
3 | //
4 | // These are static library target settings for libgtest.a. It
5 | // is set in the "Based On:" dropdown in the "Target" info dialog.
6 | // This file is based on the Xcode Configuration files in:
7 | // http://code.google.com/p/google-toolbox-for-mac/
8 | //
9 |
10 | // Static libs can be included in bundles so make them position independent
11 | GCC_DYNAMIC_NO_PIC = NO
12 |
13 | // Static libs should not have their internal globals or external symbols
14 | // stripped.
15 | STRIP_STYLE = debugging
16 |
17 | // Let the user install by specifying the $DSTROOT with xcodebuild
18 | SKIP_INSTALL = NO
19 |
--------------------------------------------------------------------------------
/docserver/gtest-1.5.0/xcode/Config/TestTarget.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // TestTarget.xcconfig
3 | //
4 | // These are Test target settings for the gtest framework and examples. It
5 | // is set in the "Based On:" dropdown in the "Target" info dialog.
6 |
7 | PRODUCT_NAME = $(TARGET_NAME)
8 | HEADER_SEARCH_PATHS = ../include
9 |
--------------------------------------------------------------------------------
/docserver/indexengine/COPYRIGHT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/COPYRIGHT
--------------------------------------------------------------------------------
/docserver/indexengine/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-16
4 |
5 | # load config
6 | TOP_DIR = .
7 | include MK.config
8 |
9 | .PHONY : all clean test
10 |
11 | all :
12 | make -C src
13 |
14 | test :
15 | make -C tests
16 |
17 | clean :
18 | make -C src clean
19 | make -C tests clean
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/README:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/README
--------------------------------------------------------------------------------
/docserver/indexengine/VERSION:
--------------------------------------------------------------------------------
1 | MAJOR_VER = 0
2 | MINOR_VER = 1
3 |
--------------------------------------------------------------------------------
/docserver/indexengine/etc/doc_run.conf:
--------------------------------------------------------------------------------
1 | [section docserver]
2 | command=sbin/docserver
3 | config_file=etc/docserver.conf
4 | home=/tmp/storage
5 | port=8888
6 | log_file=/tmp/storage/doc_run.log
7 |
--------------------------------------------------------------------------------
/docserver/indexengine/etc/docserver.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/etc/docserver.conf
--------------------------------------------------------------------------------
/docserver/indexengine/integration_tests/multi_docserver_test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash base_test.sh
2 |
3 | # Test mutliple docservers on a host.
4 |
5 | set_up_before_start()
6 | (
7 | :
8 | )
9 |
10 | set_up_after_start()
11 | {
12 | local home=$1
13 | common_ensure_index
14 | }
15 |
16 | test_main()
17 | {
18 | for d in $MILEA $MILEB ; do
19 | (
20 | msg insert into $d ...
21 | cd $d
22 | for i in {1..15} ; do
23 | sql "insert -s insert into table1 id='a' value='$d.$i'"
24 | done
25 | )
26 | done
27 |
28 | for d in $MILEA $MILEB ; do
29 | (
30 | cd $d
31 | msg query from $d
32 | sql "query -s select id, value from table1 indexwhere id = 'a'"
33 | )
34 | done
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/docserver/indexengine/integration_tests/multi_storage_test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash base_test.sh
2 |
3 | # Test mutliple storage
4 |
5 | set_up_before_start()
6 | (
7 | add_docserver_conf '[server]'
8 | add_docserver_conf 'work_space = tmp/storage1;tmp/storage2'
9 | )
10 |
11 | set_up_after_start()
12 | {
13 | local home=$1
14 | common_ensure_index
15 | }
16 |
17 | test_main()
18 | {
19 | cd $MILEA
20 |
21 | msg insert 25 records
22 | for i in {1..25} ; do
23 | sql "insert -s insert into table1 id='a' value='$i'"
24 | done
25 |
26 | msg select all records
27 | sql "query -s select id, value from table1 indexwhere id = 'a'"
28 |
29 | msg show segments:
30 | client stat table1 1
31 |
32 | msg
33 | msg show dirs:
34 | ls -l tmp/storage1/table1
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/docserver/indexengine/lib/32/libevent.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/lib/32/libevent.a
--------------------------------------------------------------------------------
/docserver/indexengine/lib/64/libevent.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/lib/64/libevent.a
--------------------------------------------------------------------------------
/docserver/indexengine/scripts/monitor_index.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # load java environment configure.
4 | source /etc/profile
5 |
6 | export LC_ALL=C
7 | set -e
8 |
9 | home_dir=$(dirname $(dirname $(readlink -f $0)))
10 |
11 | echo Change to $home_dir directory.
12 | cd $home_dir
13 |
14 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor field1 2 254"
15 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor field2 3 254"
16 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor field3 3 254"
17 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor field4 3 254"
18 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor time 3 10"
19 | ./sbin/client -c 127.0.0.1:8888 -l "ensure_index monitor value 3 7"
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/scripts/seg_receive.conf:
--------------------------------------------------------------------------------
1 | # Config file for seg_receive.sh
2 | # This config is load by bash's source command.
3 |
4 | STORAGE_DIR=( /disk{1..5}/mile_data/storage )
5 | BACKUP_DIR=( /disk{6..10}/mile_backup/ )
6 |
7 | # vim: syntax=sh
8 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/client.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/client.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/AggrFunc.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/AggrFunc.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/Clonable.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Clonable.h
3 | *
4 | * Created on: 2012-8-23
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef CLONABLE_H_
9 | #define CLONABLE_H_
10 |
11 | class Clonable {
12 | public:
13 | virtual ~Clonable() {};
14 | virtual void* Clone(void* data) = 0;
15 | };
16 |
17 | #endif /* CLONABLE_H_ */
18 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/Comparator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Comparator.h
3 | *
4 | * Created on: 2012-8-16
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef COMPARATOR_H_
9 | #define COMPARATOR_H_
10 |
11 | class Comparator {
12 | public:
13 | virtual ~Comparator() {};
14 | //if a < b, return -1; if a = b, return 0; if a > b, return 1
15 | virtual int Compare(void* a, void* b) = 0;
16 | };
17 |
18 | #endif /* COMPARATOR_H_ */
19 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/Equals.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Equals.h
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef EQUALS_H_
9 | #define EQUALS_H_
10 |
11 | class Equals {
12 | public:
13 | virtual ~Equals() {};
14 | //if a = b, return 1; else return 0
15 | virtual int IsEqual(void* a, void* b) = 0;
16 | };
17 |
18 | #endif /* EQUALS_H_ */
19 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/HashCoding.h:
--------------------------------------------------------------------------------
1 | /*
2 | * HashCoding.h
3 | *
4 | * Created on: 2012-8-21
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef HASHCODING_H_
9 | #define HASHCODING_H_
10 |
11 | #include "def.h"
12 |
13 |
14 | class HashCoding {
15 | public:
16 | virtual ~HashCoding() {};
17 | virtual uint32_t Coding(void* value) = 0;
18 | };
19 |
20 | #endif /* HASHCODING_H_ */
21 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/HashSet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/HashSet.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/LDEquals.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * LDEquals.cpp
3 | *
4 | * Created on: 2012-8-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "LDEquals.h"
9 |
10 | LDEquals::LDEquals() {
11 | // TODO Auto-generated constructor stub
12 |
13 | }
14 |
15 | LDEquals::~LDEquals() {
16 | // TODO Auto-generated destructor stub
17 | }
18 |
19 |
20 |
21 |
22 | int LDEquals::IsEqual(void* a, void* b){
23 | return is_ld_equal((struct low_data_struct*)a, (struct low_data_struct*)b);
24 | }
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/LDEquals.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LDEquals.h
3 | *
4 | * Created on: 2012-8-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef LDEQUALS_H_
9 | #define LDEQUALS_H_
10 |
11 | #include "Equals.h"
12 | #include "def.h"
13 | #include "common_util.h"
14 |
15 | class LDEquals: public Equals {
16 | public:
17 | LDEquals();
18 | virtual ~LDEquals();
19 | virtual int IsEqual(void* a, void* b);
20 | };
21 |
22 | #endif /* LDEQUALS_H_ */
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/LDHash.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * LDHash.cpp
3 | *
4 | * Created on: 2012-8-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "LDHash.h"
9 |
10 | LDHash::LDHash() {
11 | // TODO Auto-generated constructor stub
12 |
13 | }
14 |
15 | LDHash::~LDHash() {
16 | // TODO Auto-generated destructor stub
17 | }
18 |
19 |
20 |
21 | uint32_t LDHash::Coding(void* value) {
22 | uint32_t i;
23 | uint8_t* p;
24 | struct low_data_struct* ld = (struct low_data_struct*) value;
25 | uint32_t hash = 1315423911;
26 |
27 | p = (uint8_t*) ld->data;
28 | for (i = 0; i < ld->len; i++) {
29 | hash ^= ((hash << 5) + (*p++) + (hash >> 2));
30 | }
31 |
32 | return (hash & 0x7FFFFFFF);
33 | }
34 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/LDHash.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LDHash.h
3 | *
4 | * Created on: 2012-8-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef LDHASH_H_
9 | #define LDHASH_H_
10 |
11 | #include "HashCoding.h"
12 |
13 | class LDHash: public HashCoding {
14 | public:
15 | LDHash();
16 | virtual ~LDHash();
17 | virtual uint32_t Coding(void* value);
18 | };
19 |
20 | #endif /* LDHASH_H_ */
21 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-13
4 |
5 | # load make config
6 | TOP_DIR = ../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = libcommon.a
10 |
11 | # CXXFLAGS += $(shell xml2-config --cflags)
12 |
13 | all: $(TARGETS)
14 |
15 | $(TARGETS) : $(OBJS)
16 | $(AR) cr $@ $^
17 |
18 | clean :
19 | @rm -f $(TARGETS) $(OBJS)
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/MileHashMap.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/MileHashMap.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/MileIterator.cpp:
--------------------------------------------------------------------------------
1 | // MileIterator.cpp : MileIterator
2 | // Author: liubin
3 | // Created: 2012-08-28
4 |
5 | #include "MileIterator.h"
6 |
7 | MileIterator::~MileIterator() {}
8 |
9 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/MileIterator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * mile_iterator.h
3 | *
4 | * Created on: 2012-7-31
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef MILE_ITERATOR_H_
9 | #define MILE_ITERATOR_H_
10 |
11 | #include "def.h"
12 | #include "list.h"
13 | #include "mem.h"
14 | #include
15 |
16 | class TableManager;
17 |
18 | class MileIterator{
19 | public:
20 | MileIterator() {};
21 |
22 | virtual ~MileIterator() = 0;
23 |
24 | virtual void First() = 0;
25 |
26 | virtual void Next() = 0;
27 |
28 | virtual int8_t IsDone() = 0;
29 |
30 | virtual void* CurrentItem() = 0;
31 |
32 | };
33 |
34 | #endif /* MILE_ITERATOR_H_ */
35 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/ResultSet.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultSet.h
3 | *
4 | * Created on: 2012-8-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef RESULTSET_H_
9 | #define RESULTSET_H_
10 |
11 | #include "def.h"
12 | #include "list.h"
13 | #include "MileIterator.h"
14 |
15 |
16 | class ResultSet {
17 | public:
18 | virtual ~ResultSet() {};
19 | virtual int32_t AddResult(void* data) = 0;
20 | virtual MileIterator* CreateIterator() = 0;
21 | virtual uint32_t Size() = 0;
22 | };
23 |
24 | #endif /* RESULTSET_H_ */
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/common_util.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/common_util.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/common_util.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/common_util.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/def.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/def.cc
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/def.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/def.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/file_op.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/file_op.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/file_op.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/file_op.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/hash.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/hash.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/hash.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/hash.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/log.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/log.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/log.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/log.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/mem.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/mem.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/mem.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/mem.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/profiles.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/profiles.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/profiles.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/profiles.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/stat_collect.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/common/stat_collect.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/test/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2012-05-25
4 | # load make config
5 |
6 | TOP_DIR = ../../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = $(foreach src, $(SRCS), $(basename $(src)) )
10 |
11 | LDFLAGS += -L .. -lcommon -lgtest -lpthread -rdynamic
12 |
13 | all : $(TARGETS)
14 |
15 | $(TARGETS) : % : %.o
16 | $(CXX) -o $@ $< $(LDFLAGS)
17 |
18 | clean :
19 | -rm $(TARGETS) *.o
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/common/test/stat_collect_test.cpp:
--------------------------------------------------------------------------------
1 | // stat_collect_test.cpp : stat_collect_test
2 | // Author: liubin
3 | // Created: 2012-05-25
4 |
5 | #include
6 | // #include
7 |
8 | #include "../stat_collect.h"
9 | #include "../mem.h"
10 |
11 | TEST(stat_collect, dump_and_reset)
12 | {
13 | stat_collect_init(1000);
14 |
15 | /* g++ 4.6 or higher
16 | std::thread t(
17 | []{
18 | while (true)
19 | {
20 | usleep(1300000);
21 | sc_record_value(STAT_ITEM_INDEX_VALUE, 1);
22 | }
23 | });
24 | */
25 |
26 | while (true) {
27 | usleep(5);
28 | sc_record_value(random() % 2 ? STAT_ITEM_INSERT : STAT_ITEM_UPDATE, random());
29 | }
30 | }
31 |
32 | int main(int argc, char **argv) {
33 | ::testing::InitGoogleTest(&argc, argv);
34 | return RUN_ALL_TESTS();
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/data_import.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/data_import.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/CommonRS.h:
--------------------------------------------------------------------------------
1 | /*
2 | * CommonRS.h
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef COMMONRS_H_
9 | #define COMMONRS_H_
10 |
11 | #include "../common/ResultSet.h"
12 | #include "../common/MileArray.h"
13 | #include "../common/Clonable.h"
14 |
15 | class CommonRS: public ResultSet {
16 | private:
17 | uint32_t limit;
18 | MileArray* array;
19 | Clonable* clone;
20 | MEM_POOL_PTR mem_pool;
21 | public:
22 | CommonRS(uint32_t limit, Clonable* clone, MEM_POOL_PTR mem_pool);
23 | ~CommonRS();
24 | virtual int32_t AddResult(void* data);
25 | virtual MileIterator* CreateIterator();
26 | virtual uint32_t Size();
27 | };
28 |
29 | #endif /* COMMONRS_H_ */
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/CountAllStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * CountAllStep.h
3 | *
4 | * Created on: 2012-10-29
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef COUNTALLSTEP_H_
9 | #define COUNTALLSTEP_H_
10 |
11 | #include "CommonRS.h"
12 | #include "ExecuteStep.h"
13 | #include "RowClone.h"
14 |
15 |
16 | class CountAllStep: public ExecuteStep {
17 | private:
18 | char* field_name;
19 | public:
20 | CountAllStep(char* field_name);
21 | virtual ~CountAllStep();
22 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool);
23 | };
24 |
25 | #endif /* COUNTALLSTEP_H_ */
26 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/CumulativeQueryStep.h:
--------------------------------------------------------------------------------
1 | // CumulativeQueryStep.h : CumulativeQueryStep
2 | // Author: liubin
3 | // Created: 2012-10-11
4 |
5 | #ifndef CUMULATIVEQUERYSTEP_H
6 | #define CUMULATIVEQUERYSTEP_H
7 |
8 | #include "ExecuteStep.h"
9 |
10 | struct select_field_array;
11 | struct condition_array;
12 |
13 | class CumulativeQueryStep : public ExecuteStep
14 | {
15 | public :
16 | CumulativeQueryStep(select_field_array *sel, condition_array *cond)
17 | : select_field_(sel), cond_(cond) {}
18 |
19 | virtual ~CumulativeQueryStep() {};
20 |
21 | virtual void *Execute(TableManager *table, void *input, int32_t &result_code,
22 | int64_t timeout, MEM_POOL_PTR mem_pool);
23 |
24 | private:
25 | select_field_array *select_field_;
26 | condition_array *cond_;
27 | };
28 |
29 | #endif // CUMULATIVEQUERYSTEP_H
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/CumulativeRS.h:
--------------------------------------------------------------------------------
1 | // CumulativeRS.h : CumulativeRS
2 | // Author: liubin
3 | // Created: 2012-10-11
4 |
5 | #ifndef CUMULATIVERS_H
6 | #define CUMULATIVERS_H
7 |
8 | #include "../common/mem.h"
9 | #include "../common/ResultSet.h"
10 | #include "../common/MileList.h"
11 |
12 | struct select_row_t;
13 |
14 | class CumulativeRS : public ResultSet {
15 | public:
16 | CumulativeRS(MEM_POOL_PTR mem) : result_(mem) {}
17 | virtual ~CumulativeRS() {};
18 |
19 | // Must only be called once.
20 | virtual int32_t AddResult(void *data) { result_.Add(data); return MILE_RETURN_SUCCESS; }
21 |
22 | virtual uint32_t Size() { return result_.IsEmpty() ? 0 : 1; }
23 |
24 | virtual MileIterator *CreateIterator() { return result_.CreateIterator(); };
25 |
26 | private:
27 | MileList result_;
28 | };
29 |
30 | #endif // CUMULATIVERS_H
31 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/DeleteSubstep.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * DeleteSubstep.cpp
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "DeleteSubstep.h"
9 |
10 |
11 |
12 | DeleteSubstep::DeleteSubstep(){
13 |
14 | }
15 |
16 |
17 | DeleteSubstep::~DeleteSubstep(){
18 |
19 | }
20 |
21 |
22 |
23 | int32_t DeleteSubstep::Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool){
24 | uint32_t* del_num = (uint32_t*)output;
25 | int32_t result_code = table->DeleteRow(handler, mem_pool);
26 | if(result_code == MILE_RETURN_SUCCESS){
27 | (*del_num)++;
28 | }
29 | return result_code;
30 | }
31 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/DeleteSubstep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DeleteSubstep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef DELETESUBSTEP_H_
9 | #define DELETESUBSTEP_H_
10 |
11 | #include "ExecuteSubstep.h"
12 |
13 | class DeleteSubstep: public ExecuteSubstep {
14 | public:
15 | DeleteSubstep();
16 | ~DeleteSubstep();
17 | virtual int32_t Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool);
18 |
19 | };
20 |
21 | #endif /* DELETESUBSTEP_H_ */
22 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/DistinctRS.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DistinctRS.h
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef DISTINCTRS_H_
9 | #define DISTINCTRS_H_
10 |
11 | #include "../common/ResultSet.h"
12 | #include "../common/HashSet.h"
13 | #include "../common/HashCoding.h"
14 | #include "../common/Equals.h"
15 | #include "../common/Clonable.h"
16 |
17 | class DistinctRS: public ResultSet {
18 | private:
19 | uint32_t limit;
20 | uint32_t num;
21 | Clonable* clone;
22 | HashSet* set;
23 | MEM_POOL_PTR mem_pool;
24 | public:
25 | DistinctRS(Equals* equals, HashCoding* hash, Clonable* clone, uint32_t limit, MEM_POOL_PTR mem_pool);
26 | ~DistinctRS();
27 | virtual int32_t AddResult(void* data);
28 | virtual MileIterator* CreateIterator();
29 | virtual uint32_t Size();
30 | };
31 |
32 | #endif /* DISTINCTRS_H_ */
33 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/ExecutePlan.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ExecutePlan.h
3 | *
4 | * Created on: 2012-8-25
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef EXECUTEPLAN_H_
9 | #define EXECUTEPLAN_H_
10 |
11 | #include "../common/MileList.h"
12 | #include "../storage/TableManager.h"
13 | #include "ExecuteStep.h"
14 |
15 |
16 | class ExecutePlan {
17 | private:
18 | MileList* steps;
19 | TableManager* table;
20 | MEM_POOL_PTR mem_pool;
21 | public:
22 | ExecutePlan(TableManager* table, MEM_POOL_PTR mem_pool);
23 | ~ExecutePlan();
24 | void* Execute(int32_t &result_code, int64_t timeout);
25 | void AddExecuteStep(ExecuteStep* step);
26 | };
27 |
28 | #endif /* EXECUTEPLAN_H_ */
29 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/ExecuteStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ExecuteStep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef EXECUTESTEP_H_
9 | #define EXECUTESTEP_H_
10 |
11 | #include "../storage/StorageEngine.h"
12 | #include "../storage/TableManager.h"
13 |
14 |
15 | class ExecuteStep {
16 | public:
17 | virtual ~ExecuteStep() {};
18 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool) = 0;
19 | };
20 |
21 | #endif /* EXECUTESTEP_H_ */
22 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/ExecuteSubstep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ExecuteSubstep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef EXECUTESUBSTEP_H_
9 | #define EXECUTESUBSTEP_H_
10 |
11 | #include "../common/list.h"
12 | #include "../common/def.h"
13 | #include "../storage/StorageEngine.h"
14 | #include "../storage/TableManager.h"
15 |
16 | #ifndef NULL
17 | #define NULL ((void *)0)
18 | #endif
19 |
20 | class ExecuteSubstep {
21 | public:
22 | virtual ~ExecuteSubstep() {};
23 | /**
24 | * return value: <0 indicate error, 0 indicate success, >0 indicate continue
25 | */
26 | virtual int32_t Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool) = 0;
27 | };
28 |
29 | #endif /* EXECUTESUBSTEP_H_ */
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/ExportSubstep.h:
--------------------------------------------------------------------------------
1 | // ExportSubstep.h : ExportSubstep
2 | // Author: liubin
3 | // Created: 2012-10-30
4 |
5 | #ifndef EXPORTSUBSTEP_H
6 | #define EXPORTSUBSTEP_H
7 |
8 | #include "ExecuteSubstep.h"
9 |
10 | #include
11 |
12 | class ExportSubstep : public ExecuteSubstep {
13 | public:
14 | ExportSubstep(char *table, char *path, int64_t limit);
15 | ~ExportSubstep();
16 |
17 | int Init(void);
18 | virtual int32_t Execute(TableManager *table, MileHandler *handler, void *output, MEM_POOL_PTR mem_pool);
19 |
20 | private:
21 | char *table_name_;
22 | char *path_;
23 | int fd_;
24 | int64_t limit_;
25 |
26 | std::string out_buf_;
27 | };
28 |
29 | #endif // EXPORTSUBSTEP_H
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/Expression.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/execute/Expression.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/Expression.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Expression.h
3 | *
4 | * Created on: 2012-8-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef EXPRESSION_H_
9 | #define EXPRESSION_H_
10 |
11 | #include "../protocol/packet.h"
12 | #include "../common/hash.h"
13 |
14 |
15 | class Expression {
16 | private:
17 | struct condition_t* cond;
18 | public:
19 | Expression* left;
20 | Expression* right;
21 | struct select_fields_t* exp_fields;
22 | Expression(struct condition_t* cond);
23 | virtual ~Expression();
24 | static Expression* GenExp(struct condition_array* cond_array, MEM_POOL_PTR mem_pool);
25 | int32_t Execute(struct select_row_t* row);
26 | };
27 |
28 | #endif /* EXPRESSION_H_ */
29 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/FilterSubstep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * FilterSubstep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef FILTERSUBSTEP_H_
9 | #define FILTERSUBSTEP_H_
10 |
11 | #include "ExecuteSubstep.h"
12 | #include "../protocol/packet.h"
13 | #include "Expression.h"
14 |
15 |
16 |
17 | class FilterSubstep: public ExecuteSubstep {
18 | private:
19 | Expression* exp;
20 | int32_t CompareValue(struct low_data_struct* value, struct condition_t *cond);
21 | public:
22 | struct select_fields_t* sel_fields;
23 | FilterSubstep(struct condition_array* cond_array, MEM_POOL_PTR mem_pool);
24 | ~FilterSubstep();
25 | virtual int32_t Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool);
26 | };
27 |
28 | #endif /* FILTERSUBSTEP_H_ */
29 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/IndexStep.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * IndexStep.cpp
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "IndexStep.h"
9 |
10 | IndexStep::IndexStep(struct condition_array* cond, struct hint_array* hint){
11 | this->cond = cond;
12 | this->hint = hint;
13 | this->iter = NULL;
14 | }
15 |
16 |
17 | IndexStep::~IndexStep(){
18 | if(NULL != iter){
19 | iter->~MileIterator();
20 | }
21 | }
22 |
23 |
24 |
25 | void* IndexStep::Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool){
26 | struct index_condition* index_cond = (struct index_condition*)input;
27 |
28 | iter = table->UseIndex(cond, hint, mem_pool);
29 | if(NULL == iter){
30 | result_code = ERROR_INDEX_QUERY;
31 | }else{
32 | result_code = MILE_RETURN_SUCCESS;
33 | }
34 | return iter;
35 | }
36 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/IndexStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * IndexStep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef INDEXSTEP_H_
9 | #define INDEXSTEP_H_
10 |
11 | #include "ExecuteStep.h"
12 | #include "../protocol/packet.h"
13 |
14 | class IndexStep: public ExecuteStep {
15 | private:
16 | struct condition_array* cond;
17 | struct hint_array* hint;
18 | MileIterator* iter;
19 | public:
20 | IndexStep(struct condition_array* cond, struct hint_array* hint);
21 | ~IndexStep();
22 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool);
23 | };
24 |
25 | #endif /* INDEXSTEP_H_ */
26 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/InsertStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * InsertStep.h
3 | *
4 | * Created on: 2012-8-25
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef INSERTSTEP_H_
9 | #define INSERTSTEP_H_
10 |
11 | #include "ExecuteStep.h"
12 |
13 | class InsertStep: public ExecuteStep {
14 | private:
15 | struct row_data* row;
16 | public:
17 | InsertStep(uint32_t n, struct low_data_struct* data, MEM_POOL_PTR mem_pool);
18 | ~InsertStep();
19 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool);
20 | };
21 |
22 | #endif /* INSERTSTEP_H_ */
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/MainStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MainStep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef MAINSTEP_H_
9 | #define MAINSTEP_H_
10 |
11 | #include "ExecuteStep.h"
12 | #include "ExecuteSubstep.h"
13 | #include "../common/MileList.h"
14 | #include "../storage/TableManager.h"
15 |
16 | class MainStep: public ExecuteStep {
17 | private:
18 | void* result;
19 | MileList* substeps;
20 | public:
21 | MainStep(void* output, MEM_POOL_PTR mem_pool);
22 | ~MainStep();
23 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool);
24 | void AddSubstep(ExecuteSubstep* substep);
25 | };
26 |
27 | #endif /* MAINSTEP_H_ */
28 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-13
4 |
5 | # load make config
6 | TOP_DIR = ../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = libexecute.a
10 |
11 | all: $(TARGETS)
12 |
13 | $(TARGETS) : $(OBJS)
14 | $(AR) cr $@ $^
15 |
16 | clean :
17 | @rm -f $(TARGETS) $(OBJS)
18 |
19 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/OrderComparator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OrderComparator.h
3 | *
4 | * Created on: 2012-8-16
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef ORDERCOMPARATOR_H_
9 | #define ORDERCOMPARATOR_H_
10 |
11 | #include "../common/Comparator.h"
12 | #include "../common/def.h"
13 | #include "../common/common_util.h"
14 | #include "../protocol/packet.h"
15 |
16 | class OrderComparator: public Comparator {
17 | private:
18 | uint32_t n;
19 | uint32_t* ord_index;
20 | enum order_types* ord_type;
21 | public:
22 | OrderComparator(struct select_field_array* select_field,
23 | struct order_field_array* order_array, MEM_POOL_PTR mem_pool);
24 | ~OrderComparator();
25 | virtual int Compare(void* a, void* b);
26 | };
27 |
28 | #endif /* ORDERCOMPARATOR_H_ */
29 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/OrderedRS.h:
--------------------------------------------------------------------------------
1 | /*
2 | * OrderedRS.h
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef ORDEREDRS_H_
9 | #define ORDEREDRS_H_
10 |
11 | #include "../common/ResultSet.h"
12 | #include "../common/MileArray.h"
13 | #include "../common/Clonable.h"
14 | #include "../common/Comparator.h"
15 |
16 | class OrderedRS: public ResultSet {
17 | private:
18 | uint32_t limit;
19 | Comparator* comp;
20 | Clonable* clone;
21 | MileArray* array;
22 | int8_t heaped;
23 | MEM_POOL_PTR mem_pool;
24 | public:
25 | OrderedRS(Comparator* comp, Clonable* clone, uint32_t limit, MEM_POOL_PTR mem_pool);
26 | ~OrderedRS();
27 | virtual int32_t AddResult(void* data);
28 | virtual MileIterator* CreateIterator();
29 | virtual uint32_t Size();
30 | };
31 |
32 | #endif /* ORDEREDRS_H_ */
33 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RefillStep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RefillStep.h
3 | *
4 | * Created on: 2012-8-25
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef REFILLSTEP_H_
9 | #define REFILLSTEP_H_
10 |
11 | #include "ExecuteStep.h"
12 | #include "../common/ResultSet.h"
13 | #include "../protocol/packet.h"
14 |
15 | class RefillStep: public ExecuteStep {
16 | private:
17 | uint32_t n;
18 | char** fields;
19 | public:
20 | RefillStep(struct select_field_array* select_field, MEM_POOL_PTR mem_pool);
21 | ~RefillStep();
22 | virtual void* Execute(TableManager* table, void* input, int32_t &result_code, int64_t timeout, MEM_POOL_PTR mem_pool);
23 | };
24 |
25 | #endif /* REFILLSTEP_H_ */
26 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RowClone.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RowClone.h
3 | *
4 | * Created on: 2012-8-23
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef ROWCLONE_H_
9 | #define ROWCLONE_H_
10 |
11 | #include "../common/Clonable.h"
12 | #include "../common/def.h"
13 | #include "../common/common_util.h"
14 |
15 |
16 | class RowClone: public Clonable {
17 | private:
18 | MEM_POOL_PTR mem_pool;
19 | public:
20 | RowClone(MEM_POOL_PTR mem_pool);
21 | ~RowClone();
22 | virtual void* Clone(void* data);
23 | };
24 |
25 | #endif /* ROWCLONE_H_ */
26 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RowEquals.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * RowEquals.cpp
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "RowEquals.h"
9 |
10 |
11 |
12 |
13 | RowEquals::RowEquals(){
14 |
15 | }
16 |
17 |
18 | RowEquals::~RowEquals(){
19 |
20 | }
21 |
22 |
23 | int RowEquals::IsEqual(void* a, void* b){
24 | uint32_t i;
25 | struct select_row_t* rowa = (struct select_row_t*) a;
26 | struct select_row_t* rowb = (struct select_row_t*) b;
27 |
28 | if(rowa->n != rowb->n){
29 | return 0;
30 | }
31 |
32 | for(i = 0; i < rowa->n; i++){
33 | if(!is_ld_equal(&rowa->data[i], &rowb->data[i])){
34 | return 0;
35 | }
36 | }
37 |
38 | return 1;
39 | }
40 |
41 |
42 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RowEquals.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RowEquals.h
3 | *
4 | * Created on: 2012-8-17
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef ROWEQUALS_H_
9 | #define ROWEQUALS_H_
10 |
11 | #include "../common/Equals.h"
12 | #include "../common/def.h"
13 | #include "../common/common_util.h"
14 |
15 |
16 | class RowEquals: public Equals {
17 | public:
18 | RowEquals();
19 | ~RowEquals();
20 | virtual int IsEqual(void* a, void* b);
21 | };
22 |
23 | #endif /* ROWEQUALS_H_ */
24 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RowHash.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * RowHash.cpp
3 | *
4 | * Created on: 2012-8-23
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "RowHash.h"
9 |
10 |
11 |
12 | RowHash::RowHash(){
13 |
14 | }
15 |
16 |
17 |
18 | RowHash::~RowHash(){
19 |
20 | }
21 |
22 |
23 |
24 | uint32_t RowHash::Coding(void* value){
25 | uint32_t i, j;
26 | uint8_t* p;
27 | struct select_row_t* row = (struct select_row_t*) value;
28 | uint32_t hash = 1315423911;
29 |
30 | for(i = 0; i < row->n; i++)
31 | {
32 | p = (uint8_t*) row->data[i].data;
33 | for(j = 0; j < row->data[i].len; j++)
34 | {
35 | hash ^= ((hash<<5) + (*p++) + (hash>>2));
36 | }
37 | }
38 |
39 | return (hash & 0x7FFFFFFF);
40 | }
41 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/RowHash.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RowHash.h
3 | *
4 | * Created on: 2012-8-23
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef ROWHASH_H_
9 | #define ROWHASH_H_
10 |
11 | #include "../common/HashCoding.h"
12 | #include "../common/mem.h"
13 | #include "../common/def.h"
14 |
15 | class RowHash: public HashCoding {
16 | public:
17 | RowHash();
18 | ~RowHash();
19 | uint32_t Coding(void* value);
20 | };
21 |
22 | #endif /* ROWHASH_H_ */
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/SelectSubstep.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectSubstep.cpp
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "SelectSubstep.h"
9 |
10 | SelectSubstep::SelectSubstep(struct select_fields_t* sel_fields){
11 | this->sel_fields = sel_fields;
12 | }
13 |
14 |
15 |
16 | SelectSubstep::~SelectSubstep(){
17 |
18 | }
19 |
20 |
21 |
22 | int32_t SelectSubstep::Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool){
23 | ResultSet* result = (ResultSet*) output;
24 | struct select_row_t* row;
25 | row = table->QueryRow(handler, sel_fields, mem_pool);
26 | if(NULL == row){
27 | return ERROR_QUERY_BY_ROWID;
28 | }else{
29 | row->handler = handler;
30 | return result->AddResult(row);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/SelectSubstep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectSubstep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef SELECTSUBSTEP_H_
9 | #define SELECTSUBSTEP_H_
10 |
11 | #include "ExecuteSubstep.h"
12 | #include "../common/ResultSet.h"
13 | #include "../common/def.h"
14 | #include "../storage/TableManager.h"
15 |
16 | class SelectSubstep: public ExecuteSubstep {
17 | private:
18 | struct select_fields_t* sel_fields;
19 | public:
20 | SelectSubstep(struct select_fields_t* sel_fields);
21 | ~SelectSubstep();
22 | virtual int32_t Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool);
23 | };
24 |
25 | #endif /* SELECTSUBSTEP_H_ */
26 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/SqlAnalyzer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/execute/SqlAnalyzer.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/UpdateSubstep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * UpdateSubstep.h
3 | *
4 | * Created on: 2012-8-6
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef UPDATESUBSTEP_H_
9 | #define UPDATESUBSTEP_H_
10 |
11 | #include "ExecuteSubstep.h"
12 |
13 | class UpdateSubstep: public ExecuteSubstep {
14 | private:
15 | struct row_data* new_data;
16 | public:
17 | UpdateSubstep(char* up_field, struct low_data_struct* ld, MEM_POOL_PTR mem_pool);
18 | virtual ~UpdateSubstep();
19 | virtual int32_t Execute(TableManager* table, MileHandler* handler, void* output, MEM_POOL_PTR mem_pool);
20 | };
21 |
22 | #endif /* UPDATESUBSTEP_H_ */
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/execute/slave.h:
--------------------------------------------------------------------------------
1 | // hi_slave.h : hi_slave
2 | // Author: liubin
3 | // Created: 2011-07-06
4 |
5 | #ifndef SLAVER_H
6 | #define SLAVER_H
7 |
8 | int sync_with_master(int master_fd, uint64_t cur_offset, struct data_buffer *buffer, uint32_t *message_id, MEM_POOL_PTR mem);
9 |
10 | #endif // SLAVER_H
11 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/hi_control_segment.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/hi_control_segment.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/load_monitor_data.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/load_monitor_data.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-13
4 |
5 | # load make config
6 | TOP_DIR = ../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = libprotocol.a
10 |
11 | all: $(TARGETS)
12 |
13 | $(TARGETS) : $(OBJS)
14 | $(AR) cr $@ $^
15 |
16 | clean :
17 | @rm -f $(TARGETS) $(OBJS)
18 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/databuffer.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/databuffer.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/databuffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/databuffer.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/heartbeat.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/heartbeat.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/packet.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/packet.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/packet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/packet.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/protocol.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/protocol.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/protocol/protocol.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/protocol/protocol.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-13
4 |
5 | # load make config
6 | TOP_DIR = ../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = libstorage.a
10 |
11 | static_libraries = ldb/libldb.a docdb/libdocdb.a
12 |
13 | CXXFLAGS += -I ldb/leveldb/include/
14 |
15 | all: $(static_libraries) $(TARGETS)
16 |
17 | $(static_libraries) :
18 | for d in ldb docdb ; do make -C $$d ; done
19 |
20 | $(TARGETS) : $(OBJS) $(static_libraries)
21 | @-rm -rf $@
22 | $(AR) cr $@ $^
23 | printf "OPEN $@\nADDLIB ldb/libldb.a\nADDLIB docdb/libdocdb.a\nSAVE\nEND" | $(AR) -M
24 |
25 | clean :
26 | @rm -f $(static_libraries) $(TARGETS) $(OBJS)
27 | @for d in ldb docdb ; do make -C $$d clean; done
28 |
29 | c :
30 | @rm -rf $(TARGETS) $(OBJS)
31 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/MileHandler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MileHandler.cpp
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "MileHandler.h"
9 |
10 | MileHandler::MileHandler() {
11 |
12 |
13 | }
14 |
15 | MileHandler::~MileHandler() {
16 |
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/MileHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MileHandler.h
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef MILEHANDLER_H_
9 | #define MILEHANDLER_H_
10 | #include "../common/def.h"
11 |
12 | class MileHandler {
13 | public:
14 | MileHandler();
15 | virtual ~MileHandler();
16 | virtual uint64_t GetHandlerId() = 0;
17 | };
18 |
19 | #endif /* MILEHANDLER_H_ */
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/RecordIterator.cpp:
--------------------------------------------------------------------------------
1 | // RecordIterator.cpp : RecordIterator
2 | // Author: liubin
3 | // Created: 2012-08-14
4 |
5 | #include "RecordIterator.h"
6 | #include "TableManager.h"
7 |
8 | RecordIterator::RecordIterator(TableManager *table_mgr)
9 | : table_mgr_(table_mgr)
10 | {
11 | table_mgr_->Ref();
12 | }
13 |
14 | RecordIterator::~RecordIterator()
15 | {
16 | if (NULL != table_mgr_)
17 | table_mgr_->UnRef();
18 | table_mgr_ = NULL;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/RecordIterator.h:
--------------------------------------------------------------------------------
1 | // RecordIterator.h : RecordIterator
2 | // Author: liubin
3 | // Created: 2012-08-28
4 |
5 | #ifndef RECORDITERATOR_H
6 | #define RECORDITERATOR_H
7 |
8 | #include "../common/MileIterator.h"
9 |
10 | class TableManager;
11 |
12 | class RecordIterator : public MileIterator {
13 | public:
14 | RecordIterator(TableManager *table_mgr);
15 | virtual ~RecordIterator();
16 |
17 | virtual void First() = 0;
18 |
19 | virtual void Next() = 0;
20 |
21 | virtual int8_t IsDone() = 0;
22 |
23 | virtual void* CurrentItem() = 0;
24 |
25 | private:
26 | TableManager *table_mgr_;
27 | };
28 |
29 | #endif // RECORDITERATOR_H
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/StateManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * StateManager.h
3 | *
4 | * Created on: 2012-10-30
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef STATEMANAGER_H_
9 | #define STATEMANAGER_H_
10 |
11 | #include "../protocol/packet.h"
12 | #include "StorageEngine.h"
13 |
14 | #define STATE_NAME_READABLE "readable"
15 |
16 | class StateManager {
17 | private:
18 | static int QueryState(StorageEngine* engine, const char *name, struct stat_info *info, MEM_POOL_PTR mem_pool);
19 | public:
20 | static struct stat_info_array* QueryStates(StorageEngine* engine,
21 | struct get_state_packet *packet, MEM_POOL_PTR mem_pool);
22 | };
23 |
24 | #endif /* STATEMANAGER_H_ */
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/StorageEngine.cpp:
--------------------------------------------------------------------------------
1 | // StorageEngine.cpp : StorageEngine
2 | // Author: liubin
3 | // Created: 2012-08-13
4 |
5 | #include "StorageEngine.h"
6 |
7 | StorageEngine *StorageEngine::storage = NULL;
8 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/StorageEngineFactory.h:
--------------------------------------------------------------------------------
1 | // StorageEngineFactory.h : StorageEngineFactory
2 | // Author: liubin
3 | // Created: 2012-08-13
4 |
5 | #ifndef STORAGEENGINEFACTORY_H
6 | #define STORAGEENGINEFACTORY_H
7 |
8 | class StorageEngine;
9 | class ConfigFile;
10 |
11 | class StorageEngineFactory
12 | {
13 | public:
14 | static StorageEngine *CreateEngine(const ConfigFile &conf);
15 | };
16 |
17 | #endif // STORAGEENGINEFACTORY_H
18 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/TableManager.cpp:
--------------------------------------------------------------------------------
1 | // TableManager.cpp : TableManager
2 | // Author: liubin
3 | // Created: 2012-08-06
4 |
5 | #include "TableManager.h"
6 | #include "StorageEngine.h"
7 |
8 | TableManager::TableManager(StorageEngine *se) : storage_engine_(se)
9 | {
10 | assert(NULL != se);
11 | se->Ref();
12 | }
13 |
14 | TableManager::~TableManager()
15 | {
16 | if (storage_engine_ != NULL) {
17 | storage_engine_->UnRef();
18 | storage_engine_ = NULL;
19 | }
20 | }
21 | int32_t TableManager::getCutThreshold()
22 | {
23 | return storage_engine_->getCutThreshold();
24 | }
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/DocEngine.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/DocEngine.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/DocHandler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * DocHandler.cpp
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "DocHandler.h"
9 |
10 | DocHandler::DocHandler() {
11 | this->docid = 0;
12 | this->match_score = 0;
13 | }
14 |
15 | DocHandler::DocHandler(uint64_t docid){
16 | this->docid = docid;
17 | this->match_score = 0;
18 | }
19 |
20 |
21 | DocHandler::~DocHandler() {
22 |
23 | }
24 |
25 |
26 | uint64_t DocHandler::GetHandlerId(){
27 | return docid;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/DocHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DocHandler.h
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef DOCHANDLER_H_
9 | #define DOCHANDLER_H_
10 |
11 | #include "../../common/def.h"
12 | #include "../MileHandler.h"
13 |
14 | class DocHandler: public MileHandler {
15 | public:
16 | uint64_t docid;
17 | double match_score;
18 | DocHandler();
19 | DocHandler(uint64_t docid);
20 | virtual ~DocHandler();
21 | virtual uint64_t GetHandlerId();
22 | };
23 |
24 | #endif /* DOCHANDLER_H_ */
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2011-06-13
4 |
5 | # load make config
6 | TOP_DIR = ../../..
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = libdocdb.a
10 |
11 | all: $(TARGETS)
12 |
13 | $(TARGETS) : $(OBJS)
14 | $(AR) cr $@ $^
15 |
16 | clean :
17 | @rm -f $(TARGETS) $(OBJS)
18 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/bitmark.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/bitmark.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/bitmark.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/bitmark.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/config_parser.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/config_parser.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/config_parser.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/config_parser.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/data_field.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/data_field.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/data_field.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/data_field.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/db.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/db.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/db.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/db.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/docdb_packet.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/docdb_packet.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/docdb_packet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/docdb_packet.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/doclist.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/doclist.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/doclist.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/doclist.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/dynamic_hash_index.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/dynamic_hash_index.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/dynamic_hash_index.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/dynamic_hash_index.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/filter_index.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/filter_index.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/filter_index.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/filter_index.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hash_index.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hash_index.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hash_index.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hash_index.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hash_memcompress.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hash_memcompress.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hash_memcompress.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hash_memcompress.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hashcompress.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hashcompress.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/hashcompress.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/hashcompress.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/index_field.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/index_field.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/index_field.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/index_field.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/rowid_list.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/rowid_list.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/rowid_list.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/rowid_list.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/segment.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/segment.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/segment.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/segment.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/set_operator.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/set_operator.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/set_operator.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/set_operator.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/storage.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/storage.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/storage.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/storage.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/suffix.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/suffix.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/suffix.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/suffix.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/table.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/table.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/table.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/table.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2012-03-23
4 |
5 | # load make config
6 | TOP_DIR = ../../../../
7 | include $(TOP_DIR)/MK.config
8 |
9 | TARGETS = $(foreach src, $(SRCS), $(basename $(src)) )
10 |
11 | LDFLAGS += -L .. -ldocdb
12 | LDFLAGS += -L ../../ -lstorage
13 | LDFLAGS += -L ../../../common -lcommon -lgtest -lpthread -rdynamic
14 |
15 |
16 | all : $(TARGETS)
17 |
18 | $(TARGETS) : % : %.o
19 | $(CXX) $(CFLAGS) -o $@ $< $(LDFLAGS)
20 |
21 | clean :
22 | -@rm -rf $(TARGETS) *.o
23 |
24 | ##################################
25 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/db_test.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/test/db_test.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/doclist_test.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/test/doclist_test.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/dynamic_hash_index_test.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/test/dynamic_hash_index_test.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/hashcompress_test.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/test/hashcompress_test.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/test/hashindex_test.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/test/hashindex_test.cpp
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/vstorage.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/vstorage.c
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/docdb/vstorage.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/docdb/vstorage.h
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/LdbConfig.h:
--------------------------------------------------------------------------------
1 | // LdbConfig.h : LdbConfig
2 | // Author: liubin
3 | // Created: 2012-08-06
4 |
5 | #ifndef LDBCONFIG_H
6 | #define LDBCONFIG_H
7 |
8 | #ifndef CONF_LDB_SESSION
9 | #define CONF_LDB_SESSION "ldb"
10 | #endif
11 |
12 | #define CONF_LDB_TABLES "tables"
13 |
14 | #define CONF_WRITE_SYNC "write_sync"
15 | #define CONF_READ_VERIFY_CHECKSUMS "read_verify_checksums"
16 |
17 |
18 | #define CONF_ROW_KEY_SUFFIX ".row_key"
19 | #define CONF_TIME_KEY_SUFFIX ".time_key"
20 | #define CONF_TIME_KEY_SCALE_SUFFIX ".time_key_scale"
21 | #define CONF_TIME_KEY_LEN_SUFFIX ".time_key_len"
22 | #define CONF_EXPIRE_TIME_SUFFIX ".expire_time"
23 |
24 | #define CONF_CUMULATIVE_STEP_SUFFIX ".cumulative_step"
25 | #define CONF_AGGREGATE_DESC_SUFFIX ".aggregate_desc"
26 |
27 | #endif // LDBCONFIG_H
28 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/LdbFilter.h:
--------------------------------------------------------------------------------
1 | // LdbFilter.h : LdbFilter
2 | // Author: liubin
3 | // Created: 2012-11-05
4 |
5 | #ifndef LDBFILTER_H
6 | #define LDBFILTER_H
7 |
8 | #include "leveldb/filter_policy.h"
9 |
10 | class LdbComparator;
11 |
12 | class LdbFilter : public leveldb::FilterPolicy {
13 | public:
14 | explicit LdbFilter(const LdbComparator *comparetor);
15 | virtual ~LdbFilter();
16 |
17 | virtual const char *Name() const { return "ldbfilter"; }
18 |
19 | virtual void CreateFilter(const leveldb::Slice *keys, int n, std::string *dst) const;
20 |
21 | virtual bool KeyMayMatch(const leveldb::Slice &key, const leveldb::Slice &filter) const;
22 |
23 | private:
24 | const FilterPolicy *bloom_filter_;
25 | const LdbComparator *ldb_comparator_;
26 | };
27 |
28 | #endif // LDBFILTER_H
29 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/LdbHandler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * LdbHandler.cpp
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #include "LdbHandler.h"
9 |
10 | LdbHandler::LdbHandler() {
11 | memset(&key, 0, sizeof(struct low_data_struct));
12 | memset(&value, 0, sizeof(struct low_data_struct));
13 | }
14 |
15 | LdbHandler::~LdbHandler() {
16 | // TODO Auto-generated destructor stub
17 | }
18 |
19 |
20 |
21 | uint64_t LdbHandler::GetHandlerId(){
22 | return 0;
23 | }
24 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/LdbHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LdbHandler.h
3 | *
4 | * Created on: 2012-10-15
5 | * Author: yuzhong.zhao
6 | */
7 |
8 | #ifndef LDBHANDLER_H_
9 | #define LDBHANDLER_H_
10 |
11 | #include "../MileHandler.h"
12 |
13 | class LdbHandler: public MileHandler {
14 | public:
15 | struct low_data_struct key;
16 | struct low_data_struct value;
17 | LdbHandler();
18 | virtual ~LdbHandler();
19 | virtual uint64_t GetHandlerId();
20 | };
21 |
22 | #endif /* LDBHANDLER_H_ */
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/AUTHORS:
--------------------------------------------------------------------------------
1 | # Names should be added to this file like so:
2 | # Name or Organization
3 |
4 | Google Inc.
5 |
6 | # Initial version authors:
7 | Jeffrey Dean
8 | Sanjay Ghemawat
9 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/NEWS:
--------------------------------------------------------------------------------
1 | Release 1.2 2011-05-16
2 | ----------------------
3 |
4 | Fixes for larger databases (tested up to one billion 100-byte entries,
5 | i.e., ~100GB).
6 |
7 | (1) Place hard limit on number of level-0 files. This fixes errors
8 | of the form "too many open files".
9 |
10 | (2) Fixed memtable management. Before the fix, a heavy write burst
11 | could cause unbounded memory usage.
12 |
13 | A fix for a logging bug where the reader would incorrectly complain
14 | about corruption.
15 |
16 | Allow public access to WriteBatch contents so that users can easily
17 | wrap a DB.
18 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/TODO:
--------------------------------------------------------------------------------
1 | ss
2 | - Stats
3 |
4 | db
5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key)
6 | that would blow away files whose ranges are entirely contained
7 | within [start_key..end_key]? For Chrome, deletion of obsolete
8 | object stores, etc. can be done in the background anyway, so
9 | probably not that important.
10 |
11 | After a range is completely deleted, what gets rid of the
12 | corresponding files if we do no future changes to that range. Make
13 | the conditions for triggering compactions fire in more situations?
14 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/helpers/memenv/memenv.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 |
5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_
6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_
7 |
8 | namespace leveldb {
9 |
10 | class Env;
11 |
12 | // Returns a new environment that stores its data in memory and delegates
13 | // all non-file-storage tasks to base_env. The caller must delete the result
14 | // when it is no longer needed.
15 | // *base_env must remain live while the result is in use.
16 | Env* NewMemEnv(Env* base_env);
17 |
18 | } // namespace leveldb
19 |
20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_
21 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/port/README:
--------------------------------------------------------------------------------
1 | This directory contains interfaces and implementations that isolate the
2 | rest of the package from platform details.
3 |
4 | Code in the rest of the package includes "port.h" from this directory.
5 | "port.h" in turn includes a platform specific "port_.h" file
6 | that provides the platform specific implementation.
7 |
8 | See port_posix.h for an example of what must be provided in a platform
9 | specific header file.
10 |
11 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/port/port.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 |
5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_
6 | #define STORAGE_LEVELDB_PORT_PORT_H_
7 |
8 | #include
9 |
10 | // Include the appropriate platform specific file below. If you are
11 | // porting to a new platform, see "port_example.h" for documentation
12 | // of what the new port_.h file must provide.
13 | #if defined(LEVELDB_PLATFORM_POSIX)
14 | # include "port/port_posix.h"
15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM)
16 | # include "port/port_chromium.h"
17 | #endif
18 |
19 | #endif // STORAGE_LEVELDB_PORT_PORT_H_
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/util/config.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 |
5 | #include "config.h"
6 |
7 | namespace leveldb {
8 | int config::kL0_CompactionTrigger = 4;
9 | int config::kL0_SlowdownWritesTrigger = 8;
10 | int config::kL0_StopWritesTrigger = 12;
11 | int config::kMaxMemCompactLevel = 2;
12 | size_t config::kTargetFileSize = 2 << 20;
13 | size_t config::kBaseLevelSize = 20 << 20;
14 | int config::kAllowedSeeks = 1 << 30;
15 | bool config::kAllowMmapTable = true;
16 | }
17 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/util/filter_policy.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 |
5 | #include "leveldb/filter_policy.h"
6 |
7 | namespace leveldb {
8 |
9 | FilterPolicy::~FilterPolicy() { }
10 |
11 | } // namespace leveldb
12 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/leveldb/util/hash.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 | //
5 | // Simple hash function used for internal data structures
6 |
7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_
8 | #define STORAGE_LEVELDB_UTIL_HASH_H_
9 |
10 | #include
11 | #include
12 |
13 | namespace leveldb {
14 |
15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed);
16 |
17 | }
18 |
19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_
20 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/AUTHORS:
--------------------------------------------------------------------------------
1 | opensource@google.com
2 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/autogen.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh -e
2 | rm -rf autom4te.cache
3 | aclocal -I m4
4 | autoheader
5 | libtoolize --copy
6 | automake --add-missing --copy
7 | autoconf
8 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata1.snappy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata1.snappy
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata2.snappy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata2.snappy
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata3.snappy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/baddata3.snappy
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/cp.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/cp.html
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/geo.protodata:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/geo.protodata
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/house.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/house.jpg
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/kennedy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/kennedy.xls
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/mapreduce-osdi-1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/mapreduce-osdi-1.pdf
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/ptt5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/ptt5
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/ldb/snappy/testdata/sum:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/storage/ldb/snappy/testdata/sum
--------------------------------------------------------------------------------
/docserver/indexengine/src/storage/test/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile : Makefile
2 | # Author: liubin
3 | # Created: 2012-05-25
4 |
5 | TOP_DIR = ../../..
6 | include $(TOP_DIR)/MK.config
7 |
8 | COMMOBJS = $(foreach src, $(filter-out $(wildcard *_test.cpp), $(wildcard *.c *.cpp)), $(basename $(src)).o)
9 | MAINOBJS = $(foreach src, $(wildcard *_test.cpp), $(basename $(src)).o)
10 | TARGETS = $(foreach src, $(MAINOBJS), $(basename $(src)) )
11 |
12 | CXXFLAGS += -I ../ldb/leveldb/include/
13 | LDFLAGS += -L ../ -lstorage -L ../../execute -lexecute -L ../../protocol -lprotocol -L ../../common -lcommon
14 | LDFLAGS += -lgtest -lpthread -rdynamic
15 |
16 | all : $(TARGETS)
17 |
18 | $(TARGETS) : % : %.o $(COMMOBJS)
19 | $(CXX) -o $@ $^ $(LDFLAGS)
20 |
21 | clean :
22 | -rm $(TARGETS) *.o
23 |
--------------------------------------------------------------------------------
/docserver/indexengine/src/table_meta_trans.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/src/table_meta_trans.c
--------------------------------------------------------------------------------
/docserver/indexengine/tests/Makefile_man:
--------------------------------------------------------------------------------
1 |
2 | LDPATH = -L./../lib/ -L./../../test/lib/
3 | INCLUDE= -I./../../test/include
4 |
5 | CFLAG = -c -g -pg
6 | GCC = g++
7 | .SUFFIXES: .o .cpp .c
8 | test: test.o mem.o ../src/hi_mem.o
9 | $(GCC) $(LDPATH) -o $@ ../src/hi_mem.o mem.o test.o -lgtest
10 | .cpp.o:
11 | $(GCC) $(CFLAG) -o $@ $<
12 | .c.o:
13 | $(GCC) $(CFLAG) -o $@ $<
14 |
--------------------------------------------------------------------------------
/docserver/indexengine/tests/README:
--------------------------------------------------------------------------------
1 |
2 | 1. install gtest
3 | 2. cmake .
4 | 3. test
5 |
--------------------------------------------------------------------------------
/docserver/indexengine/tests/config.h:
--------------------------------------------------------------------------------
1 | #ifndef CONFIG_H
2 | #define CONFIG_H
3 | #include
4 | #include
5 | #include "../src/common/def.h"
6 | #include "../src/common/mem.h"
7 | #include "../src/storage/db.h"
8 |
9 |
10 | struct hint_array * get_time_hint(MEM_POOL* mem_pool);
11 |
12 | int32 verify_low_data(struct low_data_struct* data,enum field_types type);
13 |
14 | int32 verify_row_data(struct row_data* rdata,uint16 field_count,enum field_types* types);
15 |
16 | void get_low_data(struct low_data_struct* data,enum field_types type,MEM_POOL* mem_pool);
17 |
18 | void get_low_data2(struct low_data_struct* data, int value, enum field_types type,MEM_POOL* mem_pool);
19 |
20 | struct row_data* get_row_data(uint16 field_count,enum field_types* types,MEM_POOL* mem_pool);
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/docserver/indexengine/tests/def.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/tests/def.h
--------------------------------------------------------------------------------
/docserver/indexengine/tests/docserver.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/docserver/indexengine/tests/docserver.conf
--------------------------------------------------------------------------------
/docserver/indexengine/tests/generate.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | if(argc < 2)
8 | {
9 | fprintf(stderr, "file filename number\n");
10 | exit(1);
11 | }
12 | FILE *f = fopen(argv[1], "w");
13 | long num = atoi(argv[2]);
14 |
15 | long i,j;
16 | char temp[50];
17 | char data[4096];
18 |
19 | srand((unsigned int)time(NULL));
20 |
21 | for(i=0;i
2 |
3 | client
4 | mile. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.
5 |
6 | common
7 |
8 |
9 |
10 | org.eclipse.jdt.core.javabuilder
11 |
12 |
13 |
14 | org.eclipse.jdt.core.javanature
15 |
16 |
--------------------------------------------------------------------------------
/mergeserver/client/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Wed Jul 31 10:53:18 CST 2013
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | eclipse.preferences.version=1
4 | encoding/src/main/java=GBK
5 | org.eclipse.jdt.core.compiler.source=1.6
6 | encoding/src/test/resources=GBK
7 | encoding/src/main/resources=GBK
8 | encoding/src/test/java=GBK
9 | org.eclipse.jdt.core.compiler.compliance=1.6
10 |
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/ApplationClientImpl.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/client/src/main/java/com/alipay/mile/client/ApplationClientImpl.java
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/CheckMergeServersTimerTask.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/client/src/main/java/com/alipay/mile/client/CheckMergeServersTimerTask.java
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/SqlClientTemplate.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/client/src/main/java/com/alipay/mile/client/SqlClientTemplate.java
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/result/MileInsertResult.java:
--------------------------------------------------------------------------------
1 | package com.alipay.mile.client.result;
2 |
3 | import com.alipay.mile.Record;
4 | import com.alipay.mile.SqlResultSet;
5 |
6 | public class MileInsertResult extends MileSqlResult {
7 | private long docId;
8 |
9 | public MileInsertResult() {
10 | this.docId = -1;
11 | }
12 |
13 | public MileInsertResult(SqlResultSet sqlResultSet) {
14 | this.setDocState(sqlResultSet.docState);
15 | for (Record record : sqlResultSet.data) {
16 | this.docId = record.docid;
17 | break;
18 | }
19 | }
20 |
21 | public void setDocId(long docId) {
22 | this.docId = docId;
23 | }
24 |
25 | public long getDocId() {
26 | return docId;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/result/MileQueryResult.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/client/src/main/java/com/alipay/mile/client/result/MileQueryResult.java
--------------------------------------------------------------------------------
/mergeserver/client/src/main/java/com/alipay/mile/client/result/MileSqlResult.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/client/src/main/java/com/alipay/mile/client/result/MileSqlResult.java
--------------------------------------------------------------------------------
/mergeserver/cmd/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | cmd
4 | mile. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.
5 |
6 | common
7 | client
8 |
9 |
10 |
11 | org.eclipse.jdt.core.javabuilder
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
--------------------------------------------------------------------------------
/mergeserver/cmd/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Wed Jul 31 10:53:19 CST 2013
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | eclipse.preferences.version=1
4 | encoding/src/main/java=GBK
5 | org.eclipse.jdt.core.compiler.source=1.6
6 | encoding/src/test/resources=GBK
7 | encoding/src/main/resources=GBK
8 | encoding/src/test/java=GBK
9 | org.eclipse.jdt.core.compiler.compliance=1.6
10 |
--------------------------------------------------------------------------------
/mergeserver/cmd/src/main/java/com/alipay/mile/client/CliDriverToTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/mile/34b63abb0982de376749dbccf4c1446a8084f9ff/mergeserver/cmd/src/main/java/com/alipay/mile/client/CliDriverToTest.java
--------------------------------------------------------------------------------
/mergeserver/cmd/src/main/java/com/alipay/mile/client/CommonSqltoSql.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Alipay.com Inc.
3 | * Copyright (c) 2005-2011 All Rights Reserved.
4 | */
5 |
6 | package com.alipay.mile.client;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * Convert SQL to Mile SQL
13 | * @author bin.lb
14 | */
15 | public class CommonSqltoSql implements DataToSql {
16 |
17 | @Override
18 | public String convert(String data, List