Fixed all RocksJava test failures in Centos and Alpine (#9395)

Summary:
Fixed all RocksJava test failures in Centos and Alpine 32 bit and 64 bit OSes

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9395

Reviewed By: mrambacher

Differential Revision: D33771987

Pulled By: ajkr

fbshipit-source-id: fed91033b8df08f191ad65e1fb745a9264bbfa70
This commit is contained in:
Si Ke 2022-02-04 16:00:39 -08:00 committed by Facebook GitHub Bot
parent 83ff350ff2
commit 2c3a780901
5 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ jlong Java_org_rocksdb_LRUCache_newLRUCache(JNIEnv* /*env*/, jclass /*jcls*/,
static_cast<size_t>(jcapacity), static_cast<int>(jnum_shard_bits),
static_cast<bool>(jstrict_capacity_limit),
static_cast<double>(jhigh_pri_pool_ratio)));
return reinterpret_cast<jlong>(sptr_lru_cache);
return reinterpret_cast<size_t>(sptr_lru_cache);
}
/*

View File

@ -551,7 +551,7 @@ jlong Java_org_rocksdb_WriteBatchWithIndex_iteratorWithBase(
jread_opts_handle);
auto* iterator =
wbwi->NewIteratorWithBase(cf_handle, base_iterator, read_opts);
return reinterpret_cast<jlong>(iterator);
return reinterpret_cast<size_t>(iterator);
}
/*

View File

@ -105,7 +105,7 @@ public class EnvOptionsTest {
@Test
public void compactionReadaheadSize() {
try (final EnvOptions envOptions = new EnvOptions()) {
final int intValue = rand.nextInt();
final int intValue = rand.nextInt(2147483647);
envOptions.setCompactionReadaheadSize(intValue);
assertThat(envOptions.compactionReadaheadSize()).isEqualTo(intValue);
}
@ -114,7 +114,7 @@ public class EnvOptionsTest {
@Test
public void randomAccessMaxBufferSize() {
try (final EnvOptions envOptions = new EnvOptions()) {
final int intValue = rand.nextInt();
final int intValue = rand.nextInt(2147483647);
envOptions.setRandomAccessMaxBufferSize(intValue);
assertThat(envOptions.randomAccessMaxBufferSize()).isEqualTo(intValue);
}
@ -123,7 +123,7 @@ public class EnvOptionsTest {
@Test
public void writableFileMaxBufferSize() {
try (final EnvOptions envOptions = new EnvOptions()) {
final int intValue = rand.nextInt();
final int intValue = rand.nextInt(2147483647);
envOptions.setWritableFileMaxBufferSize(intValue);
assertThat(envOptions.writableFileMaxBufferSize()).isEqualTo(intValue);
}

View File

@ -399,8 +399,8 @@ public class EventListenerTest {
@Override
public void onFileTruncateFinish(final FileOperationInfo fileOperationInfo) {
assertEquals(fileOperationInfoTestData, fileOperationInfo);
super.onFileTruncateFinish(fileOperationInfo);
assertEquals(fileOperationInfoTestData, fileOperationInfo);
}
@Override

View File

@ -143,9 +143,9 @@ public class ReadOptionsTest {
public void readaheadSize() {
try (final ReadOptions opt = new ReadOptions()) {
final Random rand = new Random();
final long longValue = rand.nextLong();
opt.setReadaheadSize(longValue);
assertThat(opt.readaheadSize()).isEqualTo(longValue);
final int intValue = rand.nextInt(2147483647);
opt.setReadaheadSize(intValue);
assertThat(opt.readaheadSize()).isEqualTo(intValue);
}
}