# # K2HASH # # Copyright 2013 Yahoo Japan Corporation. # # K2HASH is key-valuew store base libraries. # K2HASH is made for the purpose of the construction of # original KVS system and the offer of the library. # The characteristic is this KVS library which Key can # layer. And can support multi-processing and multi-thread, # and is provided safely as available KVS. # # For the full copyright and license information, please view # the license file that was distributed with this source code. # # AUTHOR: Takeshi Nakatani # CREATE: Fri 17 Jul 2016 # REVISION: # # # Local macros/define # %if %{undefined package_revision} %global package_revision 1 %endif %if %{undefined make_build} %global make_build %{__make} %{?_smp_mflags} %endif %if %{undefined autosetup} %global autosetup %setup -q %endif %global gittag v1.0.71 %if %{undefined make_check} %global make_check 1 %endif # # main package # Summary: NoSQL Key Value Store(KVS) tools and library Name: k2hash Version: 1.0.71 Release: %{package_revision}%{?dist} License: MIT URL: https://github.com/yahoojapan/k2hash Source0: https://github.com/yahoojapan/k2hash/archive/%{gittag}/%{name}-%{version}.tar.gz Requires: libfullock%{?_isa} >= 1.0.36 BuildRequires: git-core gcc-c++ make libtool libfullock-devel >= 1.0.36 nss-devel # k2hash does not support 32bit arch and failes tests on 64bit arch other than x86_64. ExcludeArch: i686 armv7hl aarch64 ppc64le s390x %description K2HASH is an open-source software for NoSQL(key value store) tools and library supported by Yahoo! JAPAN. The primary features are: - Supports multi-threading and multi-processing program. - Expands data area. - Switches accessing only memory and data file directly. - Puts transaction. - Archiving. - Replaces hash function like plugin. - Replaces transaction. K2HASH tools creates/stores(writes)/reads a file or memory which is made(allocated) by K2HASH library. K2HASH library has following three way for KVS storage. - Uses storage on memory only, this type of storage can be used by only multi-thread process. And on this type, the data on storage is not permanent. - Uses fully mapping file, this type can be used by multi-thread and multi-process. All of data in the file is mmapping fully, then the limit of the file and data size depends on the memory. - Uses a part of mapping file and directly accessing a file, this type can be used by multi-thread and multi-process. K2HASH maps only hash table and etc from the file, and reads/writes the file for data directly. This way is expanding upper limit, but less performance because directly accessing. In cases of using mapping file, you can use the data(file) as permanently or temporary. K2HASH uses FNV-1a hashing function in it. If you replace this hash function, you can do by two way. - One way is that your process defines same prototype of hash function. - The other is that you can load your original DSO library which includes same prototype of hash function. You can know how to implement replacing hash function, please see k2hashfunc.h file. K2HASH can put transaction and archive all of data in file. If you need to make your original formatted transaction outputs, you can do by two way like replacing hash function. - One way is that your process defines same prototype of hash function. - The other is that you can load your original DSO library which includes same prototype of hash function. You can know how to implement replacing transaction function, please see k2htransfunc.h file. Please visit our website and get more details at: https://github.com/yahoojapan/k2hash %prep %autosetup -n %{name}-%{version} %build ./autogen.sh %configure --disable-static --with-nss %make_build %install %make_install find %{buildroot} -name '*.la' -exec rm -f {} ';' %if %{make_check} %check %{__make} check find %{_builddir} -name '*.log' -exec echo {} ';' find %{_builddir} -name '*.log' -exec cat {} ';' %endif %if %{defined ldconfig_scriptlets} %ldconfig_scriptlets %else %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %endif %if 0%{?rhel} == 6 %clean rm -rf %{buildroot} %endif %files %if 0%{?rhel} == 6 %doc COPYING %defattr(-,root,root) %else %license COPYING %endif %doc README AUTHORS ChangeLog %{_libdir}/*.so.1* %{_mandir}/man1/* %{_bindir}/* # # devel package # %package devel Summary: NoSQL Key Value Store(KVS) tools and library (development) Requires: %{name}%{?_isa} = %{version}-%{release}, libfullock-devel%{?_isa} >= 1.0.36 %description devel Development package for building with k2hash shared library. This package has header files and symbols for it. %files devel %if 0%{?rhel} == 6 %defattr(-,root,root) %endif %doc README AUTHORS ChangeLog %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %changelog * Mon Sep 09 2019 Hirotaka Wakabayashi 1.0.71-1 - First version of Fedora