Skip to content

Commit

Permalink
[flink] Fix cache size in GlobalIndexAssigner
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Sep 7, 2023
1 parent c706b56 commit ed3b5db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.data.InternalRow;
import org.apache.paimon.data.serializer.RowCompactedSerializer;
import org.apache.paimon.flink.RocksDBOptions;
import org.apache.paimon.flink.lookup.RocksDBStateFactory;
import org.apache.paimon.flink.lookup.RocksDBValueState;
import org.apache.paimon.options.Options;
Expand Down Expand Up @@ -106,14 +107,13 @@ public void open(File tmpDir, int numAssigners, int assignId, BiConsumer<T, Inte
Options options = coreOptions.toConfiguration();
this.path = new File(tmpDir, "lookup-" + UUID.randomUUID());
this.stateFactory = new RocksDBStateFactory(path.toString(), options);
long cacheSize = options.get(CoreOptions.LOOKUP_CACHE_MAX_MEMORY_SIZE).getBytes();
RowType keyType = table.schema().logicalTrimmedPrimaryKeysType();
this.keyIndex =
stateFactory.valueState(
"keyIndex",
new RowCompactedSerializer(keyType),
new PositiveIntIntSerializer(),
cacheSize);
options.get(RocksDBOptions.LOOKUP_CACHE_ROWS));

this.partMapping = new IDMapping<>(BinaryRow::copy);
this.bucketAssigner = new BucketAssigner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Set root logger level to OFF to not flood build logs
# set manually to INFO for debugging purposes
rootLogger.level = OFF
rootLogger.level = INFO
rootLogger.appenderRef.test.ref = TestLogger

appender.testlogger.name = TestLogger
Expand Down

0 comments on commit ed3b5db

Please sign in to comment.