use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class IgniteWalReaderTest method testTxRecordsReadWoBinaryMeta.
/**
* Tests transaction generation and WAL for putAll cache operation.
*
* @throws Exception if failed.
*/
@Test
public void testTxRecordsReadWoBinaryMeta() throws Exception {
Ignite ignite = startGrid("node0");
ignite.cluster().state(ClusterState.ACTIVE);
Map<Object, IndexedObject> map = new TreeMap<>();
for (int i = 0; i < 1000; i++) map.put(i, new IndexedObject(i));
ignite.cache(CACHE_NAME).putAll(map);
ignite.cluster().state(ClusterState.INACTIVE);
String workDir = U.defaultWorkDirectory();
String subfolderName = genDbSubfolderName(ignite, 0);
stopAllGrids();
IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(new NullLogger());
IteratorParametersBuilder params = createIteratorParametersBuilder(workDir, subfolderName);
scanIterateAndCount(factory, params.filesOrDirs(workDir), 1000, 1, null, null);
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class StandaloneWalRecordsIteratorTest method testBinaryMetadataWriterStopped.
/**
* Checks if binary-metadata-writer thread is not hung after standalone iterator is closed.
*
* @throws Exception if test failed.
*/
@Test
public void testBinaryMetadataWriterStopped() throws Exception {
String dir = createWalFiles();
final IgniteWalIteratorFactory factory = new IgniteWalIteratorFactory(new NullLogger());
IgniteWalIteratorFactory.IteratorParametersBuilder iterParametersBuilder = new IgniteWalIteratorFactory.IteratorParametersBuilder().filesOrDirs(dir).pageSize(4096);
try (WALIterator stIt = factory.iterator(iterParametersBuilder)) {
}
boolean binaryMetadataWriterStopped = GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override
public boolean apply() {
Set<String> threadNames = Thread.getAllStackTraces().keySet().stream().map(Thread::getName).collect(Collectors.toSet());
return threadNames.stream().noneMatch(t -> t.startsWith("binary-metadata-writer"));
}
}, 10_000L);
assertTrue(binaryMetadataWriterStopped);
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class CleanupRestoredCachesSlowTest method testLongOperationAsyncExecutor.
/**
* @throws Throwable if failed.
*/
@Test
public void testLongOperationAsyncExecutor() throws Throwable {
FilePageStoreManagerChild.LongOperationAsyncExecutorChild executor = new FilePageStoreManagerChild.LongOperationAsyncExecutorChild("test", new NullLogger());
final AtomicInteger ai = new AtomicInteger(1);
AtomicReference<Throwable> throwable = new AtomicReference<>();
for (int i = 0; i < 1000; i++) {
executor.async(() -> {
ai.set(0);
doSleep(3);
try {
assertEquals(0, ai.get());
} catch (AssertionError e) {
throwable.set(e);
}
ai.set(1);
});
executor.afterAsyncCompletion(() -> {
assertEquals(1, ai.get());
return null;
});
}
if (throwable.get() != null)
throw throwable.get();
}
Aggregations