コード例 #1
0
        /// <summary>
        /// Creates a DataStore instance.
        /// <p>
        /// Subclasses can override this method to provide a specific DataStore implementation
        /// such as DynamicDataStore and IndexedDataStore or provide a specific SegmentFactory
        /// such as ChannelSegmentFactory, MappedSegmentFactory and WriteBufferSegment.
        /// </summary>
        /// <param name="homeDir">the home directory of DataStore.</param>
        /// <param name="initialCapacity">the initial capacity of DataStore.</param>
        /// <returns>The data store</returns>
        protected StaticDataStore CreateDataStore(File homeDir, int initialCapacity)
        {
            var config = new StoreConfig(homeDir, initialCapacity);
            config.setSegmentFactory(new MemorySegmentFactory());
            config.setSegmentFileSizeMB(32);

            return StoreFactory.createStaticDataStore(config);
        }