Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,8 @@ interface KeyValue<KEY, VALUE> {

VALUE getValue() throws IOException;

default byte[] getRawKey() throws IOException {
return null;
}

default byte[] getRawValue() throws IOException {
return null;
default int getRawSize() throws IOException {
return 0;
}
}

Expand Down Expand Up @@ -383,7 +379,7 @@ public int hashCode() {
};
}

static <K, V> KeyValue<K, V> newKeyValue(K key, V value, byte[] rawKey, byte[] rawValue) {
static <K, V> KeyValue<K, V> newKeyValue(K key, V value, int rawSize) {
return new KeyValue<K, V>() {
@Override
public K getKey() {
Expand All @@ -396,13 +392,8 @@ public V getValue() {
}

@Override
public byte[] getRawKey() throws IOException {
return rawKey;
}

@Override
public byte[] getRawValue() throws IOException {
return rawValue;
public int getRawSize() throws IOException {
return rawSize;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,9 @@ public CodecBuffer get() {
@Override
KeyValue<KEY, VALUE> convert(KeyValue<CodecBuffer, CodecBuffer> raw)
throws IOException {
CodecBuffer keyCodecBuffer = raw.getKey();
final KEY key = keyCodec.fromCodecBuffer(keyCodecBuffer);
CodecBuffer valueCodecBuffer = raw.getValue();
final VALUE value = valueCodec.fromCodecBuffer(valueCodecBuffer);
return Table.newKeyValue(key, value, keyCodecBuffer.getArray(), valueCodecBuffer.getArray());
final KEY key = keyCodec.fromCodecBuffer(raw.getKey());
final VALUE value = valueCodec.fromCodecBuffer(raw.getValue());
return Table.newKeyValue(key, value, raw.getRawSize());
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,7 @@ private DeleteKeysResult gatherSubDirsWithIterator(OmKeyInfo parentInfo,
while (iterator.hasNext() && remainingBufLimit > 0) {
Table.KeyValue<String, OmDirectoryInfo> entry = iterator.next();
OmDirectoryInfo dirInfo = entry.getValue();
long objectSerializedSize = entry.getRawValue().length;
long objectSerializedSize = entry.getRawSize();
if (!OMFileRequest.isImmediateChild(dirInfo.getParentObjectID(),
parentInfo.getObjectID())) {
processedSubDirs = true;
Expand Down Expand Up @@ -2149,7 +2149,7 @@ public DeleteKeysResult getPendingDeletionSubFiles(long volumeId,
while (iterator.hasNext() && remainingBufLimit > 0) {
Table.KeyValue<String, OmKeyInfo> entry = iterator.next();
OmKeyInfo fileInfo = entry.getValue();
long objectSerializedSize = entry.getRawValue().length;
long objectSerializedSize = entry.getRawSize();
if (!OMFileRequest.isImmediateChild(fileInfo.getParentObjectID(),
parentInfo.getObjectID())) {
processedSubFiles = true;
Expand Down