Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2011 the original author or authors. See the notice.md file distributed with this work for additional information regarding copyright ownership. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.iq80.leveldb.impl;
 
 
 import java.util.Map;
 
 public class VersionEdit
 {
     private String comparatorName;
     private Long logNumber;
     private Long nextFileNumber;
     private Long previousLogNumber;
     private Long lastSequenceNumber;
     private final Map<IntegerInternalKeycompactPointers = Maps.newTreeMap();
     private final Multimap<IntegerFileMetaDatanewFiles = ArrayListMultimap.create();
     private final Multimap<IntegerLongdeletedFiles = ArrayListMultimap.create();
 
     public VersionEdit()
     {
     }
 
     public VersionEdit(Slice slice)
     {
         SliceInput sliceInput = slice.input();
         while(sliceInput.isReadable()) {
             int i = VariableLengthQuantity.readVariableLengthInt(sliceInput);
             VersionEditTag tag = VersionEditTag.getValueTypeByPersistentId(i);
             tag.readValue(sliceInputthis);
         }
     }
 
     public String getComparatorName()
     {
         return ;
     }
 
     public void setComparatorName(String comparatorName)
     {
         this. = comparatorName;
     }
 
     public Long getLogNumber()
     {
         return ;
     }
 
     public void setLogNumber(long logNumber)
     {
         this. = logNumber;
     }
 
     public Long getNextFileNumber()
     {
         return ;
     }
 
     public void setNextFileNumber(long nextFileNumber)
     {
         this. = nextFileNumber;
     }
 
     public Long getPreviousLogNumber()
     {
         return ;
     }
 
     public void setPreviousLogNumber(long previousLogNumber)
     {
         this. = previousLogNumber;
     }
 
     public Long getLastSequenceNumber()
     {
         return ;
    }
    public void setLastSequenceNumber(long lastSequenceNumber)
    {
        this. = lastSequenceNumber;
    }
    {
        return ImmutableMap.copyOf();
    }
    public void setCompactPointer(int levelInternalKey key)
    {
        .put(levelkey);
    }
    public void setCompactPointers(Map<IntegerInternalKeycompactPointers)
    {
        this..putAll(compactPointers);
    }
    {
        return ImmutableMultimap.copyOf();
    }
    // Add the specified file at the specified level.
    // REQUIRES: This version has not been saved (see VersionSet::SaveTo)
    // REQUIRES: "smallest" and "largest" are smallest and largest keys in file
    public void addFile(int levellong fileNumber,
            long fileSize,
            InternalKey smallest,
            InternalKey largest)
    {
        FileMetaData fileMetaData = new FileMetaData(fileNumberfileSizesmallestlargest);
        addFile(levelfileMetaData);
    }
    public void addFile(int levelFileMetaData fileMetaData)
    {
        .put(levelfileMetaData);
    }
    public void addFiles(Multimap<IntegerFileMetaDatafiles)
    {
        .putAll(files);
    }
    public Multimap<IntegerLonggetDeletedFiles()
    {
        return ImmutableMultimap.copyOf();
    }
    // Delete the specified "file" from the specified "level".
    public void deleteFile(int levellong fileNumber)
    {
        .put(levelfileNumber);
    }
    public Slice encode()
    {
        DynamicSliceOutput dynamicSliceOutput = new DynamicSliceOutput(4096);
        for (VersionEditTag versionEditTag : VersionEditTag.values()) {
            versionEditTag.writeValue(dynamicSliceOutputthis);
        }
        return dynamicSliceOutput.slice();
    }
    @Override
    public String toString()
    {
        final StringBuilder sb = new StringBuilder();
        sb.append("VersionEdit");
        sb.append("{comparatorName='").append().append('\'');
        sb.append(", logNumber=").append();
        sb.append(", previousLogNumber=").append();
        sb.append(", lastSequenceNumber=").append();
        sb.append(", compactPointers=").append();
        sb.append(", newFiles=").append();
        sb.append(", deletedFiles=").append();
        sb.append('}');
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X