use of io.questdb.std.FilesFacadeImpl in project questdb by bluestreak01.
the class SqlCompilerTest method testInsertAsSelectTemporaryIOError.
@Test
public void testInsertAsSelectTemporaryIOError() throws Exception {
AtomicBoolean inError = new AtomicBoolean(true);
FilesFacade ff = new FilesFacadeImpl() {
int pageCount = 0;
@Override
public long getMapPageSize() {
return getPageSize();
}
@Override
public long mmap(long fd, long len, long offset, int flags, int memoryTag) {
if (inError.get() && pageCount++ == 13) {
return -1;
}
return super.mmap(fd, len, offset, flags, memoryTag);
}
};
assertInsertAsSelectIOError(inError, ff);
}
use of io.questdb.std.FilesFacadeImpl in project questdb by bluestreak01.
the class SqlCompilerTest method testInsertAsSelectPersistentIOError.
@Test
public void testInsertAsSelectPersistentIOError() throws Exception {
AtomicBoolean inError = new AtomicBoolean(true);
FilesFacade ff = new FilesFacadeImpl() {
int pageCount = 0;
@Override
public long getMapPageSize() {
return getPageSize();
}
@Override
public long mmap(long fd, long len, long offset, int flags, int memoryTag) {
if (inError.get() && pageCount++ > 12) {
return -1;
}
return super.mmap(fd, len, offset, flags, memoryTag);
}
};
assertInsertAsSelectIOError(inError, ff);
}
use of io.questdb.std.FilesFacadeImpl in project questdb by bluestreak01.
the class SqlCompilerTest method testCreateAsSelectIOError2.
@Test
public void testCreateAsSelectIOError2() throws Exception {
String sql = "create table y as (" + "select rnd_symbol(4,4,4,2) a from long_sequence(10000)" + "), cast(a as STRING)";
final FilesFacade ff = new FilesFacadeImpl() {
int mapCount = 0;
@Override
public long getMapPageSize() {
return getPageSize();
}
@Override
public long mmap(long fd, long len, long offset, int flags, int memoryTag) {
// and then fails to close txMem
if (mapCount++ > 2) {
return -1;
}
return super.mmap(fd, len, offset, flags, memoryTag);
}
};
assertFailure(ff, sql, "Could not create table. See log for details");
}
use of io.questdb.std.FilesFacadeImpl in project questdb by bluestreak01.
the class SqlCompilerTest method testCreateAsSelectIOError.
@Test
public void testCreateAsSelectIOError() throws Exception {
String sql = "create table y as (" + "select rnd_symbol(4,4,4,2) a from long_sequence(10000)" + "), cast(a as STRING)";
final FilesFacade ff = new FilesFacadeImpl() {
int mapCount = 0;
@Override
public long getMapPageSize() {
return getPageSize();
}
@Override
public long mmap(long fd, long len, long offset, int flags, int memoryTag) {
if (mapCount++ > 5) {
return -1;
}
return super.mmap(fd, len, offset, flags, memoryTag);
}
};
assertFailure(ff, sql, "Could not create table. See log for details");
}
use of io.questdb.std.FilesFacadeImpl in project questdb by bluestreak01.
the class O3FailureTest method testPartitionedDataAppendOODataIndexed.
@Test
public void testPartitionedDataAppendOODataIndexed() throws Exception {
counter.set(3);
executeWithoutPool(O3FailureTest::testPartitionedDataAppendOODataIndexedFailRetry0, new FilesFacadeImpl() {
@Override
public long openRW(LPSZ name) {
if (Chars.endsWith(name, "1970-01-06" + Files.SEPARATOR + "timestamp.d") && counter.decrementAndGet() == 0) {
return -1;
}
return super.openRW(name);
}
});
}
Aggregations