Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.reftable

pack-priv Class BlockWriter

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8, org.eclipse.jgit.internal.storage.reftable.ReftableConstants.FILE_HEADER_LEN, .ReftableConstants.INDEX_BLOCK_TYPE, .ReftableConstants.LOG_BLOCK_TYPE, .ReftableConstants.LOG_DATA, .ReftableConstants.LOG_NONE, .ReftableConstants.MAX_RESTARTS, .ReftableConstants.OBJ_BLOCK_TYPE, .ReftableConstants.REF_BLOCK_TYPE, .ReftableConstants.VALUE_1ID, .ReftableConstants.VALUE_2ID, .ReftableConstants.VALUE_NONE, .ReftableConstants.VALUE_SYMREF, .ReftableConstants.VALUE_TYPE_MASK, .ReftableConstants.reverseUpdateIndex, .ReftableOutputStream.computeVarintSize, org.eclipse.jgit.lib.Constants.OBJECT_ID_LENGTH, .Ref.Storage.NEW

Formats and writes blocks for ReftableWriter.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv abstract static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final int
private final byte
private final List<BlockWriter.Entry>
private int
private final byte
private int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
BlockWriter(byte type, byte kt, int bs, int ri)

Method Summary

Modifier and TypeMethod and Description
private BlockSizeTooSmallException
pack-priv byte
pack-priv static int
commonPrefix(byte[] a, int n, byte[] b)

pack-priv static int
compare(byte[] a, int ai, int aLen, byte[] b, int bi, int bLen)

private int
computeBlockBytes(int entryBytes, boolean restart)

private static int
computeBlockBytes(int entryBytes, int restartCnt)

pack-priv int
pack-priv static int
encodeSuffixAndType(int sfx, int valueType)

private static int
estimateEntryCount(byte blockType, byte keyType, int blockLimitBytes)

pack-priv byte[]
pack-priv void
private boolean
pack-priv boolean
pack-priv static boolean
padBetweenBlocks(byte type)

pack-priv boolean
private boolean
tryAdd(BlockWriter.Entry entry, boolean tryRestart)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockLimitBytesback to summary
private final int blockLimitBytes
blockTypeback to summary
private final byte blockType
entriesback to summary
private final List<BlockWriter.Entry> entries
entriesSumBytesback to summary
private int entriesSumBytes
keyTypeback to summary
private final byte keyType
restartCntback to summary
private int restartCnt
restartIntervalback to summary
private final int restartInterval

Constructor Detail

BlockWriterback to summary
pack-priv BlockWriter(byte type, byte kt, int bs, int ri)

Method Detail

blockSizeTooSmallback to summary
private BlockSizeTooSmallException blockSizeTooSmall(BlockWriter.Entry entry)
blockTypeback to summary
pack-priv byte blockType()
commonPrefixback to summary
pack-priv static int commonPrefix(byte[] a, int n, byte[] b)
compareback to summary
pack-priv static int compare(byte[] a, int ai, int aLen, byte[] b, int bi, int bLen)
computeBlockBytesback to summary
private int computeBlockBytes(int entryBytes, boolean restart)
computeBlockBytesback to summary
private static int computeBlockBytes(int entryBytes, int restartCnt)
currentSizeback to summary
pack-priv int currentSize()
encodeSuffixAndTypeback to summary
pack-priv static int encodeSuffixAndType(int sfx, int valueType)
estimateEntryCountback to summary
private static int estimateEntryCount(byte blockType, byte keyType, int blockLimitBytes)
lastKeyback to summary
pack-priv byte[] lastKey()
mustAddback to summary
pack-priv void mustAdd(BlockWriter.Entry entry) throws BlockSizeTooSmallException
nextShouldBeRestartback to summary
private boolean nextShouldBeRestart()
padBetweenBlocksback to summary
pack-priv boolean padBetweenBlocks()
padBetweenBlocksback to summary
pack-priv static boolean padBetweenBlocks(byte type)
tryAddback to summary
pack-priv boolean tryAdd(BlockWriter.Entry entry)
tryAddback to summary
private boolean tryAdd(BlockWriter.Entry entry, boolean tryRestart)
writeToback to summary
pack-priv void writeTo(ReftableOutputStream os) throws IOException
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv Class BlockWriter.DeleteLogEntry

extends Entry
Class Inheritance

Field Summary

Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
keyprefixLenrestart

Constructor Summary

AccessConstructor and Description
pack-priv
DeleteLogEntry(String refName, long updateIndex)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
pack-priv int
pack-priv int
pack-priv void
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
comparesizeByteswriteKey

Constructor Detail

DeleteLogEntryback to summary
pack-priv DeleteLogEntry(String refName, long updateIndex)

Method Detail

blockTypeback to summary
pack-priv byte blockType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.blockType.

Annotations
@Override
valueSizeback to summary
pack-priv int valueSize()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueSize.

Annotations
@Override
valueTypeback to summary
pack-priv int valueType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueType.

Annotations
@Override
writeValueback to summary
pack-priv void writeValue(ReftableOutputStream os)

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.writeValue.

Annotations
@Override
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv abstract Class BlockWriter.Entry

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.reftable.BlockWriter.IndexEntry, org.eclipse.jgit.internal.storage.reftable.BlockWriter.RefEntry, org.eclipse.jgit.internal.storage.reftable.BlockWriter.ObjEntry, org.eclipse.jgit.internal.storage.reftable.BlockWriter.DeleteLogEntry, org.eclipse.jgit.internal.storage.reftable.BlockWriter.LogEntry

Field Summary

Modifier and TypeField and Description
pack-priv final byte[]
pack-priv int
pack-priv boolean

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(byte[] key)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract byte
pack-priv static int
pack-priv int
pack-priv abstract int
pack-priv abstract int
pack-priv void
pack-priv abstract void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
pack-priv final byte[] key
prefixLenback to summary
pack-priv int prefixLen
restartback to summary
pack-priv boolean restart

Constructor Detail

Entryback to summary
pack-priv Entry(byte[] key)

Method Detail

blockTypeback to summary
pack-priv abstract byte blockType()
compareback to summary
pack-priv static int compare(BlockWriter.Entry ea, BlockWriter.Entry eb)
sizeBytesback to summary
pack-priv int sizeBytes()
valueSizeback to summary
pack-priv abstract int valueSize()
valueTypeback to summary
pack-priv abstract int valueType()
writeKeyback to summary
pack-priv void writeKey(ReftableOutputStream os)
writeValueback to summary
pack-priv abstract void writeValue(ReftableOutputStream os) throws IOException
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv Class BlockWriter.IndexEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final long
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
keyprefixLenrestart

Constructor Summary

AccessConstructor and Description
pack-priv
IndexEntry(byte[] key, long blockPosition)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
pack-priv int
pack-priv int
pack-priv void
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
comparesizeByteswriteKey

Field Detail

blockPositionback to summary
private final long blockPosition

Constructor Detail

IndexEntryback to summary
pack-priv IndexEntry(byte[] key, long blockPosition)

Method Detail

blockTypeback to summary
pack-priv byte blockType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.blockType.

Annotations
@Override
valueSizeback to summary
pack-priv int valueSize()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueSize.

Annotations
@Override
valueTypeback to summary
pack-priv int valueType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueType.

Annotations
@Override
writeValueback to summary
pack-priv void writeValue(ReftableOutputStream os)

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.writeValue.

Annotations
@Override
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv Class BlockWriter.LogEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final byte[]
pack-priv final byte[]
pack-priv final byte[]
pack-priv final ObjectId
pack-priv final ObjectId
pack-priv final long
pack-priv final short
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
keyprefixLenrestart

Constructor Summary

AccessConstructor and Description
pack-priv
LogEntry(String refName, long updateIndex, PersonIdent who, ObjectId oldId, ObjectId newId, String message)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
pack-priv static byte[]
key(String ref, long index)

pack-priv int
pack-priv int
pack-priv void
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
comparesizeByteswriteKey

Field Detail

emailback to summary
pack-priv final byte[] email
msgback to summary
pack-priv final byte[] msg
nameback to summary
pack-priv final byte[] name
newIdback to summary
pack-priv final ObjectId newId
oldIdback to summary
pack-priv final ObjectId oldId
timeSecsback to summary
pack-priv final long timeSecs
tzback to summary
pack-priv final short tz

Constructor Detail

LogEntryback to summary
pack-priv LogEntry(String refName, long updateIndex, PersonIdent who, ObjectId oldId, ObjectId newId, String message)

Method Detail

blockTypeback to summary
pack-priv byte blockType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.blockType.

Annotations
@Override
keyback to summary
pack-priv static byte[] key(String ref, long index)
valueSizeback to summary
pack-priv int valueSize()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueSize.

Annotations
@Override
valueTypeback to summary
pack-priv int valueType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueType.

Annotations
@Override
writeValueback to summary
pack-priv void writeValue(ReftableOutputStream os)

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.writeValue.

Annotations
@Override
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv Class BlockWriter.ObjEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final LongList
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
keyprefixLenrestart

Constructor Summary

AccessConstructor and Description
pack-priv
ObjEntry(int idLen, ObjectId id, LongList blockPos)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
private static byte[]
key(int idLen, ObjectId id)

pack-priv void
pack-priv int
pack-priv int
pack-priv void
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
comparesizeByteswriteKey

Field Detail

blockPosback to summary
pack-priv final LongList blockPos

Constructor Detail

ObjEntryback to summary
pack-priv ObjEntry(int idLen, ObjectId id, LongList blockPos)

Method Detail

blockTypeback to summary
pack-priv byte blockType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.blockType.

Annotations
@Override
keyback to summary
private static byte[] key(int idLen, ObjectId id)
markScanRequiredback to summary
pack-priv void markScanRequired()
valueSizeback to summary
pack-priv int valueSize()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueSize.

Annotations
@Override
valueTypeback to summary
pack-priv int valueType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueType.

Annotations
@Override
writeValueback to summary
pack-priv void writeValue(ReftableOutputStream os) throws IOException

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.writeValue.

Annotations
@Override
org.eclipse.jgit.internal.storage.reftable back to summary

pack-priv Class BlockWriter.RefEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Ref
pack-priv final long
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
keyprefixLenrestart

Constructor Summary

AccessConstructor and Description
pack-priv
RefEntry(Ref ref, long updateIndexDelta)

Method Summary

Modifier and TypeMethod and Description
pack-priv byte
private static byte[]
pack-priv int
pack-priv int
pack-priv void
Inherited from org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry:
comparesizeByteswriteKey

Field Detail

refback to summary
pack-priv final Ref ref
updateIndexDeltaback to summary
pack-priv final long updateIndexDelta

Constructor Detail

RefEntryback to summary
pack-priv RefEntry(Ref ref, long updateIndexDelta)

Method Detail

blockTypeback to summary
pack-priv byte blockType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.blockType.

Annotations
@Override
nameUtf8back to summary
private static byte[] nameUtf8(Ref ref)
valueSizeback to summary
pack-priv int valueSize()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueSize.

Annotations
@Override
valueTypeback to summary
pack-priv int valueType()

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.valueType.

Annotations
@Override
writeValueback to summary
pack-priv void writeValue(ReftableOutputStream os) throws IOException

Implements abstract org.eclipse.jgit.internal.storage.reftable.BlockWriter.Entry.writeValue.

Annotations
@Override