Skip to content

Commit

Permalink
Merge branch 'master' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nhachicha committed Jun 20, 2019
2 parents c810a3e + 97ee36d commit d9a26ca
Show file tree
Hide file tree
Showing 81 changed files with 7,407 additions and 7,571 deletions.
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
## 5.11.1(YYYY-MM-DD)
## 5.12.0(2019-06-20)

### Enhancements
* None.
* [ObjectServer] Added `SyncManager.refreshConnections()` that can be used to manually trigger a reconnect for all sessions. This is useful if the device has been offline for a long time or fail to detect that it regained connectivity. (Issue [#259](https://github.com/realm/realm-java-private/issues/259))
* Added `RealmResults.asJson()` in `@Beta` that returns the result of the query as a JSON payload (#6540).

### Fixed
* [ObjectServer] `PermissionManager` stopped working if an intermittent network error was reported. (Issue [#6492](https://github.com/realm/realm-java/issues/6492), since 3.7.0)
* The Kotlin extensions library no longer defines a `app_name`, which in some cases conflicted with the `app_name` defined by applications. (Issue [#6536](https://github.com/realm/realm-java/issues/6536), since 4.3.0)

### Compatibility
* Realm Object Server: 3.21.0-rc1 or later.
* Realm Object Server: 3.21.0 or later.
* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
* APIs are backwards compatible with all previous release of realm-java in the 5.x.y series.

### Internal
* None.
* Updated to Realm Core 5.22.0.
* Updated to Relm Sync 4.6.1.
* Updated to Object Store commit 7c3ff8235579550a3e3c6060c47140b2005174f5

## 5.11.0(2019-05-01)

NOTE: This version is only compatible with Realm Object Server 3.21.0 or later.

### Enhancements
* [ObjectServer] Added `RealmQuery.includeLinkingObjects()`. This is only relevant for Query-based Realms and tells subscriptions to include objects linked through `@LinkingObjects` fields as part of the subscription as well. Objects referenced through objects and lists are always included as a default. (Issue [#6426](https://github.com/realm/realm-java/issues/6426))
* Encryption now uses hardware optimized functions, which significantly improves the performance of encrypted Realms. ([Realm Core PR #3241](https://github.com/realm/realm-core/pull/3241))
Expand All @@ -32,7 +38,7 @@
* Native crash happening if bulk updating a field in a `RealmResult` would cause the object to no longer be part of the query result. (Issue [#6478](https://github.com/realm/realm-java/issues/6478), since 5.8.0).

### Compatibility
* Realm Object Server: 3.21.0-rc1 or later.
* Realm Object Server: 3.21.0 or later.
* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
* APIs are backwards compatible with all previous release of realm-java in the 5.x.y series.

Expand Down
4 changes: 2 additions & 2 deletions dependencies.list
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Realm Sync release used by Realm Java (This includes Realm Core)
# https://github.com/realm/realm-sync/releases
REALM_SYNC_VERSION=4.4.2
REALM_SYNC_SHA256=7f3386bc9e590788afc6fd61744dd187148862513ddbd7e65c32d1d9c371e1ce
REALM_SYNC_VERSION=4.6.1
REALM_SYNC_SHA256=eb4fbf83717156fabae6357199b22ef25546f2da24ded5668290351613faf9d0

# Object Server Release used by Integration tests. Installed using NPM.
# Use `npm view realm-object-server versions` to get a list of available versions.
Expand Down
19 changes: 11 additions & 8 deletions library-benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.31'
def properties = new Properties()
properties.load(new FileInputStream("${rootDir}/../dependencies.list"))

Expand All @@ -10,6 +11,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:${properties.get("GRADLE_BUILD_TOOLS")}"
classpath "io.realm:realm-gradle-plugin:${file("${rootDir}/../version.txt").text.trim()}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -22,18 +24,21 @@ allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'

android {
compileSdkVersion 27
compileSdkVersion 28
buildToolsVersion "${project.ext.get("ANDROID_BUILD_TOOLS")}"

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.benchmark.AndroidBenchmarkRunner"
}

buildTypes {
Expand All @@ -52,10 +57,8 @@ repositories {
}

dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'dk.ilios:spanner:0.6.0'
androidTestImplementation 'com.opencsv:opencsv:3.4'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation "androidx.benchmark:benchmark:1.0.0-alpha01"
androidTestImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
11 changes: 11 additions & 0 deletions library-benchmarks/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.realm.benchmarks">

<application
android:debuggable="false"
tools:ignore="HardcodedDebugMode"
tools:replace="android:debuggable"/>

</manifest>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/* Copyright 2019 Realm Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.realm.benchmarks

import androidx.benchmark.BenchmarkRule
import androidx.benchmark.measureRepeated
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import io.realm.Realm
import io.realm.RealmConfiguration
import io.realm.RealmList
import io.realm.benchmarks.entities.AllTypes
import io.realm.benchmarks.entities.AllTypesPrimaryKey
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import java.util.*


@RunWith(AndroidJUnit4::class)
class CopyToRealmBenchmarks {

@get:Rule
val benchmarkRule = BenchmarkRule()

private val COLLECTION_SIZE = 100
private lateinit var realm: Realm
private val noPkObjects = ArrayList<AllTypes>(COLLECTION_SIZE)
private val pkObjects = ArrayList<AllTypesPrimaryKey>(COLLECTION_SIZE)
private lateinit var complextTestObjects: ArrayList<AllTypesPrimaryKey>
private lateinit var simpleTestObjects: ArrayList<AllTypes>

@Before
fun before() {
Realm.init(InstrumentationRegistry.getInstrumentation().targetContext)
val config = RealmConfiguration.Builder().build()
Realm.deleteRealm(config)

// Create test data
complextTestObjects = ArrayList()
for (i in 0 until COLLECTION_SIZE) {
val obj = AllTypesPrimaryKey()
obj.columnString = "obj$i"
obj.columnLong = i.toLong()
obj.columnFloat = 1.23f
obj.columnDouble = 1.234
obj.isColumnBoolean = true
obj.columnDate = Date(1000)
obj.columnBinary = byteArrayOf(1, 2, 3)
obj.columnRealmObject = obj
obj.columnRealmList = RealmList(obj, obj, obj)
obj.columnBooleanList = RealmList(true, false, true)
obj.columnStringList = RealmList("foo", "bar", "baz")
obj.columnBinaryList = RealmList(byteArrayOf(0, 1, 2), byteArrayOf(2, 3, 4), byteArrayOf(4, 5, 6))
obj.columnByteList = RealmList(1.toByte(), 2.toByte(), 3.toByte())
obj.columnShortList = RealmList(1.toShort(), 2.toShort(), 3.toShort())
obj.columnIntegerList = RealmList(1, 2, 3)
obj.columnLongList = RealmList(1L, 2L, 3L)
obj.columnFloatList = RealmList(1.1f, 1.2f, 1.3f)
obj.columnDoubleList = RealmList(1.111, 1.222, 1.333)
obj.columnDateList = RealmList(Date(1000), Date(2000), Date(3000))
complextTestObjects.add(obj)
}

simpleTestObjects = ArrayList()
for (i in 0 until COLLECTION_SIZE) {
val obj = AllTypes()
obj.columnString = "obj$i"
obj.columnLong = i.toLong()
obj.columnFloat = 1.23f
obj.columnDouble = 1.234
obj.isColumnBoolean = true
obj.columnDate = Date(1000)
obj.columnBinary = byteArrayOf(1, 2, 3)
simpleTestObjects.add(obj)
}

// Setup Realm before test
realm = Realm.getInstance(config)
realm.beginTransaction()
}

@After
fun after() {
realm.cancelTransaction()
realm.close()
}

@Test
fun copyToRealm_complexObjects() = benchmarkRule.measureRepeated {
realm.copyToRealmOrUpdate(complextTestObjects)
}

@Test
fun copyToRealm_simpleObjects() = benchmarkRule.measureRepeated {
realm.copyToRealm(simpleTestObjects)
}

}
Loading

0 comments on commit d9a26ca

Please sign in to comment.