Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
仟弋 committed Dec 10, 2024
1 parent 7f0442e commit 7461d43
Showing 1 changed file with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.List;

/** This class test the compatibility and effectiveness of storage thin mode. */
Expand Down Expand Up @@ -99,36 +98,25 @@ public void testAllFormatReadWrite() throws Exception {
}

private void testFormat(String format) throws Exception {
testReadWrite(format, true, true);
testReadWrite(format, true, false);
testReadWrite(format, false, true);
testReadWrite(format, false, false);
testReadWrite(format, true);
testReadWrite(format, true);
testReadWrite(format, false);
testReadWrite(format, false);
}

private void testReadWrite(String format, boolean writeThin, boolean readThin)
throws Exception {
Table tableWrite = createTable(format, writeThin);
Table tableRead = setThinMode(tableWrite, readThin);
private void testReadWrite(String format, boolean writeThin) throws Exception {
Table table = createTable(format, writeThin);

InternalRow[] datas = datas(2000);

write(tableWrite, datas);
write(table, datas);

List<InternalRow> readed = read(tableRead);
List<InternalRow> readed = read(table);

Assertions.assertThat(readed).containsExactlyInAnyOrder(datas);
dropTableDefault();
}

private Table setThinMode(Table table, Boolean flag) {
return table.copy(
new HashMap() {
{
put("storage.thin-mode", flag.toString());
}
});
}

InternalRow[] datas(int i) {
InternalRow[] arrays = new InternalRow[i];
for (int j = 0; j < i; j++) {
Expand Down Expand Up @@ -157,7 +145,7 @@ protected InternalRow data() {
randomBytes());
}

public static long tableSize(Table table) throws Exception {
public static long tableSize(Table table) {
long count = 0;
List<ManifestEntry> files =
((FileStoreTable) table).store().newScan().plan().files(FileKind.ADD);
Expand Down

0 comments on commit 7461d43

Please sign in to comment.