Skip to content
Permalink
Browse files

Fast fix fox calling OrientDB for every parent recalculation

Long-term solutions should be separating creation and storage time (using temporary ids before confirmation is received from storage engine)
  • Loading branch information
aurelijusb committed Aug 13, 2016
1 parent e38a984 commit d8bbab207f6b1c295580b2439d370f99b9a09578
@@ -78,9 +78,10 @@ Known Issues
* After gen-idea, no compiler library found
- Project settings -> Libraries -> *scala-library* -> Classes: Add from ~/.sbt/boot/*/scala-*
- Project settings -> Facets -> Compiler library: Choose *scaka-library*
* `JavaFx` runtime is only in `Oracle JRE 1.7+`, not in OpenJRE.
* `JavaFx` runtime is only in `Oracle JRE 1.7+`, in OpenJRE it must installed separately
- Internet is full of [examples](https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get)
how to install Oracle Java and make it as default.
- For Ubuntu and OpenJRE: `sudo apt-get install default-jre openjfx`

Useful links (for developers)
-----------------------------
@@ -45,12 +45,19 @@ with Saving[jp] with Loading[jp] with WithFileChooser {
// Infinity zooming and refresh
//

@volatile var coordinatesInProgress = false

private val grid2absoluteCron = new Timeline {
cycleCount = Timeline.Indefinite
keyFrames = Seq(
jfxKeyFrame2sfx(new KeyFrame(
Duration(10),
(e: ActionEvent) => absoluteToCachedCoordinates()
Duration(40),
(e: ActionEvent) =>
if (!coordinatesInProgress) {
coordinatesInProgress = true
absoluteToCachedCoordinates()
coordinatesInProgress = false
}
))
)
}
@@ -134,4 +141,4 @@ with Saving[jp] with Loading[jp] with WithFileChooser {
case e: Exception => println(s"Saving failed: $e")
}
}
}
}
@@ -29,6 +29,9 @@ class Node(val _x: Byte = 0, val _y: Byte = 0, protected val cache: Cache[Node]

private[auginte] val checkParentsConsistency = false // Useful for testing, but disabled in production

private var loaded = false
private var cachedParent: Option[zooming.Node] = None

//
// Structure
//
@@ -51,7 +54,19 @@ class Node(val _x: Byte = 0, val _y: Byte = 0, protected val cache: Cache[Node]

override def y: Byte = get[Byte]("y", _y)

override def parent: Option[zooming.Node] = if (isPersisted) cache(edge("out_Parent")) else super.parent

override def parent: Option[zooming.Node] = if (loaded) {
cachedParent
} else {
if (isPersisted) {
val rez = cache(edge("out_Parent"))
cachedParent = rez
if (rez.isDefined) {
loaded = true
}
rez
} else super.parent
}

override def children: List[zooming.Node] = if (isPersisted) cache(edges("in_Parent")).toList else super.children

0 comments on commit d8bbab2

Please sign in to comment.
You can’t perform that action at this time.