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
main
Si Ke 3 years ago committed by Facebook GitHub Bot
parent 83ff350ff2
commit 2c3a780901
  1. 2
      java/rocksjni/lru_cache.cc
  2. 2
      java/rocksjni/write_batch_with_index.cc
  3. 6
      java/src/test/java/org/rocksdb/EnvOptionsTest.java
  4. 2
      java/src/test/java/org/rocksdb/EventListenerTest.java
  5. 6
      java/src/test/java/org/rocksdb/ReadOptionsTest.java

@ -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);
}
/*

@ -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);
}
/*

@ -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);
}

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

@ -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);
}
}

Loading…
Cancel
Save