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 @@ -46,10 +46,6 @@
*/
public final class RawErasureCoderBenchmark {

private RawErasureCoderBenchmark() {
// prevent instantiation
}

// target size of input data buffer
private static final int TARGET_BUFFER_SIZE_MB = 126;

Expand All @@ -61,6 +57,10 @@ private RawErasureCoderBenchmark() {
Arrays.asList(new DummyRawErasureCoderFactory(),
new RSRawErasureCoderFactory()));

private RawErasureCoderBenchmark() {
// prevent instantiation
}

enum CODER {
DUMMY_CODER("Dummy coder"),
RS_CODER("Reed-Solomon Java coder");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
* RDBStore Tests.
*/
public class TestRDBStore {

public static final int MAX_DB_UPDATES_SIZE_THRESHOLD = 80;
private final List<String> families =
Arrays.asList(StringUtils.bytes2String(RocksDB.DEFAULT_COLUMN_FAMILY),
"First", "Second", "Third",
"Fourth", "Fifth",
"Sixth");
private RDBStore rdbStore = null;
private ManagedDBOptions options;
private Set<TableConfig> configSet;

static ManagedDBOptions newManagedDBOptions() {
final ManagedDBOptions options = new ManagedDBOptions();
options.setCreateIfMissing(true);
Expand All @@ -81,16 +92,6 @@ public static RDBStore newRDBStore(File dbFile, ManagedDBOptions options,
maxDbUpdatesSizeThreshold, true, null, true);
}

public static final int MAX_DB_UPDATES_SIZE_THRESHOLD = 80;
private final List<String> families =
Arrays.asList(StringUtils.bytes2String(RocksDB.DEFAULT_COLUMN_FAMILY),
"First", "Second", "Third",
"Fourth", "Fifth",
"Sixth");
private RDBStore rdbStore = null;
private ManagedDBOptions options;
private Set<TableConfig> configSet;

@BeforeEach
public void setUp(@TempDir File tempDir) throws Exception {
CodecBuffer.enableLeakDetection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,165 @@
*/
public class TestRocksDBCheckpointDiffer {

private static final Logger LOG =
LoggerFactory.getLogger(TestRocksDBCheckpointDiffer.class);
private static final Logger LOG = LoggerFactory.getLogger(TestRocksDBCheckpointDiffer.class);

private static final List<List<String>> SST_FILES_BY_LEVEL = Arrays.asList(
Arrays.asList("000015", "000013", "000011", "000009"),
Arrays.asList("000018", "000016", "000017", "000026", "000024", "000022",
"000020"),
Arrays.asList("000027", "000030", "000028", "000029", "000031", "000039",
"000037", "000035", "000033"),
Arrays.asList("000040", "000044", "000042", "000043", "000045", "000041",
"000046", "000054", "000052", "000050", "000048"),
Arrays.asList("000059", "000055", "000056", "000060", "000057", "000058")
);

private static final List<List<CompactionNode>> COMPACTION_NODES_BY_LEVEL =
SST_FILES_BY_LEVEL.stream()
.map(sstFiles ->
sstFiles.stream()
.map(
sstFile -> new CompactionNode(sstFile,
1000L,
Long.parseLong(sstFile.substring(0, 6)),
null, null, null
))
.collect(Collectors.toList()))
.collect(Collectors.toList());

private final List<CompactionLogEntry> compactionLogEntryList = Arrays.asList(
new CompactionLogEntry(101, System.currentTimeMillis(),
Arrays.asList(
new CompactionFileInfo("000068", "/volume/bucket2",
"/volume/bucket2", "bucketTable"),
new CompactionFileInfo("000057", "/volume/bucket1",
"/volume/bucket1", "bucketTable")),
Collections.singletonList(
new CompactionFileInfo("000086", "/volume/bucket1",
"/volume/bucket2", "bucketTable")),
null),
new CompactionLogEntry(178, System.currentTimeMillis(),
Arrays.asList(new CompactionFileInfo("000078",
"/volume/bucket1/key-0000001411",
"/volume/bucket2/key-0000099649",
"keyTable"),
new CompactionFileInfo("000075",
"/volume/bucket1/key-0000016536",
"/volume/bucket2/key-0000098897",
"keyTable"),
new CompactionFileInfo("000073",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000097010",
"keyTable"),
new CompactionFileInfo("000071",
"/volume/bucket1/key-0000001820",
"/volume/bucket2/key-0000097895",
"keyTable"),
new CompactionFileInfo("000063",
"/volume/bucket1/key-0000001016",
"/volume/bucket1/key-0000099930",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000081",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000099649",
"keyTable")),
null
),
new CompactionLogEntry(233, System.currentTimeMillis(),
Arrays.asList(
new CompactionFileInfo("000086", "/volume/bucket1",
"/volume/bucket2", "bucketTable"),
new CompactionFileInfo("000088", "/volume/bucket3",
"/volume/bucket3", "bucketTable")),
Collections.singletonList(
new CompactionFileInfo("000110", "/volume/bucket1",
"/volume/bucket3", "bucketTable")
),
null),
new CompactionLogEntry(256, System.currentTimeMillis(),
Arrays.asList(new CompactionFileInfo("000081",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000099649",
"keyTable"),
new CompactionFileInfo("000103",
"/volume/bucket1/key-0000017460",
"/volume/bucket3/key-0000097450",
"keyTable"),
new CompactionFileInfo("000099",
"/volume/bucket1/key-0000002310",
"/volume/bucket3/key-0000098286",
"keyTable"),
new CompactionFileInfo("000097",
"/volume/bucket1/key-0000005965",
"/volume/bucket3/key-0000099136",
"keyTable"),
new CompactionFileInfo("000095",
"/volume/bucket1/key-0000012424",
"/volume/bucket3/key-0000083904",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000106",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable")),
null),
new CompactionLogEntry(397, now(),
Arrays.asList(new CompactionFileInfo("000106",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable"),
new CompactionFileInfo("000128",
"/volume/bucket2/key-0000005031",
"/volume/bucket3/key-0000084385",
"keyTable"),
new CompactionFileInfo("000125",
"/volume/bucket2/key-0000003491",
"/volume/bucket3/key-0000088414",
"keyTable"),
new CompactionFileInfo("000123",
"/volume/bucket2/key-0000007390",
"/volume/bucket3/key-0000094627",
"keyTable"),
new CompactionFileInfo("000121",
"/volume/bucket2/key-0000003232",
"/volume/bucket3/key-0000094246",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000131",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable")),
null
)
);

private static Map<String, String> columnFamilyToPrefixMap1 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket1/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket1/");
put("fileTable", "/volume/bucket1/");
}
};

private static Map<String, String> columnFamilyToPrefixMap2 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket2/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket2/");
put("fileTable", "/volume/bucket2/");
}
};

private static Map<String, String> columnFamilyToPrefixMap3 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket3/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket3/");
put("fileTable", "/volume/bucket3/");
}
};

private static final int NUM_ROW = 250000;
private static final int SNAPSHOT_EVERY_SO_MANY_KEYS = 49999;
Expand Down Expand Up @@ -1005,30 +1162,6 @@ private void printMutableGraphFromAGivenNode(
}
}

private static final List<List<String>> SST_FILES_BY_LEVEL = Arrays.asList(
Arrays.asList("000015", "000013", "000011", "000009"),
Arrays.asList("000018", "000016", "000017", "000026", "000024", "000022",
"000020"),
Arrays.asList("000027", "000030", "000028", "000029", "000031", "000039",
"000037", "000035", "000033"),
Arrays.asList("000040", "000044", "000042", "000043", "000045", "000041",
"000046", "000054", "000052", "000050", "000048"),
Arrays.asList("000059", "000055", "000056", "000060", "000057", "000058")
);

private static final List<List<CompactionNode>> COMPACTION_NODES_BY_LEVEL =
SST_FILES_BY_LEVEL.stream()
.map(sstFiles ->
sstFiles.stream()
.map(
sstFile -> new CompactionNode(sstFile,
1000L,
Long.parseLong(sstFile.substring(0, 6)),
null, null, null
))
.collect(Collectors.toList()))
.collect(Collectors.toList());

/**
* Creates a backward compaction DAG from a list of level nodes.
* It assumes that at each level files get compacted to the half of number
Expand Down Expand Up @@ -1703,140 +1836,6 @@ private void createFileWithContext(String fileName, String context)
}
}

private final List<CompactionLogEntry> compactionLogEntryList = Arrays.asList(
new CompactionLogEntry(101, System.currentTimeMillis(),
Arrays.asList(
new CompactionFileInfo("000068", "/volume/bucket2",
"/volume/bucket2", "bucketTable"),
new CompactionFileInfo("000057", "/volume/bucket1",
"/volume/bucket1", "bucketTable")),
Collections.singletonList(
new CompactionFileInfo("000086", "/volume/bucket1",
"/volume/bucket2", "bucketTable")),
null),
new CompactionLogEntry(178, System.currentTimeMillis(),
Arrays.asList(new CompactionFileInfo("000078",
"/volume/bucket1/key-0000001411",
"/volume/bucket2/key-0000099649",
"keyTable"),
new CompactionFileInfo("000075",
"/volume/bucket1/key-0000016536",
"/volume/bucket2/key-0000098897",
"keyTable"),
new CompactionFileInfo("000073",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000097010",
"keyTable"),
new CompactionFileInfo("000071",
"/volume/bucket1/key-0000001820",
"/volume/bucket2/key-0000097895",
"keyTable"),
new CompactionFileInfo("000063",
"/volume/bucket1/key-0000001016",
"/volume/bucket1/key-0000099930",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000081",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000099649",
"keyTable")),
null
),
new CompactionLogEntry(233, System.currentTimeMillis(),
Arrays.asList(
new CompactionFileInfo("000086", "/volume/bucket1",
"/volume/bucket2", "bucketTable"),
new CompactionFileInfo("000088", "/volume/bucket3",
"/volume/bucket3", "bucketTable")),
Collections.singletonList(
new CompactionFileInfo("000110", "/volume/bucket1",
"/volume/bucket3", "bucketTable")
),
null),
new CompactionLogEntry(256, System.currentTimeMillis(),
Arrays.asList(new CompactionFileInfo("000081",
"/volume/bucket1/key-0000000730",
"/volume/bucket2/key-0000099649",
"keyTable"),
new CompactionFileInfo("000103",
"/volume/bucket1/key-0000017460",
"/volume/bucket3/key-0000097450",
"keyTable"),
new CompactionFileInfo("000099",
"/volume/bucket1/key-0000002310",
"/volume/bucket3/key-0000098286",
"keyTable"),
new CompactionFileInfo("000097",
"/volume/bucket1/key-0000005965",
"/volume/bucket3/key-0000099136",
"keyTable"),
new CompactionFileInfo("000095",
"/volume/bucket1/key-0000012424",
"/volume/bucket3/key-0000083904",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000106",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable")),
null),
new CompactionLogEntry(397, now(),
Arrays.asList(new CompactionFileInfo("000106",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable"),
new CompactionFileInfo("000128",
"/volume/bucket2/key-0000005031",
"/volume/bucket3/key-0000084385",
"keyTable"),
new CompactionFileInfo("000125",
"/volume/bucket2/key-0000003491",
"/volume/bucket3/key-0000088414",
"keyTable"),
new CompactionFileInfo("000123",
"/volume/bucket2/key-0000007390",
"/volume/bucket3/key-0000094627",
"keyTable"),
new CompactionFileInfo("000121",
"/volume/bucket2/key-0000003232",
"/volume/bucket3/key-0000094246",
"keyTable")),
Collections.singletonList(new CompactionFileInfo("000131",
"/volume/bucket1/key-0000000730",
"/volume/bucket3/key-0000099136",
"keyTable")),
null
)
);

private static Map<String, String> columnFamilyToPrefixMap1 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket1/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket1/");
put("fileTable", "/volume/bucket1/");
}
};

private static Map<String, String> columnFamilyToPrefixMap2 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket2/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket2/");
put("fileTable", "/volume/bucket2/");
}
};

private static Map<String, String> columnFamilyToPrefixMap3 =
new HashMap<String, String>() {
{
put("keyTable", "/volume/bucket3/");
// Simply using bucketName instead of ID for the test.
put("directoryTable", "/volume/bucket3/");
put("fileTable", "/volume/bucket3/");
}
};

/**
* Test cases for testGetSSTDiffListWithoutDB.
*/
Expand Down
Loading