Search in sources :

Example 1 with HeapInodeStore

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();
}
Also used : HeapInodeStore(alluxio.master.metastore.heap.HeapInodeStore) Before(org.junit.Before)

Example 2 with HeapInodeStore

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();
}
Also used : ConsoleAppender(org.apache.log4j.ConsoleAppender) RocksInodeStore(alluxio.master.metastore.rocks.RocksInodeStore) Layout(org.apache.log4j.Layout) PatternLayout(org.apache.log4j.PatternLayout) PatternLayout(org.apache.log4j.PatternLayout) HeapInodeStore(alluxio.master.metastore.heap.HeapInodeStore)

Example 3 with HeapInodeStore

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());
}
Also used : ServerConfiguration(alluxio.conf.ServerConfiguration) MasterUfsManager(alluxio.underfs.MasterUfsManager) NoopJournalSystem(alluxio.master.journal.noop.NoopJournalSystem) Assert.assertTrue(org.junit.Assert.assertTrue) Server(alluxio.Server) Set(java.util.Set) Test(org.junit.Test) BackupManager(alluxio.master.BackupManager) HeapBlockStore(alluxio.master.metastore.heap.HeapBlockStore) PropertyKey(alluxio.conf.PropertyKey) Collectors(java.util.stream.Collectors) HeapInodeStore(alluxio.master.metastore.heap.HeapInodeStore) Constants(alluxio.Constants) Assert.assertFalse(org.junit.Assert.assertFalse) TestSafeModeManager(alluxio.master.TestSafeModeManager) After(org.junit.After) CoreMasterContext(alluxio.master.CoreMasterContext) MasterRegistry(alluxio.master.MasterRegistry) ClassRule(org.junit.ClassRule) MasterUtils(alluxio.master.MasterUtils) TemporaryFolder(org.junit.rules.TemporaryFolder) Mockito.mock(org.mockito.Mockito.mock) Before(org.junit.Before) TestSafeModeManager(alluxio.master.TestSafeModeManager) HeapBlockStore(alluxio.master.metastore.heap.HeapBlockStore) NoopJournalSystem(alluxio.master.journal.noop.NoopJournalSystem) MasterUfsManager(alluxio.underfs.MasterUfsManager) HeapInodeStore(alluxio.master.metastore.heap.HeapInodeStore) Before(org.junit.Before)

Example 4 with HeapInodeStore

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());
}
Also used : DefaultBlockMaster(alluxio.master.block.DefaultBlockMaster) ArrayList(java.util.ArrayList) NoopJournalSystem(alluxio.master.journal.noop.NoopJournalSystem) RocksBlockStore(alluxio.master.metastore.rocks.RocksBlockStore) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicLong(java.util.concurrent.atomic.AtomicLong) FileOutputStream(java.io.FileOutputStream) Block(alluxio.proto.meta.Block) File(java.io.File) MutableInodeFile(alluxio.master.file.meta.MutableInodeFile) HeapInodeStore(alluxio.master.metastore.heap.HeapInodeStore) MetricsMasterFactory(alluxio.master.metrics.MetricsMasterFactory) Test(org.junit.Test)

Aggregations

HeapInodeStore (alluxio.master.metastore.heap.HeapInodeStore)4 NoopJournalSystem (alluxio.master.journal.noop.NoopJournalSystem)2 Before (org.junit.Before)2 Test (org.junit.Test)2 Constants (alluxio.Constants)1 Server (alluxio.Server)1 PropertyKey (alluxio.conf.PropertyKey)1 ServerConfiguration (alluxio.conf.ServerConfiguration)1 BackupManager (alluxio.master.BackupManager)1 CoreMasterContext (alluxio.master.CoreMasterContext)1 MasterRegistry (alluxio.master.MasterRegistry)1 MasterUtils (alluxio.master.MasterUtils)1 TestSafeModeManager (alluxio.master.TestSafeModeManager)1 DefaultBlockMaster (alluxio.master.block.DefaultBlockMaster)1 MutableInodeFile (alluxio.master.file.meta.MutableInodeFile)1 HeapBlockStore (alluxio.master.metastore.heap.HeapBlockStore)1 RocksBlockStore (alluxio.master.metastore.rocks.RocksBlockStore)1 RocksInodeStore (alluxio.master.metastore.rocks.RocksInodeStore)1 MetricsMasterFactory (alluxio.master.metrics.MetricsMasterFactory)1 Block (alluxio.proto.meta.Block)1