use of alluxio.master.metastore.heap.HeapInodeStore in project alluxio by Alluxio.
the class InodeTreeBufferedIteratorTest method before.
@Before
public void before() {
mInodeStore = new HeapInodeStore();
mExpected = ExpectedException.none();
}
use of alluxio.master.metastore.heap.HeapInodeStore in project alluxio by Alluxio.
the class InodeStoreBench method main.
public static void main(String[] args) throws Exception {
// Enable logging to stdout.
Layout layout = new PatternLayout("%d [%t] %-5p %c %x - %m%n");
Logger.getRootLogger().addAppender(new ConsoleAppender(layout));
System.out.printf("Running benchmarks for rocks inode store%n");
sStore = new RocksInodeStore(ServerConfiguration.getString(PropertyKey.MASTER_METASTORE_DIR));
runBenchmarks();
System.out.printf("%nRunning benchmarks for heap inode store%n");
sStore = new HeapInodeStore();
runBenchmarks();
}
use of alluxio.master.metastore.heap.HeapInodeStore in project alluxio by Alluxio.
the class TableMasterFactoryTest method before.
@Before
public void before() {
mContext = CoreMasterContext.newBuilder().setJournalSystem(new NoopJournalSystem()).setSafeModeManager(new TestSafeModeManager()).setBackupManager(mock(BackupManager.class)).setBlockStoreFactory(HeapBlockStore::new).setInodeStoreFactory(x -> new HeapInodeStore()).setUfsManager(new MasterUfsManager()).build();
ServerConfiguration.set(PropertyKey.MASTER_JOURNAL_FOLDER, sTemp.getRoot().getAbsolutePath());
}
use of alluxio.master.metastore.heap.HeapInodeStore in project alluxio by Alluxio.
the class BackupManagerTest method rocksBlockStoreIteratorClosed.
@Test
public void rocksBlockStoreIteratorClosed() throws Exception {
// Prepare some data for the iterator
List<BlockStore.Block> blocks = new ArrayList<>();
blocks.add(createNewBlock(1L));
blocks.add(createNewBlock(2L));
blocks.add(createNewBlock(3L));
// When RocksBlockStore.iterator(), return mock iterator
AtomicBoolean blockIteratorClosed = new AtomicBoolean(false);
CloseableIterator<BlockStore.Block> testBlockIter = CloseableIterator.create(blocks.iterator(), (whatever) -> blockIteratorClosed.set(true));
RocksBlockStore mockBlockStore = mock(RocksBlockStore.class);
when(mockBlockStore.iterator()).thenReturn(testBlockIter);
// Prepare the BlockMaster for the backup operation
CoreMasterContext masterContext = MasterTestUtils.testMasterContext(new NoopJournalSystem(), null, () -> mockBlockStore, x -> new HeapInodeStore());
mMetricsMaster = new MetricsMasterFactory().create(mRegistry, masterContext);
mBlockMaster = new DefaultBlockMaster(mMetricsMaster, masterContext, mClock, ExecutorServiceFactories.constantExecutorServiceFactory(mExecutorService));
mRegistry.add(BlockMaster.class, mBlockMaster);
mRegistry.start(true);
// Perform the backup operation
BackupManager manager = new BackupManager(mRegistry);
File backupDir = AlluxioTestDirectory.createTemporaryDirectory("backup-dir");
File backupFile = new File(backupDir, "1.backup");
AtomicLong counter = new AtomicLong(0L);
manager.backup(new FileOutputStream(backupFile), counter);
// verify iterators all closed properly
assertTrue(blockIteratorClosed.get());
}
Aggregations