Exemplo n.º 1
0
		public Compaction(StorageState storageContext, int level, Version inputVersion = null)
		{
			this.storageContext = storageContext;
			Level = level;
			MaxOutputFileSize = CalculateMaxOutputFileSize(level);
			this.inputVersion = inputVersion;
			Edit = new VersionEdit();
			Inputs = new[]
			    {
			        new List<FileMetadata>(), 
                    new List<FileMetadata>()
			    };
			Grandparents = new List<FileMetadata>();
			grandparentIndex = 0;
			seenKey = false;
			overlappedBytes = 0;

			levelPointers = new int[Config.NumberOfLevels];

			for (int lvl = 0; lvl < Config.NumberOfLevels; lvl++)
			{
				levelPointers[lvl] = 0;
			}
		}
Exemplo n.º 2
0
		/// <summary>
		/// Release the input version for the compaction, once the compaction
		/// is successful.
		/// </summary>
		/// <returns></returns>
		public void ReleaseInputs()
		{
			inputVersion = null;
		}