Example #1
0
        public FasterKV(long size, IDevice logDevice, IDevice objectLogDevice, string checkpointDir = null)
        {
            if (checkpointDir != null)
            {
                Config.CheckpointDirectory = checkpointDir;
            }

            hlog = new PersistentMemoryMalloc(logDevice, objectLogDevice);
            var recordSize = Layout.EstimatePhysicalSize(null, null);

            Initialize(size, hlog.GetSectorSize());

            _systemState         = default(SystemState);
            _systemState.phase   = Phase.REST;
            _systemState.version = 1;
            _checkpointType      = CheckpointType.HYBRID_LOG_ONLY;
        }
Example #2
0
        /// <summary>
        /// Create FASTER instance
        /// </summary>
        /// <param name="size"></param>
        /// <param name="logSettings"></param>
        /// <param name="checkpointSettings"></param>
        public FasterKV(long size, LogSettings logSettings, CheckpointSettings checkpointSettings = null)
        {
            if (checkpointSettings == null)
            {
                checkpointSettings = new CheckpointSettings();
            }

            Config.CheckpointDirectory = checkpointSettings.CheckpointDir;
            FoldOverSnapshot           = checkpointSettings.CheckPointType == core.CheckpointType.FoldOver;

            hlog = new PersistentMemoryMalloc(logSettings, this);
            var recordSize = Layout.EstimatePhysicalSize(null, null);

            Initialize(size, hlog.GetSectorSize());

            _systemState         = default(SystemState);
            _systemState.phase   = Phase.REST;
            _systemState.version = 1;
            _checkpointType      = CheckpointType.HYBRID_LOG_ONLY;
        }