-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f70499
commit d80c6a0
Showing
11 changed files
with
78 additions
and
14 deletions.
There are no files selected for viewing
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
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
37 changes: 37 additions & 0 deletions
37
tieredstore/src/test/java/org/apache/rocketmq/tieredstore/TieredStoreTestUtil.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.apache.rocketmq.tieredstore; | ||
|
||
import java.lang.reflect.Field; | ||
import org.apache.rocketmq.tieredstore.container.TieredContainerManager; | ||
import org.apache.rocketmq.tieredstore.metadata.TieredMetadataStore; | ||
import org.apache.rocketmq.tieredstore.util.TieredStoreUtil; | ||
import org.junit.Assert; | ||
|
||
public class TieredStoreTestUtil { | ||
public static void destroyMetadataStore() { | ||
TieredMetadataStore metadataStore = TieredStoreUtil.getMetadataStore(null); | ||
if (metadataStore != null) { | ||
metadataStore.destroy(); | ||
} | ||
try { | ||
Field field = TieredStoreUtil.class.getDeclaredField("metadataStoreInstance"); | ||
field.setAccessible(true); | ||
field.set(null, null); | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
Assert.fail(e.getClass().getCanonicalName() + ": " + e.getMessage()); | ||
} | ||
} | ||
|
||
public static void destroyContainerManager() { | ||
TieredContainerManager containerManager = TieredContainerManager.getInstance(null); | ||
if (containerManager != null) { | ||
containerManager.cleanup(); | ||
} | ||
try { | ||
Field field = TieredContainerManager.class.getDeclaredField("instance"); | ||
field.setAccessible(true); | ||
field.set(null, null); | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
Assert.fail(e.getClass().getCanonicalName() + ": " + e.getMessage()); | ||
} | ||
} | ||
} |
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
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