#![allow(missing_docs)]
#![allow(unused_imports)] #![allow(unused_mut)] #![allow(unused_doc_comments)] #![allow(redundant_semicolons)] #![allow(clippy::needless_return)] #![allow(clippy::incompatible_msrv)]
#![allow(unused_parens)]
#![deny(unsafe_op_in_unsafe_fn)]
pub mod algorithms;
pub mod blob_store;
pub mod cache;
pub mod compression;
pub mod concurrency;
pub mod config;
pub mod containers;
pub mod dev_infrastructure;
pub mod entropy;
pub mod error;
pub mod error_recovery;
pub mod fsa;
pub mod hash_map;
pub mod io;
pub mod memory;
pub mod scoring;
pub mod simd;
pub mod statistics;
pub mod string;
pub mod succinct;
pub mod system;
pub mod thread;
pub use containers::{
AutoGrowCircularQueue,
BlockSize,
EasyHashMap,
EasyHashMapBuilder,
EasyHashMapStats,
FastVec,
FixedCircularQueue,
FixedLenStrVec,
FixedStr4Vec,
FixedStr8Vec,
FixedStr16Vec,
FixedStr32Vec,
FixedStr64Vec,
GoldHashIdx,
HashStrMap,
HashStrMapStats,
IntVec,
PackedInt,
SmallMap,
SortableStrIter,
SortableStrSortedIter,
SortableStrVec,
UintVector,
ValVec32,
ZoSortedStrVec,
ZoSortedStrVecIter,
ZoSortedStrVecRange,
};
pub use error::{Result, ZiporaError};
pub use error_recovery::{
verify_alignment, verify_allocation_success, verify_bounds_check, verify_power_of_2,
verify_range_check,
};
pub use string::{
FastStr, LexIteratorBuilder, LexicographicIterator, LineProcessor, LineProcessorConfig,
LineProcessorStats, LineSplitter, SortedVecLexIterator, StreamingLexIterator, UnicodeAnalysis,
UnicodeProcessor, Utf8ToUtf32Iterator, utf8_byte_count, validate_utf8_and_count_chars,
};
pub use succinct::{
AdaptiveMultiDimensional,
AdaptiveRankSelect,
BitVector,
BitwiseOp,
Bmi2Accelerator,
Bmi2BitOps,
Bmi2BlockOps,
Bmi2Capabilities,
Bmi2PrefetchOps,
Bmi2RangeOps,
Bmi2RankOps,
Bmi2SelectOps,
Bmi2SequenceOps,
Bmi2Stats,
BuilderOptions,
DataProfile,
PerformanceStats,
RankSelect256,
RankSelectBuilder,
RankSelectInterleaved256,
RankSelectOps,
RankSelectPerformanceOps,
SelectionCriteria,
SimdCapabilities,
SimdOps,
bulk_popcount_simd,
bulk_rank1_simd,
bulk_select1_simd,
};
pub use blob_store::{BlobStore, MemoryBlobStore, PlainBlobStore};
pub use fsa::{
BitVectorType,
DoubleArrayTrie,
DoubleArrayTrieMap,
FiniteStateAutomaton,
MapValue,
RankSelectType,
Trie,
TrieStrategy,
ZiporaTrie,
ZiporaTrieConfig,
};
pub use io::{DataInput, DataOutput, VarInt};
pub use hash_map::{
CacheMetrics,
CombineStrategy,
GOLDEN_LOAD_FACTOR,
GOLDEN_RATIO_FRAC_DEN,
GOLDEN_RATIO_FRAC_NUM,
HashCombinable,
HashFunctionBuilder,
HashMapStats,
HashStrategy,
OptimizationStrategy,
Prefetcher,
SimdStringOps,
SimdTier,
ZiporaHashMap,
ZiporaHashMapConfig,
advanced_hash_combine,
fabo_hash_combine_u32,
fabo_hash_combine_u64,
golden_ratio_next_size,
optimal_bucket_count,
};
#[cfg(feature = "mmap")]
pub use io::{MemoryMappedInput, MemoryMappedOutput};
pub use blob_store::{
DictionaryBlobStore, EntropyAlgorithm, EntropyCompressionStats, HuffmanBlobStore, RansBlobStore,
};
pub use entropy::dictionary::Dictionary;
pub use entropy::rans::Rans64Symbol;
pub use entropy::{
DictionaryBuilder, DictionaryCompressor, EntropyStats, HuffmanDecoder, HuffmanEncoder,
HuffmanTree, OptimizedDictionaryCompressor, Rans64Encoder, RansDecoder, RansState,
};
pub use memory::{
BumpAllocator,
BumpArena,
CACHE_LINE_SIZE,
CacheAlignedVec,
MemoryConfig,
MemoryPool,
MemoryStats,
NumaPoolStats,
NumaStats,
PoolConfig,
PooledBuffer,
PooledVec,
SecureMemoryPool,
SecurePoolConfig,
SecurePoolStats,
SecurePooledPtr,
clear_numa_pools,
get_global_pool_for_size,
get_global_secure_pool_stats,
get_numa_stats,
get_optimal_numa_node,
init_numa_pools,
numa_alloc_aligned,
numa_dealloc,
set_current_numa_node,
size_to_class,
};
#[cfg(target_os = "linux")]
pub use memory::{HugePage, HugePageAllocator};
pub use algorithms::{
AlgorithmConfig, EnhancedLoserTree, LcpArray, LoserTreeConfig, MergeSource, MultiWayMerge,
RadixSort, RadixSortConfig, SuffixArray, SuffixArrayBuilder, TournamentNode, simd_block_filter,
simd_gallop_to,
};
#[cfg(feature = "async")]
pub use concurrency::{
FiberHandle, FiberPool, FiberPoolBuilder, FiberPoolConfig, FiberStats, ParallelLoudsTrie,
ParallelTrieBuilder, Pipeline, PipelineBuilder, PipelineStage, PipelineStats, Task,
WorkStealingExecutor, WorkStealingQueue,
};
pub use compression::{
AdaptiveCompressor, AdaptiveConfig, Algorithm, CompressionProfile, CompressionStats,
Compressor, CompressorFactory, PerformanceRequirements,
};
pub use system::{
AdaptiveBase64,
BenchmarkSuite,
HighPrecisionTimer,
KernelInfo,
PageAlignedAlloc,
PerfTimer,
ProfiledFunction,
RuntimeCpuFeatures,
SimdBase64Decoder,
SimdBase64Encoder,
VmManager,
base64_decode_simd,
base64_encode_simd,
get_cpu_features,
get_kernel_info,
has_cpu_feature,
vm_prefetch,
};
#[cfg(feature = "async")]
pub use system::{BidirectionalPipe, ProcessExecutor, ProcessManager, ProcessPool};
pub use dev_infrastructure::{
AccumulatorStats,
AutoRegister,
BenchmarkResult,
FactoryBuilder,
FactoryRegistry,
Factoryable,
GlobalFactory,
GlobalStatsRegistry,
Histogram,
HistogramStats,
MemoryDebugger,
MultiDimensionalStats,
PerformanceProfiler,
ScopedTimer,
StatAccumulator,
StatIndex,
U32Histogram,
U64Histogram,
format_duration,
global_factory,
global_memory_debugger,
global_profiler,
global_stats,
};
pub use statistics::{
BufferMetadata,
BufferPoolConfig,
BufferPoolManager,
BufferPriority,
CompressionEstimates,
ContextBuffer,
DefaultStatisticsContext,
DistributionInfo,
DistributionStats,
EntropyAnalyzer,
EntropyAnalyzerCollection,
EntropyConfig,
EntropyResults,
ErrorStats,
ErrorType,
FragmentationAnalysis,
FreqHist,
FreqHistO1,
FreqHistO2,
GlobalMemoryTracker,
HistogramCollection,
HistogramData,
HistogramDataO1,
HistogramDataO2,
LocalMemoryTracker,
MemoryBreakdown,
MemoryCategory,
OperationProfile,
PoolStatistics,
ProfiledOperation,
Profiler,
ProfilerConfig,
Profiling,
QDuration,
QTime,
ScopedBuffer,
StatisticsContext,
TimerCollection,
TimingStats,
TrackedObject,
TrieStatistics,
init_global_profiler,
str_date_time_now,
};
pub use thread::{
AsAtomic,
AtomicBitOps,
AtomicExt,
DefaultPlatformSync,
InstanceTls,
OwnerTls,
PlatformSync,
TlsPool,
memory_ordering,
spin_loop_hint,
};
pub use cache::{
BufferPool,
BufferPoolStats,
CacheBuffer,
CacheError,
CacheHitType,
CacheStatistics,
CacheStatsSnapshot,
EvictionAlgorithm,
EvictionConfig,
FileId,
HUGE_PAGE_SIZE,
KernelAdvice,
LockingConfig,
LruPageCache,
MAX_SHARDS,
MaintenanceConfig,
NodeIndex,
PAGE_BITS,
PAGE_SIZE,
PageCacheConfig,
PageId,
PerformanceConfig,
SingleLruPageCache,
WarmingStrategy,
get_shard_id,
hash_file_page,
prefetch_hint,
};
#[cfg(target_os = "linux")]
pub use thread::{
FutexCondvar, FutexGuard, FutexMutex, FutexReadGuard, FutexRwLock, FutexWriteGuard, LinuxFutex,
};
#[cfg(target_arch = "x86_64")]
pub use thread::x86_64_optimized;
#[cfg(target_arch = "aarch64")]
pub use thread::aarch64_optimized;
#[cfg(feature = "zstd")]
pub use blob_store::ZstdBlobStore;
pub type StateId = u32;
pub type RecordId = u32;
#[cfg(feature = "ffi")]
pub mod ffi;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn has_simd_support() -> bool {
#[cfg(target_feature = "avx2")]
{
true
}
#[cfg(not(target_feature = "avx2"))]
{
false
}
}
pub fn init() {
log::debug!("Initializing zipora v{}", VERSION);
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_basic_functionality() {
init();
assert!(VERSION.len() > 0);
}
#[test]
fn test_version_info() {
assert!(VERSION.len() > 0);
assert!(VERSION.contains('.'));
let parts: Vec<&str> = VERSION.split('.').collect();
assert!(parts.len() >= 2);
}
#[test]
fn test_simd_support() {
let has_simd = has_simd_support();
#[cfg(target_feature = "avx2")]
assert!(has_simd);
#[cfg(not(target_feature = "avx2"))]
assert!(!has_simd);
}
#[test]
fn test_type_aliases() {
let _state_id: StateId = 42;
let _record_id: RecordId = 123;
assert_eq!(std::mem::size_of::<StateId>(), 4);
assert_eq!(std::mem::size_of::<RecordId>(), 4);
}
#[test]
fn test_re_exports() {
let _vec = FastVec::<i32>::new();
let _str = FastStr::from_string("test");
let _bv = BitVector::new();
let _err = ZiporaError::invalid_data("test");
assert!(std::any::type_name::<Result<()>>().contains("ZiporaError"));
}
#[test]
fn test_multiple_init_calls() {
init();
init();
init();
}
}