-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor KeyBytesEncoder to use ColumnVisitor instead of ValueVisitor
- Loading branch information
Showing
11 changed files
with
101 additions
and
113 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
core/src/main/java/com/scalar/db/storage/dynamo/bytes/BytesEncoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
package com.scalar.db.storage.dynamo.bytes; | ||
|
||
import com.scalar.db.api.Scan.Ordering.Order; | ||
import com.scalar.db.io.Value; | ||
import com.scalar.db.io.Column; | ||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* A bytes-encoder that encodes a value to bytes while preserving the sort order. | ||
* A bytes-encoder that encodes a column to bytes while preserving the sort order. | ||
* | ||
* @param <T> the value type | ||
*/ | ||
public interface BytesEncoder<T extends Value<?>> { | ||
public interface BytesEncoder<T extends Column<?>> { | ||
|
||
/** | ||
* Calculates the encoded bytes length. | ||
* | ||
* @param value a value | ||
* @param column a column | ||
* @param order an order | ||
* @return the encoded bytes length | ||
*/ | ||
int encodedLength(T value, Order order); | ||
int encodedLength(T column, Order order); | ||
|
||
/** | ||
* Encodes the value to bytes | ||
* Encodes the column to bytes | ||
* | ||
* @param value a value | ||
* @param column a column | ||
* @param order an order | ||
* @param dst a ByteBuffer to write the encoded bytes | ||
*/ | ||
void encode(T value, Order order, ByteBuffer dst); | ||
void encode(T column, Order order, ByteBuffer dst); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 19 additions & 19 deletions
38
core/src/main/java/com/scalar/db/storage/dynamo/bytes/KeyBytesEncodedLengthCalculator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.