diff --git a/fe/fe-core/src/main/java/com/starrocks/journal/Journal.java b/fe/fe-core/src/main/java/com/starrocks/journal/Journal.java index 346cf88ec513c..8738eed422560 100644 --- a/fe/fe-core/src/main/java/com/starrocks/journal/Journal.java +++ b/fe/fe-core/src/main/java/com/starrocks/journal/Journal.java @@ -63,4 +63,6 @@ public interface Journal { // abort current batch public void batchWriteAbort() throws InterruptedException, JournalException; + + public String getPrefix(); } diff --git a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBEnvironment.java b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBEnvironment.java index 772b97ec39c79..2ada0ef04ffd8 100644 --- a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBEnvironment.java +++ b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBEnvironment.java @@ -21,6 +21,7 @@ package com.starrocks.journal.bdbje; +import com.google.common.base.Strings; import com.google.common.net.HostAndPort; import com.sleepycat.je.DatabaseConfig; import com.sleepycat.je.DatabaseException; @@ -52,6 +53,7 @@ import com.starrocks.ha.HAProtocol; import com.starrocks.journal.JournalException; import com.starrocks.server.GlobalStateMgr; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -562,10 +564,14 @@ public void removeDatabase(String dbName) { } } + public List getDatabaseNames() { + return getDatabaseNamesWithPrefix(""); + } + // get journal db names and sort the names // let the caller retry from outside. // return null only if environment is closing - public List getDatabaseNames() { + public List getDatabaseNamesWithPrefix(String prefix) { if (closing) { return null; } @@ -578,8 +584,26 @@ public List getDatabaseNames() { continue; } - long db = Long.parseLong(name); - ret.add(db); + if (Strings.isNullOrEmpty(prefix)) { // default GlobalStateMgr db + if (StringUtils.isNumeric(name)) { + long db = Long.parseLong(name); + ret.add(db); + } else { + // skip non default GlobalStateMgr db + } + } else { + if (name.startsWith(prefix)) { + String dbStr = name.substring(prefix.length()); + if (StringUtils.isNumeric(dbStr)) { + long db = Long.parseLong(dbStr); + ret.add(db); + } else { + // prefix does not fully match, ignore + } + } else { + // prefix does not match, ignore + } + } } Collections.sort(ret); diff --git a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJEJournal.java b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJEJournal.java index fb8ee789217ef..4120e3df55868 100644 --- a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJEJournal.java +++ b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJEJournal.java @@ -56,6 +56,8 @@ public class BDBJEJournal implements Journal { private BDBEnvironment bdbEnvironment = null; private CloseSafeDatabase currentJournalDB; protected Transaction currentTrasaction = null; + // used to distinguish different module's db in BDB, must be empty or end with '_' + private final String prefix; // store uncommitted kv, used for rebuilding txn on commit fails private List> uncommitedDatas = new ArrayList<>(); @@ -64,10 +66,21 @@ public class BDBJEJournal implements Journal { public BDBJEJournal(BDBEnvironment bdbEnvironment, CloseSafeDatabase currentJournalDB) { this.bdbEnvironment = bdbEnvironment; this.currentJournalDB = currentJournalDB; + this.prefix = ""; } public BDBJEJournal(BDBEnvironment bdbEnvironment) { + this(bdbEnvironment, "" /* prefix */); + } + + public BDBJEJournal(BDBEnvironment bdbEnvironment, String prefix) { this.bdbEnvironment = bdbEnvironment; + assert prefix.isEmpty() || prefix.charAt(prefix.length() - 1) == '_'; + this.prefix = prefix; + } + + public String getPrefix() { + return prefix; } /* @@ -84,11 +97,16 @@ public void rollJournal(long newName) throws JournalException { } String currentDbName = currentJournalDB.getDb().getDatabaseName(); - long currentName = Long.parseLong(currentDbName); + String currentIdStr = currentDbName; + if (!prefix.isEmpty()) { // remove prefix + currentIdStr = currentDbName.substring(prefix.length()); + } + long currentName = Long.parseLong(currentIdStr); long newNameVerify = currentName + currentJournalDB.getDb().count(); if (newName == newNameVerify) { - LOG.info("roll edit log. new db name is {}", newName); - currentJournalDB = bdbEnvironment.openDatabase(Long.toString(newName)); + String newDbName = getFullDatabaseName(newName); + LOG.info("roll edit log. new db name is {}", newDbName); + currentJournalDB = bdbEnvironment.openDatabase(newDbName); } else { String msg = String.format("roll journal error! journalId and db journal numbers is not match. " + "journal id: %d, current db: %s, expected db count: %d", @@ -100,7 +118,7 @@ public void rollJournal(long newName) throws JournalException { @Override public JournalCursor read(long fromKey, long toKey) throws JournalException { - return BDBJournalCursor.getJournalCursor(bdbEnvironment, fromKey, toKey); + return BDBJournalCursor.getJournalCursor(bdbEnvironment, prefix, fromKey, toKey); } @Override @@ -109,13 +127,13 @@ public long getMaxJournalId() { if (bdbEnvironment == null) { return ret; } - List dbNames = bdbEnvironment.getDatabaseNames(); + List dbNames = bdbEnvironment.getDatabaseNamesWithPrefix(prefix); if (dbNames == null || dbNames.size() == 0) { return ret; } int index = dbNames.size() - 1; - String dbName = dbNames.get(index).toString(); + String dbName = getFullDatabaseName(dbNames.get(index)); long dbNumberName = dbNames.get(index); Database database = bdbEnvironment.openDatabase(dbName).getDb(); ret = dbNumberName + database.count() - 1; @@ -129,12 +147,12 @@ public long getMinJournalId() { if (bdbEnvironment == null) { return ret; } - List dbNames = bdbEnvironment.getDatabaseNames(); + List dbNames = bdbEnvironment.getDatabaseNamesWithPrefix(prefix); if (dbNames == null || dbNames.size() == 0) { return ret; } - String dbName = dbNames.get(0).toString(); + String dbName = getFullDatabaseName(dbNames.get(0)); Database database = bdbEnvironment.openDatabase(dbName).getDb(); // The database is empty if (database.count() == 0) { @@ -167,7 +185,7 @@ public synchronized void open() throws InterruptedException, JournalException { Thread.sleep(SLEEP_INTERVAL_SEC * 1000L); } - dbNames = bdbEnvironment.getDatabaseNames(); + dbNames = bdbEnvironment.getDatabaseNamesWithPrefix(prefix); if (dbNames == null) { // bdb environment is closing throw new JournalException("fail to get dbNames while open bdbje journal. will exit"); } @@ -180,11 +198,11 @@ public synchronized void open() throws InterruptedException, JournalException { * here we should open database with name image max journal id + 1. * (default GlobalStateMgr.getCurrentState().getReplayedJournalId() is 0) */ - dbName = Long.toString(GlobalStateMgr.getCurrentState().getReplayedJournalId() + 1); + dbName = getFullDatabaseName(GlobalStateMgr.getCurrentState().getReplayedJournalId() + 1); LOG.info("the very first time to open bdb, dbname is {}", dbName); } else { // get last database as current journal database - dbName = dbNames.get(dbNames.size() - 1).toString(); + dbName = getFullDatabaseName(dbNames.get(dbNames.size() - 1)); } currentJournalDB = bdbEnvironment.openDatabase(dbName); @@ -207,7 +225,7 @@ public synchronized void open() throws InterruptedException, JournalException { @Override public void deleteJournals(long deleteToJournalId) { - List dbNames = bdbEnvironment.getDatabaseNames(); + List dbNames = bdbEnvironment.getDatabaseNamesWithPrefix(prefix); if (dbNames == null) { LOG.info("delete database names is null."); return; @@ -223,9 +241,9 @@ public void deleteJournals(long deleteToJournalId) { for (int i = 1; i < dbNames.size(); i++) { if (deleteToJournalId >= dbNames.get(i)) { long name = dbNames.get(i - 1); - String stringName = Long.toString(name); - LOG.info("delete database name {}", stringName); - bdbEnvironment.removeDatabase(stringName); + String dbName = getFullDatabaseName(name); + LOG.info("delete database name {}", dbName); + bdbEnvironment.removeDatabase(dbName); } else { LOG.info("database name {} is larger than deleteToJournalId {}, not delete", dbNames.get(i), deleteToJournalId); @@ -236,7 +254,7 @@ public void deleteJournals(long deleteToJournalId) { @Override public long getFinalizedJournalId() { - List dbNames = bdbEnvironment.getDatabaseNames(); + List dbNames = bdbEnvironment.getDatabaseNamesWithPrefix(prefix); assert (dbNames != null); String msg = "database names: "; @@ -258,7 +276,7 @@ public List getDatabaseNames() { return null; } - return bdbEnvironment.getDatabaseNames(); + return bdbEnvironment.getDatabaseNamesWithPrefix(prefix); } public BDBEnvironment getBdbEnvironment() { @@ -459,4 +477,7 @@ public void batchWriteAbort() throws InterruptedException, JournalException { } } + private String getFullDatabaseName(long dbId) { + return prefix + Long.toString(dbId); + } } diff --git a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJournalCursor.java b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJournalCursor.java index 2eb317d085b9f..daeb603131a4b 100644 --- a/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJournalCursor.java +++ b/fe/fe-core/src/main/java/com/starrocks/journal/bdbje/BDBJournalCursor.java @@ -51,20 +51,31 @@ public class BDBJournalCursor implements JournalCursor { private List dbNames; private CloseSafeDatabase database; private int nextDbPositionIndex; + private String prefix; public static BDBJournalCursor getJournalCursor(BDBEnvironment env, long fromKey, long toKey) throws JournalException { + return new BDBJournalCursor(env, "", fromKey, toKey); + } + + public static BDBJournalCursor getJournalCursor(BDBEnvironment env, String prefix, long fromKey, long toKey) throws + JournalException { if (toKey < fromKey || fromKey < 0) { throw new JournalException(String.format("Invalid key range! fromKey %s toKey %s", fromKey, toKey)); } - return new BDBJournalCursor(env, fromKey, toKey); + return new BDBJournalCursor(env, prefix, fromKey, toKey); } protected BDBJournalCursor(BDBEnvironment env, long fromKey, long toKey) throws JournalException { + this(env, "", fromKey, toKey); + } + + protected BDBJournalCursor(BDBEnvironment env, String prefix, long fromKey, long toKey) throws JournalException { this.environment = env; this.toKey = toKey; this.currentKey = fromKey; - this.dbNames = env.getDatabaseNames(); + this.prefix = prefix; + this.dbNames = env.getDatabaseNamesWithPrefix(prefix); if (dbNames == null) { throw new JournalException("failed to get db names!"); } @@ -101,7 +112,7 @@ protected void openDatabaseIfNecessary() throws InterruptedException, JournalExc return; } - String dbName = Long.toString(dbNames.get(nextDbPositionIndex)); + String dbName = prefix + Long.toString(dbNames.get(nextDbPositionIndex)); JournalException exception = null; for (int i = 0; i < RETRY_TIME; ++ i) { try { diff --git a/fe/fe-core/src/test/java/com/starrocks/journal/JournalWriterTest.java b/fe/fe-core/src/test/java/com/starrocks/journal/JournalWriterTest.java index b00f23eae4c44..c0af2e320c06c 100644 --- a/fe/fe-core/src/test/java/com/starrocks/journal/JournalWriterTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/journal/JournalWriterTest.java @@ -20,7 +20,7 @@ public class JournalWriterTest { @Mocked - private Journal journal = new BDBJEJournal(null, null); + private Journal journal = new BDBJEJournal(null); private BlockingQueue journalQueue = new ArrayBlockingQueue<>(100); private JournalWriter writer = new JournalWriter(journal, journalQueue); /** diff --git a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBEnvironmentTest.java b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBEnvironmentTest.java index 522f312560f21..40911e90d98a8 100644 --- a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBEnvironmentTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBEnvironmentTest.java @@ -9,6 +9,8 @@ import com.starrocks.common.Config; import com.starrocks.common.util.NetUtils; import com.starrocks.journal.JournalException; +import mockit.Mock; +import mockit.MockUp; import org.apache.commons.io.FileUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -482,4 +484,49 @@ protected void testAddBadFollowerBase(boolean failover) throws Exception { LOG.warn("==============> getDatabasesNames() {}", masterEnvironment.getDatabaseNames()); } } + + @Test + public void testGetDatabase() throws Exception { + String selfNodeHostPort = findUnbindHostPort(); + BDBEnvironment environment = new BDBEnvironment( + createTmpDir(), + "standalone", + selfNodeHostPort, + selfNodeHostPort, + true); + environment.setup(); + + new MockUp() { + @Mock + public List getDatabaseNames() { + List list = new ArrayList<>(); + list.add("1001"); + list.add("2001"); + list.add("aaa_3001"); + list.add("aaa_4001"); + list.add("aaa_bbb_"); + return list; + } + }; + + List l1 = environment.getDatabaseNamesWithPrefix(""); + Assert.assertEquals(2, l1.size()); + Assert.assertEquals((Long) 1001L, l1.get(0)); + Assert.assertEquals((Long) 2001L, l1.get(1)); + + List l2 = environment.getDatabaseNamesWithPrefix("aaa_"); + Assert.assertEquals(2, l2.size()); + Assert.assertEquals((Long) 3001L, l2.get(0)); + Assert.assertEquals((Long) 4001L, l2.get(1)); + + // prefix not fully match + List l3 = environment.getDatabaseNamesWithPrefix("aaa"); + Assert.assertEquals(0, l3.size()); + + // prefix not match + List l4 = environment.getDatabaseNamesWithPrefix("bbb_"); + Assert.assertEquals(0, l4.size()); + + environment.close(); + } } diff --git a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJEJournalTest.java b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJEJournalTest.java index aa6c74574209f..70229df739fef 100644 --- a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJEJournalTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJEJournalTest.java @@ -38,6 +38,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; public class BDBJEJournalTest { private static final Logger LOG = LogManager.getLogger(BDBJEJournalTest.class); @@ -487,7 +488,7 @@ public void testOpenFirstTime( new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = new ArrayList(); @@ -508,7 +509,7 @@ public void testOpenNormal(@Mocked CloseSafeDatabase database, new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = Arrays.asList(3L, 23L, 45L); @@ -526,7 +527,7 @@ public void testOpenNormal(@Mocked CloseSafeDatabase database, public void testOpenGetNamesFails(@Mocked BDBEnvironment environment) throws Exception { new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = null; } @@ -547,7 +548,7 @@ public void testOpenFailManyTimes(@Mocked BDBEnvironment environment) throws Exc }; new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = BDBJEJournal.RETRY_TIME; result = new DatabaseNotFoundException("mock mock"); } @@ -569,7 +570,7 @@ public void testOpenDbFailRetrySucceed(@Mocked CloseSafeDatabase database, }; new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 3; result = Arrays.asList(3L, 23L, 45L); @@ -591,7 +592,7 @@ public void testDeleteJournals(@Mocked BDBEnvironment environment) throws Excep // failed to get database names; do nothing new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = null; } @@ -602,7 +603,7 @@ public void testDeleteJournals(@Mocked BDBEnvironment environment) throws Excep // current db (3, 23, 45) checkpoint is made on 44, should remove 3, 23 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = Arrays.asList(3L, 23L, 45L); @@ -624,7 +625,7 @@ public void testGetMaxJournalId(@Mocked CloseSafeDatabase closeSafeDatabase, // failed to get database names; return -1 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = null; } @@ -634,7 +635,7 @@ public void testGetMaxJournalId(@Mocked CloseSafeDatabase closeSafeDatabase, // no databases; return -1 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = new ArrayList<>(); } @@ -644,7 +645,7 @@ public void testGetMaxJournalId(@Mocked CloseSafeDatabase closeSafeDatabase, // db 3, 23, 45; open 45 get its size 10 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); times = 1; result = Arrays.asList(3L, 23L, 45L); @@ -756,4 +757,64 @@ public void write(DataOutput out) throws IOException { Assert.assertEquals(4, journal.getMaxJournalId()); Assert.assertEquals(1, journal.getMinJournalId()); } + + @Test + public void testJournalWithPrefix() throws Exception { + String data = "petals on a wet black bough"; + Writable writable = new Writable() { + @Override + public void write(DataOutput out) throws IOException { + Text.writeString(out, data); + } + }; + DataOutputBuffer buffer = new DataOutputBuffer(); + writable.write(buffer); + + BDBEnvironment environment = initBDBEnv("testJournalWithPrefix"); + + // test journal with prefix works fine + { + BDBJEJournal journalWithPrefix = new BDBJEJournal(environment, "aaa_"); + Assert.assertEquals("aaa_", journalWithPrefix.getPrefix()); + journalWithPrefix.open(); + journalWithPrefix.batchWriteBegin(); + journalWithPrefix.batchWriteAppend(1, buffer); + journalWithPrefix.batchWriteAppend(2, buffer); + journalWithPrefix.batchWriteCommit(); + + journalWithPrefix.rollJournal(3); + journalWithPrefix.open(); + journalWithPrefix.batchWriteBegin(); + journalWithPrefix.batchWriteAppend(3, buffer); + journalWithPrefix.batchWriteAppend(4, buffer); + journalWithPrefix.batchWriteCommit(); + + List l = journalWithPrefix.getDatabaseNames(); + Assert.assertEquals(2, l.size()); + Assert.assertEquals((Long) 1L, l.get(0)); + Assert.assertEquals((Long) 3L, l.get(1)); + } + + // test journal without prefix works fine at the same time + { + BDBJEJournal journalWithoutPrefix = new BDBJEJournal(environment); + journalWithoutPrefix.open(); + journalWithoutPrefix.batchWriteBegin(); + journalWithoutPrefix.batchWriteAppend(1, buffer); + journalWithoutPrefix.batchWriteAppend(2, buffer); + journalWithoutPrefix.batchWriteCommit(); + + journalWithoutPrefix.rollJournal(3); + journalWithoutPrefix.open(); + journalWithoutPrefix.batchWriteBegin(); + journalWithoutPrefix.batchWriteAppend(3, buffer); + journalWithoutPrefix.batchWriteAppend(4, buffer); + journalWithoutPrefix.batchWriteCommit(); + + List l = journalWithoutPrefix.getDatabaseNames(); + Assert.assertEquals(2, l.size()); + Assert.assertEquals((Long) 1L, l.get(0)); + Assert.assertEquals((Long) 3L, l.get(1)); + } + } } diff --git a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJournalCursorTest.java b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJournalCursorTest.java index 3c54fd01ed06a..f15c934e28a83 100644 --- a/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJournalCursorTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/journal/bdbje/BDBJournalCursorTest.java @@ -66,7 +66,7 @@ public void testNormal() throws Exception { times = 1; result = database; - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); } @@ -150,7 +150,7 @@ public void testReadFailedRetriedSucceed() throws Exception { times = 1; result = database; - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); } @@ -194,7 +194,7 @@ public void testNotFoundAfterFailover() throws Exception { times = 1; result = database; - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); } @@ -217,7 +217,7 @@ public void testOpenDBFailedAndRetry() throws Exception { // from 12->13 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); @@ -238,7 +238,7 @@ public void testOpenDBFailedEvenAfterRetry() throws Exception { // from 12->13 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); @@ -265,7 +265,7 @@ public void testOpenDBFailedOnInsufficientLogException() throws Exception { // from 12->13 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); @@ -293,7 +293,7 @@ public void testBadData() throws Exception { times = 1; result = database; - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); } @@ -323,7 +323,7 @@ public void testNextFailedOnInsufficientLogException() throws Exception { // from 12->13 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); @@ -353,7 +353,7 @@ public void testNextFailedOnInsufficientLogException() throws Exception { public void testDatabaseNamesFails() throws Exception { new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = null; } @@ -374,7 +374,7 @@ public void testInvalidKeyRange() throws Exception { // from 9,9 new Expectations(environment) { { - environment.getDatabaseNames(); + environment.getDatabaseNamesWithPrefix(""); minTimes = 0; result = Arrays.asList(Long.valueOf(10), Long.valueOf(12)); } diff --git a/fe/fe-core/src/test/java/com/starrocks/utframe/MockJournal.java b/fe/fe-core/src/test/java/com/starrocks/utframe/MockJournal.java index ccdd6b621cafd..e65cef4f8c0f6 100644 --- a/fe/fe-core/src/test/java/com/starrocks/utframe/MockJournal.java +++ b/fe/fe-core/src/test/java/com/starrocks/utframe/MockJournal.java @@ -111,6 +111,11 @@ public void batchWriteAbort() throws InterruptedException, JournalException { staggingEntityMap.clear(); } + @Override + public String getPrefix() { + return ""; + } + private static class MockJournalCursor implements JournalCursor { private final MockJournal instance; private long start;