Skip to content

Commit

Permalink
Refactor package structure (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
7hong13 authored Jun 24, 2024
1 parent 11a63a1 commit 44f8ec9
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docker/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.3'

services:
yorkie:
image: 'yorkieteam/yorkie:0.4.22'
image: 'yorkieteam/yorkie:0.4.24'
container_name: 'yorkie'
command: ['server', '--mongo-connection-uri', 'mongodb://mongo:27017']
restart: always
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.3'

services:
yorkie:
image: 'yorkieteam/yorkie:0.4.22'
image: 'yorkieteam/yorkie:0.4.24'
container_name: 'yorkie'
command: ['server', '--enable-pprof']
restart: always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import com.google.gson.Gson
import dev.yorkie.core.Client
import dev.yorkie.core.Client.SyncMode.Realtime
import dev.yorkie.core.Client.SyncMode.RealtimePushOnly
import dev.yorkie.core.PresenceInfo
import dev.yorkie.document.Document
import dev.yorkie.document.Document.Event.PresenceChanged
import dev.yorkie.document.json.JsonText
import dev.yorkie.document.operation.OperationInfo
import dev.yorkie.document.presence.PresenceInfo
import dev.yorkie.document.time.ActorID
import kotlin.random.Random
import kotlinx.coroutines.CoroutineScope
Expand Down
3 changes: 3 additions & 0 deletions yorkie/src/androidTest/kotlin/dev/yorkie/TestAnnotations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package dev.yorkie

/**
* Annotation to prevent TooManyRequestsException in JsonTree-related tests
*/
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class TreeTest
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import dev.yorkie.document.Document.Event.PresenceChanged
import dev.yorkie.document.Document.Event.PresenceChanged.MyPresence
import dev.yorkie.document.Document.Event.PresenceChanged.Others
import dev.yorkie.document.Document.Event.StreamConnectionChanged
import dev.yorkie.document.presence.PresenceInfo
import dev.yorkie.gson
import java.util.UUID
import junit.framework.TestCase.assertEquals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import dev.yorkie.api.toCrdtTree
import dev.yorkie.core.Client
import dev.yorkie.core.Client.SyncMode.Manual
import dev.yorkie.core.GENERAL_TIMEOUT
import dev.yorkie.core.Presence
import dev.yorkie.core.createClient
import dev.yorkie.core.withTwoClientsAndDocuments
import dev.yorkie.document.Document
Expand All @@ -23,6 +22,7 @@ import dev.yorkie.document.operation.OperationInfo
import dev.yorkie.document.operation.OperationInfo.SetOpInfo
import dev.yorkie.document.operation.OperationInfo.TreeEditOpInfo
import dev.yorkie.document.operation.OperationInfo.TreeStyleOpInfo
import dev.yorkie.document.presence.Presence
import dev.yorkie.gson
import kotlin.test.assertEquals
import kotlin.test.assertIs
Expand Down
2 changes: 1 addition & 1 deletion yorkie/src/main/kotlin/dev/yorkie/api/ElementConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import dev.yorkie.api.v1.treeNode
import dev.yorkie.api.v1.treeNodeID
import dev.yorkie.api.v1.treeNodes
import dev.yorkie.api.v1.treePos
import dev.yorkie.core.P
import dev.yorkie.document.crdt.CrdtArray
import dev.yorkie.document.crdt.CrdtCounter
import dev.yorkie.document.crdt.CrdtCounter.Companion.asCounterValue
Expand All @@ -47,6 +46,7 @@ import dev.yorkie.document.crdt.RgaTreeSplitPos
import dev.yorkie.document.crdt.Rht
import dev.yorkie.document.crdt.RhtNode
import dev.yorkie.document.crdt.TextValue
import dev.yorkie.document.presence.P
import dev.yorkie.document.time.ActorID
import dev.yorkie.document.time.TimeTicket.Companion.InitialTimeTicket
import dev.yorkie.util.IndexTreeNode
Expand Down
4 changes: 2 additions & 2 deletions yorkie/src/main/kotlin/dev/yorkie/api/PresenceConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package dev.yorkie.api

import dev.yorkie.api.v1.presence
import dev.yorkie.api.v1.presenceChange
import dev.yorkie.core.P
import dev.yorkie.core.PresenceChange
import dev.yorkie.document.presence.P
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.time.ActorID

internal typealias PBPresence = dev.yorkie.api.v1.Presence
Expand Down
6 changes: 4 additions & 2 deletions yorkie/src/main/kotlin/dev/yorkie/core/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ import dev.yorkie.api.v1.detachDocumentRequest
import dev.yorkie.api.v1.pushPullChangesRequest
import dev.yorkie.api.v1.removeDocumentRequest
import dev.yorkie.api.v1.watchDocumentRequest
import dev.yorkie.core.Presences.Companion.UninitializedPresences
import dev.yorkie.core.Presences.Companion.asPresences
import dev.yorkie.document.Document
import dev.yorkie.document.Document.DocumentStatus
import dev.yorkie.document.Document.Event.PresenceChanged.MyPresence.Initialized
import dev.yorkie.document.Document.Event.PresenceChanged.Others
import dev.yorkie.document.Document.Event.StreamConnectionChanged
import dev.yorkie.document.Document.Event.SyncStatusChanged
import dev.yorkie.document.presence.P
import dev.yorkie.document.presence.PresenceInfo
import dev.yorkie.document.presence.Presences.Companion.UninitializedPresences
import dev.yorkie.document.presence.Presences.Companion.asPresences
import dev.yorkie.document.time.ActorID
import dev.yorkie.util.Logger.Companion.log
import dev.yorkie.util.OperationResult
Expand Down
14 changes: 7 additions & 7 deletions yorkie/src/main/kotlin/dev/yorkie/document/Document.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ package dev.yorkie.document
import androidx.annotation.VisibleForTesting
import com.google.protobuf.ByteString
import dev.yorkie.api.toSnapshot
import dev.yorkie.core.P
import dev.yorkie.core.Presence
import dev.yorkie.core.PresenceChange
import dev.yorkie.core.PresenceInfo
import dev.yorkie.core.Presences
import dev.yorkie.core.Presences.Companion.UninitializedPresences
import dev.yorkie.core.Presences.Companion.asPresences
import dev.yorkie.document.Document.Event.PresenceChanged
import dev.yorkie.document.Document.Event.PresenceChanged.MyPresence
import dev.yorkie.document.Document.Event.PresenceChanged.Others
Expand All @@ -25,6 +18,13 @@ import dev.yorkie.document.json.JsonArray
import dev.yorkie.document.json.JsonElement
import dev.yorkie.document.json.JsonObject
import dev.yorkie.document.operation.OperationInfo
import dev.yorkie.document.presence.P
import dev.yorkie.document.presence.Presence
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.presence.PresenceInfo
import dev.yorkie.document.presence.Presences
import dev.yorkie.document.presence.Presences.Companion.UninitializedPresences
import dev.yorkie.document.presence.Presences.Companion.asPresences
import dev.yorkie.document.time.ActorID
import dev.yorkie.document.time.TimeTicket
import dev.yorkie.document.time.TimeTicket.Companion.InitialTimeTicket
Expand Down
4 changes: 2 additions & 2 deletions yorkie/src/main/kotlin/dev/yorkie/document/change/Change.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dev.yorkie.document.change

import dev.yorkie.core.PresenceChange
import dev.yorkie.core.Presences
import dev.yorkie.document.crdt.CrdtRoot
import dev.yorkie.document.operation.Operation
import dev.yorkie.document.operation.OperationInfo
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.presence.Presences
import dev.yorkie.document.time.ActorID

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.yorkie.document.change

import dev.yorkie.core.PresenceChange
import dev.yorkie.document.crdt.CrdtContainer
import dev.yorkie.document.crdt.CrdtElement
import dev.yorkie.document.crdt.CrdtRoot
import dev.yorkie.document.crdt.GCPair
import dev.yorkie.document.operation.Operation
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.time.TimeTicket

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.yorkie.core
package dev.yorkie.document.presence

import dev.yorkie.document.change.ChangeContext

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.yorkie.core
package dev.yorkie.document.presence

import dev.yorkie.document.time.ActorID

Expand Down
2 changes: 1 addition & 1 deletion yorkie/src/test/kotlin/dev/yorkie/api/ConverterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dev.yorkie.api
import com.google.protobuf.kotlin.toByteStringUtf8
import dev.yorkie.api.v1.jSONElement
import dev.yorkie.api.v1.operation
import dev.yorkie.core.PresenceChange
import dev.yorkie.document.Document
import dev.yorkie.document.change.Change
import dev.yorkie.document.change.ChangeID
Expand Down Expand Up @@ -40,6 +39,7 @@ import dev.yorkie.document.operation.SetOperation
import dev.yorkie.document.operation.StyleOperation
import dev.yorkie.document.operation.TreeEditOperation
import dev.yorkie.document.operation.TreeStyleOperation
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.time.ActorID
import dev.yorkie.document.time.ActorID.Companion.INITIAL_ACTOR_ID
import dev.yorkie.document.time.TimeTicket
Expand Down
1 change: 1 addition & 0 deletions yorkie/src/test/kotlin/dev/yorkie/core/ClientTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import dev.yorkie.document.change.Change
import dev.yorkie.document.change.ChangeID
import dev.yorkie.document.change.ChangePack
import dev.yorkie.document.change.CheckPoint
import dev.yorkie.document.presence.PresenceChange
import dev.yorkie.document.time.ActorID
import dev.yorkie.util.createSingleThreadDispatcher
import kotlin.test.assertEquals
Expand Down

0 comments on commit 44f8ec9

Please sign in to comment.